/
Working with scheduled reports using the API

Working with scheduled reports using the API

Overview

Check the list of available endpoints and methods to work with scheduled reports in the Activeboards API:

Endpoints and methods

Description

Endpoints and methods

Description

GET /schedules see below

Get information about all the scheduled reports in a domain.

GET /schedules/{id} see below

Get information about a specific scheduled report.

POST /schedules see below

Create a new scheduled report.

PUT /schedules/{id} see below

Update a scheduled report.

DELETe /schedules/{id} see below

Delete a scheduled report.

Endpoints and methods

GET /schedules

Get information about all the scheduled reports in a domain.

To perform this request, your Devo user must have at least the Activeboards (view) permission assigned. Learn more about roles and permissions in Role permissions.

Example

Find below a request example in cURL language. This request will return details about all the scheduled reports created in the domain that corresponds to the given token. Learn how to authorize your request in this article.

curl -H "standAloneToken:YOUR_TOKEN" -X GET "https://api-us.devo.com/activeboards/v2/schedules"

Code

Description

Code

Description

200

Successful response. Scheduled reports in the domain retrieved.

[ { "id": 3, "userDomainId": 2400, "startAt": 1667433600000, "timezone": "Europe/Madrid", "recurrence": { "cronExpression": "0 45 15 * * *", "scheduleExpression": { "time": { "hour": 15, "minute": 45 }, "frequency": "Daily" } }, "isEnable": true, "customData": { "dateTo": "now()", "dateFrom": "now() - 1m", "email": [ "user1@devo.com" ], "events": { "Select0": { "value": { "_internal": { "label": "domaintest", "value": "domaintest" }, "type": "str", "value": "domaintest" } }, "Input0": { "value": { "_internal": "1m", "type": "str", "value": "1m" } } } }, "nextExecution": 1667918700000, "updateDate": 1667832300000, "creationDate": 1667472275000, "resources": [ 189704 ], "resourcesData": [ { "id": 189704, "userDomain": 2400, "editable": false, "resourceType": "ACTIVEBOARD", "categories": null, "name": "Test", "description": "", "updateDate": 1667472555000, "creationDate": 1667472217000, "private": true } ] }, { "id": 5, "userDomainId": 22, "startAt": 1667433600000, "timezone": "Europe/Madrid", "recurrence": { "cronExpression": "0 0 16 * * 4,2", "scheduleExpression": { "days": [ "Thursday", "Tuesday" ], "time": { "hour": 16, "minute": 0 }, "frequency": "Weekly" } }, "isEnable": false, "customData": { "dateTo": "now()", "dateFrom": "now() - 30m", "email": [ "user2@devo.com" ], "events": { "Select0": { "value": { "_internal": { "label": 75, "value": 75 }, "type": "int", "value": 75 } } } }, "nextExecution": 1667919600000, "updateDate": 1667548897000, "creationDate": 1667486620000, "resources": [ 189716 ], "resourcesData": [ { "id": 189716, "userDomain": 22, "editable": false, "resourceType": "ACTIVEBOARD", "categories": null, "name": "User Activity v2", "description": null, "updateDate": 1667548899000, "creationDate": 1667484060000, "private": true } ] }, { "id": 7, "userDomainId": 21, "startAt": 1667865600000, "timezone": "Europe/Paris", "recurrence": { "cronExpression": "0 29 11 * * *", "scheduleExpression": { "time": { "hour": 11, "minute": 29 }, "frequency": "Daily" } }, "isEnable": true, "customData": { "dateTo": "now()", "dateFrom": "now() - 30m", "email": [ "user3@devo.com" ], "events": {} }, "nextExecution": 1667989740000, "updateDate": 1667903370000, "creationDate": 1667903370000, "resources": [ 189728 ], "resourcesData": [ { "id": 189728, "userDomain": 22, "editable": false, "resourceType": "ACTIVEBOARD", "categories": null, "name": "User Activity v2 cloned", "description": null, "updateDate": 1667903251000, "creationDate": 1667903251000, "private": true } ] } ]

401

Unauthorized request.

403

Forbidden request.

405

Method not allowed.

500

Server error and Java exception.

GET /schedules/{id}

Get information about a specific scheduled report.

To perform this request, your Devo user must have at least the Activeboards (view) permission assigned. Learn more about roles and permissions in Role permissions.

Path parameters

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

id required

integer

Enter the ID of the scheduled report you want to get information about.

How can I get the ID of a scheduled report?

Scheduled report IDs are not displayed in the Devo platform, so you should get them using the GET /v2/schedules request explained above.

Example

Find below a request example in cURL language. This request will return details about the scheduled report with ID 12 created in the domain that corresponds to the given token. Learn how to authorize your request in this article.

curl -H "standAloneToken:YOUR_TOKEN" -X GET "https://api-us.devo.com/activeboards/v2/schedules/12"

Code

Description

Code

Description

200

Successful response. The response includes information about the requested scheduled report.

401

Unauthorized error.

403

Forbidden request.

404

Not found.

405

Method not allowed.

500

Server error and Java exception.

POST /schedules

Create a new scheduled report.

Request body

The request JSON body must include an object with the following key-value pairs.

Parameter

Type

Description

Parameter

Type

Description

startAt required

string

Select the date you want the report to start being generated and sent.

This must be an epoch milliseconds timestamp, for example: 1667433600000

timezone required

string

The timezone you want to apply to the data displayed in the report, which will display the date and time adjusted accordingly.

This must be a proper timezone database name, for example: Europe/Dublin

recurrence required

object

Select the desired periodicity for the reports.

  • cronExpression - (string) Set the desired periodicity as a cron expression. A cron expression is a string consisting of six or seven fields that describe individual details of the schedule. Learn more about cron expression in this article.

  • scheduleExpression - (object) set the desired periodicity using the following parameters:

    • frequency - Select the desired periodicity for the report. Allowed values are Daily, Weekly and Monthly.

    • days - If you chose Weekly as the frequency, enter the specific day(s) you want the report to be sent every week (Monday, Tuesday...)

    • time - Include this array with the following info:

      • day - Specify the day(s) of the month (2, 31...) you want the report to be sent. This only applies if you chose Monthly as the frequency.

      • hour - Specify the hour to send the report (8, 21...)

      • minute - Specify the minute of the hour to send the report (30, 45...)

isEnable required

boolean

Set this parameter as true and the report will start being generated and sent as specified, otherwise, it will remain inactive until you edit it and enable it.

customData

object

  • dateFrom - Start date of the time range you want to analyze in the report.

  • dateTo - End date of the time range you want to analyze in the report.

  • email - Enter the email address(es) you want to send the report to.

resources required

object

Enter the ID(s) of the related Activeboards.

Example

Find below a request example in cURL language. This request will create a new scheduled report related to the Activeboard with ID 1234, created in the domain that corresponds to the given token. Learn how to authorize your request in this article.

PUT /schedules/{id}

Update a specific schedule report.

DELETE /schedules/{id}

Delete a scheduled report.

 

Related content

Activeboards API
Activeboards API
More like this
Authorizing Activeboards API requests
Authorizing Activeboards API requests
More like this
Working with Activeboards using the API
Working with Activeboards using the API
More like this
Scheduled tasks
Scheduled tasks
More like this
Sophos Central collector
Sophos Central collector
More like this
Sophos Central collector
Sophos Central collector
More like this