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>

Getting service task data

PATCH

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

Modifying service task data

DELETE

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

Deleting a service task

LOOKUP

/rest/v1/service/svctasks

Searching for a service script identifier


Creating a new service task

Request

Field description: svctask entity

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

svctask entity

Response

Field description: svctask entity

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

{
  "id": "380daae6-016c-cdd4-606e-50e54938780c",
"name": "Calling debtors",
  "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 output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/service/svctasks?offset=0&limit=2 HTTP/1.1

Response

Field description: svctask entity

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

[
  {
    "id": "380daae6-016c-cdd4-606e-50e54938780c",
"name": "Calling debtors",

    "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": "Cleaning daily",
    "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"
    }
  }
]

Getting service task data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: svctask entity

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

{
  "id": "380daae6-016c-cdd4-606e-50e54938780c",
"name": "Calling debtors",
  "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"
  }
}

Modifying service task data

Fields prohibited for modification: id

Request

Field description: svctask entity

Example request
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

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

{
  "id": "380daae6-016c-cdd4-606e-50e54938780c",
"name": "Calling debtors",
  "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

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

Response

Example response
HTTP/1.1 204 No Content

Searching for a service script identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id

Request

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

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

Response

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

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

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