Step 5. Calling the Brincr API
-
We created an example script in
PHPto make acurlrequest to the Brincr API. This is just an example of doing aGETrequest to thecategoriesendpoint. You can find a full list of all our endpoints in the Swagger documentation.function callCategoriesEndpoint() { $url = 'https://sandbox-api.brincr.com/api/v1/categories'; // Sandbox $url = 'https://api.brincr.com/api/v1/categories'; // Production $curl = curl_init(); $headers = [ 'Accept: application/json', 'Authorization: Bearer YOUR_ACCESS_TOKEN', ]; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_HTTPGET, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($curl); $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); }URL
The Sandbox API base URL is
https://sandbox-api.brincr.com/api/v1/.
The Production API base URL ishttps://api.brincr.com/api/v1/.
After that we addcategoriesto access the categories endpoint. For a full list of endpoints (and their corresponding URLs) go to the Swagger documentation. Here you can also find more examples on how to make different kinds of requests to the Brincr API.Headers
The
AcceptandAuthorizationheaders are required for every call to the Brincr API. TheAcceptheader is set toapplication/jsonbecause all of the API's responses are injsonformat. For theAuthorizationheader you are required to pass a validaccess token(with the correct scopes) otherwise the Brincr API will return a401 Unauthorizedor403 Forbiddenresponse. -
Responses
Below, all the possible responses the Brincr API can give are listed.
200
Successful operation
201
Successfully created
204
Successful operation
401
Unauthorized / Action not allowed
This can happen when no or an invalid access token is provided, the user is inactive or the access token contains invalid data such as an invalid tenant403
Forbidden / Invalid authentication supplied
This usually happens when the required scopes are missing from the access token404
Entity not found
405
Method Not Allowed
422
Unprocessable Entity / Validation exception
429
Too many requests are sent
500
Internal Server Error
-
The Brincr API has a rate limit of 60 requests per minute. We also have an overall fair use policy of 6500 daily requests. We kindly ask you to respect these limits and the fair use policy. In case you exceed these limits, you will receive a
429 Too Many Requestsresponse. After which you will have to wait 60 seconds before sending a new request.
Keep in mind, in case you systemically exceed the rate limit we will be forced to disable your integration.Note: Your rate limit can be increased for an increased monthly fee. If you expect to require an increased rate limit per minute, please contact our Sales team by email or +31 (0)85 – 273 35 36.