Reporting API

Fortumo’s Reporting API allows you to automatically import data on your transactions into your own business intelligence systems, without having to view or download that data from Fortumo’s Dashboard manually.

Reporting API allows you to fetch report data in semicolon separated UTF-8 CSV format for Revenue, Detailed Revenue reports.

Initiating report generation

Make GET request to report generation endpoint corresponding to the required report type:

Report Report type Endpoint URL
Revenue revenue https://api-reports.fortumo.io/api/reports/revenue/new
Detailed Revenue revenue_detailed https://api-reports.fortumo.io/api/reports/revenue_detailed/new
Request GET parameters
Name Description
from Start date value, format YYYY-mm-dd
to End date value, format YYYY-mm-dd
key Reporting API key
sig Signature, MD5 hash. Signed with Reporting API secret. Signature is added as sig parameter and calculated as MD5 checksum of the request parameters and secret concatenated together. Before calculating the signature, it is important to sort the parameters alphabetically.
Example request

https://api-reports.fortumo.io/api/reports/revenue/new?from=2012-07-12&to=2012-07-15&key=668a75286757a1d7602a7f0d3df5a331&sig=86719074b00648a0b9d008da8d01370d

Response parameters
Name Description
state Shows if the file is available for downloading. [new | completed | failed]
id Unique name to identify the specific report file.
Example response
1
2
3
4
{
    "state": "new",
    "id": "6ea6639395bb3be2d512504c92930c17"
}
Error codes
Code Description
400 Malformed request, required parameters missing.
500 Internal error has occurred.

Checking report generation status

Status checks must not be more frequent than once every 60 seconds.

Make GET request to report status check endpoint:

https://api-reports.fortumo.io/api/reports/status

Request parameters
Name Description
id Unique ID value for the CSV file, returned for the first API request.
key Reporting API key
sig Signature, MD5 hash.
Example request

https://api-reports.fortumo.io/api/reports/status?id=6ea6639395bb3be2d512504c92930c17&key=0123456789abcdef0123456789abcdef&sig=86719074b00648a0b9d008da8d01370d

Response parameters (JSON)
Name Description
state Shows if the file is available for downloading. [new | completed | failed]
id Unique name to identify the specific report file.
Example responses (JSON)

In progress:

1
2
3
4
{
    "state": "new",
    "id": "6ea6639395bb3be2d512504c92930c17"
}

Completed:

1
2
3
4
{
    "state": "completed",
    "id": "6ea6639395bb3be2d512504c92930c17"
}

Failed:

1
2
3
{
    "error": "Report not found"
}

Report download

After report generation status check has returned completed, generated CSV file can be downloaded by making GET request to:

https://api-reports.fortumo.io/api/reports/report

Request parameters
Name Description
id Unique ID value for the current CSV file, returned when initiating report generation
key Reporting API key.
sig Request signature, MD5 hash.
Example request

https://api-reports.fortumo.io/api/reports/report?id=6ea6639395bb3be2d512504c92930c17&key=0123456789abcdef0123456789abcdef&sig=f2947677459d06309151f79e2504c5e2

Response

Report download will begin following the found redirect on the 'Location' returned in the response. Report will be downloaded as a semicolon separated UTF-8 CSV format file.

Help us improve our Merchants Portal. Was this article helpful?