Application Programming Interface (API) to support MEA reporting parties in access to data.
Getting Started
Signing up for API access
You can sign up for an API account here. Once you have signed up, sign in to access your user profile and retrieve your generated token.
Authenticating your requests
Your authentication token needs to be passed into every request you make via the HTTP header X-Authentication-Token
.
Tokens can be obtained and regenerated from your user profile.
Tools for testing the API
There are a number of free tools available that allow you to test the API before you start integrating it in your systems. For example, curl
is a popular command-line tool that could be used for this purpose:
curl -i "http://ors-api-host/api/v1/questionnaires.xml" -H "X-Authentication-Token:YOUR_TOKEN_HERE"
There are also a number of tools that can be installed as an add-on to your browser; they can be found for example by searching for "rest client" in the add-ons repository for your browser.
Formats
All endpoint can return both JSON and XML data. The default is JSON, if you would like to receive XML data, you can add .xml to the endpoint as below:
http://ors-api-host/api/v1/questionnaires.xml
Optional parameters
Whereas authentication is passed via a HTTP header, other parameters for refining your response data are provided via the query string. These are detailed below and where appropriate in the documentation for each endpoint. Parameters can be combined.
Resources
Questionnaire
Resource | Description |
---|---|
GET api/v1/questionnaires/:id | Questionnaire details |
GET api/v1/questionnaires | List of questionnaires |
Question
Resource | Description |
---|---|
GET api/v1/questions/:questionnaire_id/questions/:id | Question details |
GET api/v1/questions/:questionnaire_id/questions | List of questions |