Retrieve Token
Once you have set up a project App, you can then request an access token using your Client ID and Client Secret.
Access tokens are valid for 2 hours from the time they are issued.
To help prevent abuse and ensure fair use for all users, we currently enforce a rate limit of 10 tokens per hour per IP address. This restriction helps protect the system from automated misuse and excessive traffic from a single source.
HTTP REQUEST
We assume the base domain is five.epicollect.net
POST /api/oauth/token
therefore https://five.epicollect.net/api/oauth/token
POST Parameters
grant_type
yes
Must have value 'client_credentials'.
client_id
yes
The Client ID of your project App.
client_secret
yes
The Client Secret of your project App.
Here is an example based on our EC5 API Private project, using jQuery (more on jQuery Ajax requests):
var params = {
grant_type: 'client_credentials',
client_id: 153,
client_secret: 'J7SZDPssR885Fo0xczGKqkJfa5XyMK8wxbrOYjio'
}
$.ajax({
url: 'https://five.epicollect.net/api/oauth/token',
type: 'POST',
contentType: 'application/vnd.api+json',
data: JSON.stringify(params),
success: function(response) {
console.log(JSON.stringify(response));
},
error: function(xhr, status, error) {
console.log(xhr.responseText);
}
});Please note you cannot access the data using a browser!
HTTP Response
If you run the code above, this is the response you get:
Last updated