Skip to content

Latest commit

 

History

History
413 lines (400 loc) · 8.75 KB

schedules.md

File metadata and controls

413 lines (400 loc) · 8.75 KB

Schedules

Get Schedules List

dayschedule.schedules.list()

Response:

 [{
        "schedule_id": 397,
        "user_id": 758,
        "org_id": 287,
        "name": "Schedule ",
        "time_zone": "Europe/London",
        "availability": [
            {
                "day": "SUN",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "MON",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "TUE",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "WED",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "THU",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "FRI",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "SAT",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            }
        ],
        "is_default": 0,
        "created_at": "2022-12-26T08:30:21.000Z",
        "updated_at": "2023-10-05T09:24:11.000Z"
    }]

Get Schedule

dayschedule.schedules.get(schedule_id)

Response:

 [{
        "schedule_id": 397,
        "user_id": 758,
        "org_id": 287,
        "name": "Schedule ",
        "time_zone": "Europe/London",
        "availability": [
            {
                "day": "SUN",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "MON",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "TUE",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "WED",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "THU",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "FRI",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            },
            {
                "day": "SAT",
                "times": [
                    {
                        "end": "18:00",
                        "start": "09:00"
                    }
                ],
                "is_available": true
            }
        ],
        "is_default": 0,
        "created_at": "2022-12-26T08:30:21.000Z",
        "updated_at": "2023-10-05T09:24:11.000Z"
    }]

Create Schedule

dayschedule.schedules.create({
  "user_id": 758,
  "name": "My schedule",
  "availability": [
    {
      "is_available": false,
      "day": "SUN",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "is_available": true,
      "day": "MON",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "is_available": true,
      "day": "TUE",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "is_available": true,
      "day": "WED",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "is_available": true,
      "day": "THU",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "is_available": true,
      "day": "FRI",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "is_available": false,
      "day": "SAT",
      "times": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    }
  ],
  "time_zone": "Asia/Calcutta"
})

Parameters:

For complete reference click here

Name Type Description
name* string Name of the schedule.
timezone* string timezone for schedule.
availability* array specify timings.

Response:

{
    "schedule_id":572,"message":"Schedule created successfully"
}

Update Schedule

dayschedule.schedules.update(schedule_id, {
  "schedule_id": 537,
  "user_id": 758,
  "org_id": 287,
  "name": "Shubh Jain's Schedule",
  "time_zone": "Asia/Kolkata",
  "availability": [
    {
      "day": "SUN",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": false
    },
    {
      "day": "MON",
      "times": [
        {
          "end": "18:00",
          "start": "10:00"
        }
      ],
      "is_available": true
    },
    {
      "day": "TUE",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": true
    },
    {
      "day": "WED",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": true
    },
    {
      "day": "THU",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": true
    },
    {
      "day": "FRI",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": true
    },
    {
      "day": "SAT",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": false
    },
    {
      "day": "2023-05-17",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": false
    },
    {
      "day": "2023-05-16",
      "times": [
        {
          "end": "18:00",
          "start": "09:00"
        }
      ],
      "is_available": false
    }
  ],
  "is_default": 1,
  "created_at": "2023-02-15T10:53:13.000Z",
  "updated_at": "2023-10-03T07:18:23.000Z"
})

Parameters:

For complete reference click here

Name Type Description
name* string Name of the schedule.
timezone* string timezone for schedule.
availability* array specify timings.

Response:

{
    "message":"Schedule with id: 537 updated successfully"
}

Delete Schedule

dayschedule.schedules.delete(schedule_id)

Response:

{
  "message": "Schedule with id: 558 deleted successfully"
}