Scheduler call samples
Use the Varicent Incentives API to perform actions related to the Scheduler module, such as running Scheduler tasks.
Retrieve a list of Scheduler tasks
Use this call to retrieve the list of Scheduler tasks and subtasks in Varicent Incentives.
Request
GET /api/v1/scheduleitem
Sample call
curl -X GET -H "Authorization: Bearer API_KEY" -H "Model: YOUR_CLIENT_MODEL” -H "Content-Type: application/json" https:// YOUR_ICM10_API_SERVER_ADDRESS/api/v1/scheduleitem
Sample response
[ { "id": 1, "name": "Nightly Tasks", "scheduleItemType": "Folder", "order": 0, "lastRun": "2012-09-06T05:01:10.177Z", "lastRunStatus": "Success", "activation": "Enabled", "nextRun": "0001-01-01T00:00:00", "childScheduleItems": [ { "id": 2, "name": "Optimize Model", "scheduleItemType": "Optimize", "order": 0, "lastRun": "2012-09-06T05:00:57.127Z", "lastRunStatus": "Success", "activation": "Enabled", "nextRun": "0001-01-01T00:00:00", "parent": 1, "settings": { "schedulerSettingsId": 0, "scheduleItemId": 2, "emailOnFailure": false, "emailOnSuccess": false, "stopOnFailure": false, "stopToolOnTimeout": false, "isGlobal": false, "overrideChildSettings": false, "successEmails": [], "failEmails": [], "externalToolTimeout": 0, "enableRetries": false, "version": { "rowVersion": 1801131 } }, "version": { "rowVersion": 1785024 } },
Run Scheduler task
Use this call to run a Scheduler task or subtask in Varicent Incentives.
Request
POST api/v1/rpc/scheduleitem/{Scheduler item ID}/run
Sample call
curl -X POST -H "Authorization: Bearer API_KEY" -H "Model: YOUR_CLIENT_MODEL” -H "Content-Type: application/json" https:// YOUR_ICM10_API_SERVER_ADDRESS/api/v1/rpc/scheduleitem/{Scheduler item ID}/run
Sample response
{ "completedactivities": "api/v1/completedactivities/23845", "liveactivities": "api/v1/liveactivities/23845" }