API
Downloading Data and Reports via the API
Last updated
Downloading Data and Reports via the API
Last updated
This feature allows you to download data and reports using the Crewmojo API. You can automate this process so that you can get a consistent stream of data and statistics for your system. For example, to populate a B.I. platform.
Endpoints:
Environment | URL |
---|---|
Request Type:
POST
Content Type:
The reports are returned in either:
csv format which is the default. In this case the first row being the column headings.
json format. Set contentType to be json in the request body. See below.
Security:
The API will only accept encrypted connections over TLS (https).
Retrieve a short-lived Access Token (see here). You need to add this token to the 'Authorization' header of your HTTP POST:
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cC...7rZ43t
Request Path:
Value | Description |
---|---|
Request Body:
Value | Type | Description |
---|---|---|
Each data report is identified by a string which is appended to the above endpoint paths.
For example, to get a summary of 1:1's completed over a date range, the request would be something like this:
Response:
Please speak to us about the reports available and their corresponding identifiers.
If a report takes longer than 30 seconds to generate, then it is considered a long running report. In this case, the report API will return a jobId which you will then use to poll for a result.
Each jobId will expire 10 minutes after the original request. Make sure you retrieve the report data before this time.
Endpoints:
Request Type:
GET
Content Type:
text/csv
The reports are returned in csv format with the first row being the column headings.
Security:
Same security as above
Request Path:
Response:
The possible responses are the same as the initial request responses.
If the total time exceeds 5 minutes, then abandon the report request and try again. If this continues, please contact us.
Code | Description / Example |
---|---|
Environment | URL |
---|---|
Value | Description |
---|---|
Test
https://api.test.crewmojo.com/v1/integrations/download/*
Production
https://api.crewmojo.com/v1/integrations/download/*
rrrrrrr is the report identifier. Please speak to us about reports that you can access for your solution.
startDate
numeric, yyyymmdd format (optional)
start and end dates need to be present together
endDate
numeric, yyyymmdd format (optional)
start and end dates need to be present together
contentType
string
The data returned is csv by default. If you prefer json to be returned, then set contentType to json in the request body.
jobId
bool, true or false (optional)
Setting this value to true will force the report server to delay 30 seconds and return a jobId. This is useful for testing long running report process - see below.
200
Success, report data returned immediately
Content-Type: text/csv
200
400
Invalid data error
Content-Type: application/json
401
Unauthorized error
Content-Type: application/json
500
Internal Server Error
Content-Type: application/json
Test
https://api.test.crewmojo.com/v1/integrations/download/*
Production
https://api.crewmojo.com/v1/integrations/download/*
rrrrrrr is the report identifier. Please speak to us about reports that you can access for your solution. jjjjjjj is the jobId