Registration

Module Taskqueue

Getting information about the tasks in an asynchronous queue.

API methods

Getting of the background task progress
https://api.mobizon.gmbh/service/Taskqueue/GetStatus

Getting of the background task progress

https://api.mobizon.gmbh/service/Taskqueue/GetStatus

Request parameters

ParameterTypeDescription
idintegerBackground task ID

Server response

Data array

FieldTypeDescription
progressintegerThe progress of the task on a scale of 0 to 100%
statusintegerTask status code:
0 - forward to launching,
1 - in progress,
2 - completed,
3 - declined

Errors codes

CodeDescription
2If the task with specified ID was not found.

Examples

curl -X POST \
  'https://api.mobizon.gmbh/service/taskqueue/getStatus?output=json&api=v1&apiKey=KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'id=123'
var data = "id=123";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});

xhr.open("POST", "https://api.mobizon.gmbh/service/taskqueue/getStatus?output=json&api=v1&apiKey=KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);
<?php
use Mobizon\MobizonApi;

$api = new MobizonApi('KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK', 'api.mobizon.gmbh');

// API method call
if ($api->call(
    'taskqueue',
    'getStatus',
    array(
        //background task ID
        'id' => '123'
    )
)
) {
    // Getting the result of an API request
    $result = $api->getData();
} else {
    // An error occurred during execution. Error code and message text output
    echo '[' . $api->getCode() . '] ' . $api->getMessage() . PHP_EOL;
}