PLEASE, READ CAREFULLY THIS SECTION
Before starting
In order to use the OA’s API, developers must register their client applications and obtain the related security credentials.
The API base URL
The API base URL is: https://opinionage.com/api
eg to list the categories:
GET 'https://opinionage.com/api/1/categories'
Security
There’re three levels of security used by the different API methods:
- developer’s credentials: provide your personal credentials (email and password)
- client’s credentials: provide your application’s credentials (app_id and app_secret)
- access token: provide the end-user access token (see oauth2 for more info)
As a rule of thumb:
- the
developer's credentialsare required to interact with theapplicationsmethods - the
access tokencredential is always clearly conveyed by the API method as url parameter - the other methods require the
client's credentials
Domains
A domain is the space where topics ‘live’. Every domain is separate from the others and each client application can interact with one ore more domains.
The ‘public domain’ is: opinionage
When invoking an API, to specify the target domain, use the Request Header domain. If not present, the self domain is understood (the self domain is equal to the client app_id)
PLEASE NOTE: currently all clients applications can uniquely access the public domain, so they’re required to use it at the invocation time.
So, you request header must contain:
RequestHeaders => domain : opinionage
Error conditions
Generic errors
Status: 400 Bad Request
Content-Type: application/json
Security errors
Depending on the provided credentials and the specific API, you could receive the following error responses:
Status: 401 Unauthorized
Content-Type: application/json
or
Status: 403 Forbidden
Content-Type: application/json