Skip to content

Get schedules

Getting a list of activity schedules

Method get.schedules
Description Getting a list of activity schedules
Who has access Partner, Customer

Parameter of a request

Title Type Required Description
access_token string yes Authentication session key
user_id number no Unique ID of an agent's customer user who makes request
Is required for agent
To access a list of customer users, use the method "get.customer_users"
limit number no Returning entries count. Refer to "Paging"
offset number no Offset that defines from which number to return the entries "limit". Default value is "0". Refer to "Paging"
filter object no Refer to "Filters"
fields array no Refer to "Viewing returning data"
sort array no Refer to "Data sorting"

Parameters of a reply

Title Type Valid values Filtering Sorting Description
id number yes Activity schedule unique ID
name string yes yes Activity schedule name
Work schedules
schedules array yes Work schedules
activity_days object Days when a schedule is active
type enum
  • days_of_week
  • days_of_month
  • business_calendar
  • cycle
Type.
  • days_of_week - Weekly schedule
  • days_of_month - Monthly schedule
  • business_calendar - Business calendar
  • cycle - Cycle calendar
days array If "type" = "days_of_week":
  • 1 - Monday;
  • 2 - Tuesday;
  • 3 - Wednesday;
  • 4 - Thursday;
  • 5 - Friday;
  • 6 - Saturday
  • 0 - Sunday;
  • 8 - day off;
  • 7 - working day;
If "type" = "days_of_month":
  • numbers from 1 to 31
If "type" = "cycle":
  • Number of working days per cycle;
  • Number of days off per cycle;
If "type" = "business_calendar":
  • 8 - day off;
  • 7 - working day;
Days of week or days of month

Example of a cycle calendar:
[2,2] - there is two working days in a cycle, and two days off. In sum we have a "two after two" schedule.

Example of a business calendar:
[7] - Calendar is active on working days according to the business calendar;
[8] - Calendar is active on days off according to the business calendar

Activity time of a schedule
activity_time array Activity time of a schedule
If the parameter is not specified, a schedule works with no limit
time_from string HH:MM Time when schedule activity started
time_till string HH:MM Time when schedule activity ended

It must be more than mentioned in the parameter "time_from"
Activity period of a schedule
activity_date_from string YYYY-MM-DD Date when schedule activity started
activity_date_till string YYYY-MM-DD Date when schedule activity ended

JSON request structure

{
  "jsonrpc":"2.0",
  "id":"number",
  "method":"get.schedules",
  "params":{
    "access_token":"string",
    "user_id":"number",
    "offset":"number",
    "limit":"number",
    "filter":{

    },
    "sort":[
      {
        "field":"string",
        "order":"string"
      }
    ],
    "fields":[
      "string"
    ]
  }
}

JSON reply structure

{
  "jsonrpc":"2.0",
  "id":"number",
  "result":{
    "metadata":{

    },
    "data":[
      {
        "id":"number",
        "name":"string",
        "schedules":[
          {
            "activity_days":{
              "type":"enum",
              "days":[

              ]
            },
            "activity_time":[
              {
                "time_from":"string",
                "time_till":"string"
              }
            ],
            "activity_date_from":"string",
            "activity_date_till":"string"
          }
        ]
      }
    ]
  }
}

List of returning errors

Refer to the section "List of errors for the methods with the verb get"