Skip to main content
Company Report API

The following describes the steps needed to be taken in order to use our Report API in order to generate and fetch PDF reports.

Updated over 8 months ago
  1. Create account

Navigate to Roaring Onboarding and create a roaring account.

When the account has been created you need to push the "Activate" button and put the account in production mode allowing for fetching real company information.

2. Fetch application keys used for authenticating towards API services

  1. Navigate to the Integration Suite pages by clicking "Integration" in the "bento menu" located at the top right.

2. Then you navigate to the "API keys" page in the top menu
​

3. The application keys are divided into sandbox and production, for fetching reports in production you need the keys marked "Production keys"

3. Authenticate towards our OAuth token service using the production keys

By calling our token service using your production keys you fetch the access-token needed in order to call the Report API. The token API is called with the credentials put into an Basic Authorization header as a Base64 encoded string

  1. Base64 encode the client id and secret.
    The client id and secret is put together with a colon ":" in between and then base64 encoded. Here is an example on how to do this using openssl terminal tool:

    echo -n 'clientId:clientSecret' | openssl base64

    NOTE: "clientId" and "clientSecret" in the example are placeholders for the actual id and secret.

  2. The token service (url: https://api.roaring.io/token) can then be called with the credentials in order to retrieve an access-token (example using curl):

curl -k -d "grant_type=client_credentials" -H "Authorization: Basic Base64(consumer-key:consumer-secret)" <https://api.roaring.io/token>

This call responds with an access-token in json response:

{ "access_token": "6b2e1270-7g2w-4cd3-7e5e-a92344e5c4bd", "token_type": "Bearer", "expires_in": 3600 }

4. Call the Report API using companyId for the company to evaluate.

Now you can use the access-token in order to fetch a Risk evaluation PDF report from our API. You call the endpoint with the companyId for the company to evaluate and a name of the person that fetches the report in order to, in audit purpose, mark the generated report with the name of the requester. Example of API call using curl:

curl -k -H "Authorization: Bearer 6b2e1270-7g2w-4cd3-7e5e-a92344e5c4bd" -H "Content-Type: application/json" \

-d '{"createdByEmail": "[email protected]", "createdByName": "John Doe", "language": "sv"}' \ <https://api.roaring.io/se/company/reports/1.0/report/risk-evaluation/company/{companyId}>

The response contains a download link for fetching the generated PDF report:

{

"records": [

{

"documentId": "cnngkolrj5dveer306kg",

"downloadLink": "<https://shared.roaring.io/report-documents/prod/cnngkolrj5dveer306kg.pdf?X-Amz-Algorith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EZA%2BJvdRxzO1yoYY9D82%2FYaWNcYPHtQYs7FgVKf5SuBxriaH8Zxf8WctZOTtIcBHjD%2B0urmhh7SXkhp4w4Ptc3x7NqQR%2FjWekowtz0SKZ0zSq3hlQKgt4W3%2FXVMw%3D%3D&X-Amz-SignedHeaders=host&X-Amz-Signature=b6a69d3e03c529b3adf05bf70dd3c8472530cae59b0c618de2eca32f049608d4>",

"fileExtension": "pdf", "fileName": "cnngkolrj5dveer306kg.pdf"

}

],

"status": {

"code": 0,

"text": "records found"

}

}

The generated PDF report download link will be usable for 24 hours after report creation.


​


​

Did this answer your question?