Service tasks (svctasks)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/service/svctasks

Creating a new service task

GET

/rest/v1/service/svctasks

Getting the list of service tasks

GET

/rest/v1/service/svctasks/<id>

Receiving service task data

PATCH

/rest/v1/service/svctasks/<id>

Changing service task data

DELETE

/rest/v1/service/svctasks/<id>

Deleting a service task

LOOKUP

/rest/v1/service/svctasks

Searching for the service scenario identifier


Creating a new service task

Request

Field Description: svctask entity

Request example
POST /rest/v1/service/svctasks HTTP/1.1
Content-Type: application/json; charset=utf-8

svctask entity

Response

Field Description: svctask entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "380daae6-016c-cdd4-606e-50e54938780c",
  "name": "Debtor calls",
  "isenabled": 0,
  "svcscriptcode": "dialByCallList",
  "sitemode": "all",
  "sites": "",
  "isregular": 1,
  "overlap": 1,
  "intervalsec": 3600,
  "dtstart": "2019-02-20T08:00:00Z",
  "dtstop": "2020-02-20T08:00:00Z",
  "schedule": "work",
  "periods": [],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T12:09:03.34Z",
    "lwt": "2019-08-26T12:09:03.34Z"
  }
}

Getting the list of service tasks

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, name, isenabled, svcscriptcode, sitemode, isregular, overlap, intervalsec, dtstart, dtstop, schedule, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/service/svctasks?offset=0&limit=2 HTTP/1.1

Response

Field Description: svctask entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "380daae6-016c-cdd4-606e-50e54938780c",
    "name": "Debtor calls",
    "isenabled": 0,
    "svcscriptcode": "dialByCallList",
    "sitemode": "all",
    "isregular": 1,
    "overlap": 1,
    "intervalsec": 3600,
    "dtstart": "2019-02-20T08:00:00Z",
    "dtstop": "2020-02-20T08:00:00Z",
    "schedule": "work",
    "ext": {
      "ct": "2019-08-26T12:09:03.34Z",
      "lwt": "2019-08-26T12:09:03.34Z"
    }
  },
  {
    "id": "86228b15-016c-cdef-ccce-50e54938780c",
    "name": "Daily cleaning",
    "isenabled": 1,
    "svcscriptcode": "cleardata",
    "sitemode": "all",
    "isregular": 1,
    "overlap": 1,
    "intervalsec": 86400,
    "dtstart": "2019-02-20T08:00:00Z",
    "dtstop": "2020-02-20T08:00:00Z",
    "schedule": "work",
    "ext": {
      "ct": "2019-08-26T12:39:00.55Z",
      "lwt": "2019-08-26T12:39:00.55Z"
    }
  }
]

Receiving service task data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/service/svctasks/380daae6-016c-cdd4-606e-50e54938780c HTTP/1.1

Response

Field Description: svctask entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "380daae6-016c-cdd4-606e-50e54938780c",
  "name": "Debtor calls",
  "isenabled": 0,
  "svcscriptcode": "dialByCallList",
  "sitemode": "all",
  "sites": "",
  "isregular": 1,
  "overlap": 1,
  "intervalsec": 3600,
  "dtstart": "2019-02-20T08:00:00Z",
  "dtstop": "2020-02-20T08:00:00Z",
  "schedule": "work",
  "periods": [],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T12:09:03.34Z",
    "lwt": "2019-08-26T12:09:03.34Z"
  }
}

Changing service task data

Fields prohibited for modification: id

Request

Field Description: svctask entity

Request example
PATCH /rest/v1/service/svctasks/380daae6-016c-cdd4-606e-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

svctask entity

Response

Field Description: svctask entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "380daae6-016c-cdd4-606e-50e54938780c",
  "name": "Debtor calls",
  "isenabled": 1,
  "svcscriptcode": "dialByCallList",
  "sitemode": "firstsite",
  "sites": "SITE1, SITE2",
  "isregular": 1,
  "overlap": 1,
  "intervalsec": 3600,
  "dtstart": "2019-02-20T08:00:00Z",
  "dtstop": "2020-02-20T08:00:00Z",
  "schedule": "all",
  "periods": [],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T12:09:03.34Z",
    "lwt": "2019-09-10T12:38:40.11Z"
  }
}

Deleting a service task

Request

Request example
DELETE /rest/v1/service/svctasks/380daae6-016c-cdd4-606e-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for the service scenario identifier

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id

Request

Request example
LOOKUP /rest/v1/service/svctasks HTTP/1.1
Content-Type: application/json; charset=utf-8

"380daae6-016c-cdd4-606e-50e54938780c"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "380daae6-016c-cdd4-606e-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}