Getting Started
The sheepAPI is the platform that supports sheepCRM, sheepTeams and sheepApp and the many partners that connect to Sheep data. The API is divided into two parts: the core system API and the self-service API. For apps wanting to provide an interface for a single contact, the self-service API will be of most use. The core API gives access to all data.
Prerequisites
Section titled “Prerequisites”You need to have already registered for a Sheep database and have an active user account.
We’ll use the wonderful httpie HTTP client in this document. See their site for installation instructions for your platform.
Sheep APIs follow the RESTful design model wherever possible. HTTP verbs should be expected to work on all resources unless otherwise documented. We recommend testing API calls using httpie before implementing in code.
Setting up your environment
Section titled “Setting up your environment”The examples will frequently refer to $FLOCK in the URL. You should replace this with the database that you want to work with. On a Mac use:
export FLOCK=exampleThen most URL examples can be copied directly.
Check Sheep is up
Section titled “Check Sheep is up”Verify that the API is available and that your environment is working properly.
http https://api.sheepcrm.com/api/v1/ping/
HTTP/1.1 200 OK{ "message": "pong"}Checking your permissions
Section titled “Checking your permissions”Once you have successfully pinged the API, try an authenticated call. To do this you will need to set two environment variables or replace the tokens with your actual values in the example.
export FLOCK=exampleexport API_KEY=my-secret-api-keyhttp https://api.sheepcrm.com/api/v1/$FLOCK/ Authorization:"Bearer $API_KEY"Or with the values inline:
http https://api.sheepcrm.com/api/v1/example/ Authorization:"Bearer my-secret-api-key"You are expecting an HTTP 200 response with a list of resources. A 403 FORBIDDEN response indicates a problem with your API key or your permissions.
Next steps
Section titled “Next steps”- Authentication — API keys, Bearer tokens, and OAuth2
- HTTP Conventions — Status codes, verbs, and throttling
- Terminology — Key concepts and glossary