Table of Contents

Schedule reports for a Vizpad

Ramya Priya Updated by Ramya Priya

The following APIs can be used to schedule a Vizpad report at regular intervals. The first API returns the task ID, using which a schedule can be set up for generating reports for the required Vizpad.

Create a task ID

Request

URL
https://<TelliusUrl>/api/report/schedule
CURL
curl -X 'POST'
-v -H "Content-Type: application/json" \
-H "Authorization:<AUTHENTICATION_TOKEN_FROM_LOGIN_API>"\
https://<TelliusUrl>/api/report/schedule \
--data '{"options":{"objectType":"vizpad", "objectId":"<vizpad-id>"}}'
Method
POST
Headers

By default, only superUsers can access this view.

Authorization: Bearer <AUTHENTICATION_TOKEN_FROM_LOGIN_API>
Content-Type: application/json, text/plain
Body

Replace the vizpad-id with the ID of the Vizpad for which report needs to be generated.

{
"options": {
"objectType": "vizpad",
"objectId": "<vizpad-id>"
}
}

Response

Success
Status Code: 200 OK
Body

The response body will contain the task ID for scheduling reports.

{
"taskid":"ee661a34-604e75086bbb"
}

Schedule the report

The task-id obtained from the previous API can be used to set the schedule for the report.

Request

URL
https://<TelliusUrl>/api/schedule
CURL
curl -X 'POST' -v -H "Content-Type: application/json" \
-H "Authorization:<AUTHENTICATION_TOKEN_FROM_LOGIN_API>" \
https://<tellius>/api/schedule
--data '{"id":"357be8c3-65e3-4906-935f-ca1d5e9419bf", \
"name":"SampleName", \
"startdate":"12/19/2019", \
"starttime":"11,02,am,GMT+05:30 (India Standard Time)", \
"frequency":"1", \
"frequencyunit":"d", \
"report":{"communication":{"email":{"to":["a@b.com"]}},"type":"pdf","title":"sample","body":"sample"} \
}'
Method
POST
Headers

By default, only superUsers can access this view.

Authorization: Bearer <AUTHENTICATION_TOKEN_FROM_LOGIN_API>
Content-Type: application/json, text/plain
Body

The request body contains the details for scheduling a task with report generation, including the id of the task, name of the schedule, startdate, starttime, frequency and frequencyunit for the schedule and the details for the report generation including the type, title, body and to email address.

{
"id": "357be8c3-65e3-4906-935f-ca1d5e9419bf",
"name": "SampleName",
"startdate": "12/19/2019",
"starttime": "11,02,am,GMT+05:30 (India Standard Time)",
"frequency": "1",
"frequencyunit": "d",
"report": {
"communication": {
"email": {
"to": ["a@b.com"]
}
},
"type": "pdf",
"title": "sample",
"body": "sample"
}
}

Response

Success
Status Code: 200 OK
Body

The response body returns the ID of the schedule created.

{
"scheduleId": "46777a8a9-2af9adea2287"
}

Did we help you?

Schedule refresh for a Vizpad

Contact