The first thing to do is acquire access credentials from CRO software. Please review the Authentication Guide for more information.
Tokens, Scopes, Users, & Passwords
An access token is used to authenticate your software to the CRO Developer API. The user and password are used to authenticate users to your software. Scopes determine what functionality your software will have access to. See the Authentication Guide for more on how to authenticate your applications.
All errors are handled similarly. The HTTP response status line will describe what happened (human readable):
...and the body will contain a structured reponse:
In this example, you could refer to the CreateCustomerModel for more information about the expected fields. Input errors will contain a model name and/or field names that can be referenced in the documentation. The 'detail' field of the error schema will contain the reason the request was rejected.
Request Data Formats
Currently only JSON is supported.
Response Data Formats
Currently only JSON is supported. Some endpoints may return reports in other formats; refer to each endpoint's documentation for details.
The access token(s) you'll be issued grant you access to the API. The scope(s) granted to each token determine which API functions you can access. The CRO user you log in with determines which role(s) are assigned. The roles the user is assigned determine which endpoints are accessible and also what data is returned by each endpoint. Refer to each endpoint's documentation for details on which roles have access and what data will be returned.
Sample Script: Export Customers
In this sample we'll export customers using the CRO Developer API and the requests library. Refer to the code below. Replace 'your-token-here', 'my-api-url-here', and 'your-tenant-id-here' with the values issued by CRO Software.
If you're not sure what these values should be, contact CRO Software.
Note the response from
/customers is a paged result set. All endpoints in the API return lists as paged responses with this format. In the next section we'll iterate the results and print them to the console.
The fields of a paged result set have the same basic schema:
To iterate through all customers, you need to write the code to request the pages in a loop: