Introduction to the Vetspire API

Welcome to the Vetspire API! The Vetspire API is built on top of the GraphQL specification—a simple and powerful querying language first developed by Facebook. GraphQL now powers some of the world's most sophisticated technology companies from Facebook to Github. GraphQL enables you to ask for exactly the type of data you want, and the server will deliver predictable results. You have the full flexibility to call whatever it is need you need from the schema, and you get to decide the shape of the data that is returned to you.

To ensure that you are safe while testing, we expose both a testing environment for you to test your clients as well as the production environment. Further, you will generate separate API keys for both testing and production. You can read more about how to generate API keys and how to use them to authenticate below. Your testing API key will not work on production and vis versa. Our endpoints are displayed for you on the right.

We will announce any changes to the API on the Vetspire API announcement mailing list. Please subscribe to ensure that you stay updated on changes to our API.

Happy APIing!

API Production Endpoint
https://api2.vetspire.com/graphql
API Testing Endpoint
https://api.staging.vetspire.com/graphql
API Sandbox Endpoint
https://api.sandbox.vetspire.com/graphql

Authentication

Every request made to our API Endpoint must include an Authorization header which includes your secret API Key. Your secret API Key enables read and write access to your entire organization's data, so keep it safe and secret! It should be treated equivalently to an administrator's password. Your API Key should never be shared in public spaces. You should take extra precaution to ensure that your API keys are never committed to your public git repositories.

On your administrator dashboard, you'll be able to generate API keys for both testing and production use. You can revoke old keys and generate new ones at any time.

For every request made to the API, you should include the API Key in the header of your HTTPS request under "Authorization". Any request made without a valid Authorization header will return a 403 error response. See an example using curl on the right. Furthermore, all API requests must be made over HTTPS.

Every GraphQL request is replied with by a valid JSON string that represents the data being fetched or any errors incurred in the fetching (e.g. if you are unauthorized to access the data being requested).

Example API Request
$ curl https://api.staging.vetspire.com/graphql \
-X POST \
-H "Authorization: YOUR_API_KEY" \
-d query="query { org { id, name } }"
Example API Response
{
  "data": {
    "org": {
      "name": "Test Org",
      "id": "1"
    }
  }
}

API Reference

On the left-hand side of our developer documentation, you will see a list of all available queries, mutations, and types. You can navigate to explore more.

Every query will be referenced by the query name followed by its return value and then its list of arguments. Here's an example

getExamples :: [ExampleReturnType]

Description of the Query

ArgumentTypeDescription
typeString!Full-text search of examples by type

The brackets around types (e.g. [String]) indicates that the type will be a list of types (e.g. a list of strings).

The exclamation point following a type (e.g. ID!) indicates that the argument is required.