Skip to content

Create schedules

Creating activity schedules

Method create.schedules
Description Creating activity schedules
Who has access Partner, Customer

Parameters of a request

Title Type Required Valid values 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"
name string yes Activity schedule name
Work schedule
schedules array yes Work schedules
activity_days object yes Days when a schedule is active
type enum yes
  • 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 yes 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

Parameters of a reply

Title Type Required Description
id number yes Unique ID of an activity schedule

JSON request structure

{
  "jsonrpc":"2.0",
  "id":"number",
  "method":"create.schedules",
  "params":{
    "access_token":"string",
    "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"
      }
    ]
  }
}

JSON reply structure

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

List of returning error

Refer to "List of errors for the methods with the verb create"