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 agentTo 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 | 
            
  | 
            Type.
                
  | 
        |
days | 
            array | 
                If "type" = "days_of_week":
                
 "type" = "days_of_month":
                
 "type" = "cycle":
                
 "type" = "business_calendar":
                
  | 
            Days of week or days of month
             
            Example of a cycle calendar: 
            Example of a 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"