Skip to content

Authentication

All authenticated API calls require a Bearer token in the Authorization header.

The simplest way to authenticate is with an API key. You can set your own API key by logging into sheepCRM and navigating to Profile settings.

Once you have a key, include it as a Bearer token in the Authorization header:

http https://api.sheepcrm.com/api/v1/$FLOCK/ Authorization:"Bearer $API_KEY"

For convenience, export your key as an environment variable:

Terminal window
export API_KEY=my-secret-api-key
export FLOCK=example

Then you can use the variables directly in httpie commands:

http https://api.sheepcrm.com/api/v1/$FLOCK/ Authorization:"Bearer $API_KEY"

A successful response returns HTTP 200 with a list of available resources. A 403 FORBIDDEN response indicates a problem with your API key or permissions.


For applications that need to authenticate users via OAuth2 (e.g. website single sign-on), you must register your application as an OAuth client.

  1. Navigate to https://auth.sheepcrm.com/o/applications/
  2. Register the client with the following settings:
FieldDescription
Client NameA human-readable name shown in messages like “{Client Name}” wants to access your information
Client TypeChoose confidential
Authorization grant typeChoose Authorization code
Redirect URIsProvide one callback URL that will retrieve an access token. It must be a valid URL using https://. Your website plugin or system will tell you the value to use.
FlockThe sheepCRM database identifier. Required unless the client is for multiple Sheep databases.
LogoA secure (https) URL to a square logo, used during the login process.
Security PolicyA secure (https) URL to your application’s security policy.
Terms and ConditionsA secure (https) URL to your application’s terms and conditions.
Your contact detailsNot made public; used by sheepCRM to communicate with you about your integration.
  1. A Client ID and Client Secret are returned — keep these safe.

Use the Client ID and Secret with the following endpoints:

EndpointURL
Authorizationhttps://auth.sheepcrm.com/o/authorize/
Tokenhttps://auth.sheepcrm.com/o/token/
User informationhttps://iam.sheepcrm.com/userinfo/
Token URL methodPOST
ScopeDescription
readView profile information: first_name, last_name, photo
writeUpdate profile
read_membershipView membership information: active_member, membership_type, membership_start_date, membership_end_date
introspectionIntrospect token scope
ParameterDescription
flockYour Sheep database identifier. Required if the client is for multiple Sheep databases.
approval_promptforce — users are always prompted for authorization. auto — users are prompted only the first time; subsequent authorizations for the same application and scopes are automatically accepted.