REST APIs to work with scheduling tasks

The following REST APIs are available for working with scheduling tasks.

Schedule a task

A POST method that schedules a task using the task ID. At any time, there can be only one task in the schedule queue. Also, you must keep a delay of ~1 second in between two consecutive tasks.

Request URL

http://<FMPS_server>:<port>/v16/queue/scheduleTask/:id

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Parameter
Name Type Description
id String The unique ID of the task that you want to schedule.
Parameter example
5e4302fafdfdfadsfdfasgafsafgsag
Successful response

Returns a HTTP 200 (Successful) response with scheduled event.

Error response
Code Type Description
400 String A bad request is sent.

Get ID of a running task

A GET method that retrieves the running ID of a publishing task.

Request URL

http://<FMPS_server>:<port>/v16/queue/task/running/:id

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Parameter
Name Type Description
id String The unique ID of the task that you want to retrieve the running ID for.
Parameter example
5e4302fafdfdfadsfdfasgafsafgsag
Successful response

Returns a HTTP 200 (Successful) response with the queue object that contains the running ID of the publishing task.

Error response
Code Type Description
400 String A bad request is sent.

Stop a running task

A POST method that stops a running publishing task.

Request URL

http://<FMPS_server>:<port>/v16/queue/stopTask

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Request body
Name Type Description
runid String ID of the running task that you want to stop.
JSON body example
{"runid":"454654456464"}
Successful response

Returns a HTTP 200 (Successful) response with an object to terminate the task.

Error response
Code Type Description
400 String A bad request is sent.

Get running object details for a GUID

A GET method that retrieves the run object’s ID for a task through its GUID.

Request URL

http://<FMPS_server>:<port>/v16/queue/task/lastrunguid/:guid

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Parameter
Name Type Description
guid String GUID of the task that is scheduled for running in the publishing queue.
Parameter example
342342553423425
Successful response

Returns a HTTP 200 (Successful) response with the run object’s ID for a task that has already started executing. If the task has been scheduled, but it has not yet started, then the following message is returned in a JSON:

Guid is present in the task, but not for the running queue. It is probably scheduled. Please wait.
Error response
Code Type Description
400 String A bad request is sent.
404 String Task not found for the given GUID.

Get all objects present in the running task queue

A GET method that retrieves all objects present in the running task queue. This includes completed, queued, terminated, or currently running tasks.

Request URL

http://<FMPS_server>:<port>/v16/queue

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Successful response

Returns a HTTP 200 (Successful) response with the list of queued objects.

Error response
Code Type Description
400 String A bad request is sent.

Get the details of a specific queued object

A GET method that retrieves the status of a particular queued object. The queued object’s ID is used to retrieve all details.

Request URL

http://<FMPS_server>:<port>/v16/queue/:id

Header
Name Type Description
content-type String Type of content that is sent in the request.
X-Access-Token String The authentication token that is sent in the request.
Header example
{
  "content-type": "application/json",
  "X-Access-Token": "eyJ0eXAiOiJKhjshjafakjfkadfas"
}
Parameter
Name Type Description
id String The unique ID of the queued object that you want to retrieve.
Parameter example
5e4302fafdfdfadsfdfasgafsafgsag
Successful response

Returns a HTTP 200 (Successful) response with the queued object.

Error response
Code Type Description
400 String A bad request is sent.

May 30, 2024

Legal Notices | Online Privacy Policy