No access

Step 5. Calling the Brincr API

  1. We created an example script in PHP to make a curl request to the Brincr API. This is just an example of doing a GET request to the categories endpoint. 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';
        $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 API base url is https://sandbox-api.brincr.com/api/v1/. After that we add categories to 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 kind of requests to the Brincr API.

    Headers

    The Accept and Authorization headers are required for every call to the Brincr API. The Accept header is set to application/json because all of the API's responses will be in json. For the Authorization header you are required to pass a valid access token (with the correct scopes) otherwise the Brincr API will return a 401 Unauthorized or 403 Forbidden response.

  2. Responses

    Below are listed all the possible responses the Brincr API can give.

    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 tenant

    403

    Forbidden / Invalid authentication supplied
    This usually happens when the required scopes are missing from the access token

    404

    Entity not found

    405

    Method Not Allowed

    422

    Unprocessable Entity / Validation exception

    429

    Too many requests are send

    500

    Internal Server Error