post https://yourapihubdomain.io/v1/calendars
This API is used to create a basic or advanced calendar.
Know your endpoint
Based on the domain you use to log in to Webex Campaign, the endpoint domain for your API varies. For more information, refer to the Know Your API Endpoints section.
Headers
The following table describes the request headers:
Request Header | Description |
---|---|
content-type | application/json |
authorization | Access token or API Secret Key in Bearer format Example: Bearer $(key) |
Request Headers
The following table describes the elements in the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
name | String | Yes | Specifies the name for the calendar. |
timezone | Integer | Yes | Specifies the time zone code. Refer to the link for the list of timezone codes their respective country or region details. |
userGroup | String | No | Specifies the name of the user group in which the calendar is being created. |
tenantName | String | No | Specifies the name of the tenant. |
calendarType | Integer | Yes | Specifies the calendar type. The options are: 0 - Basic Calendar 1 - Advanced Calendar |
schedules | Object | Yes | Specifies the schedule object. The parameters are: days: Returns the weekdays the calendar is schedule for. The values are: 1- Sunday 2- Monday 3- Tuesday 4- Wednesday 5- Thursday 6- Friday 7-Saturday dates: Specifies the dates of the calendar schedule. batchSize: Specifies the batch size either absolute or a percentage value of the configured TG. batchMode: Specifies the batch mode. the values are: # - number % - percentage batchInterval: Specifies the batch interval in minutes. fromTime: Specifies the start time 24 hour format (hh:mm:ss). toTime: Specifies the end time 24 hour format (hh:mm:ss). |
startDate | String | Yes | Specifies the start date. It should be greater that current date. |
endDate | String | Yes | Specifies the end date. |
Request Example
{ "name": "Sample_Calendar",
"timezone": 108,
"userGroup": "marketing",
"tenantName": "surya",
"calendarType": 0,
"schedules": [
{
"days": [
"5"
],
"dates": "4",
"batchSize": 0,
"batchMode": "A",
"batchInterval": 0,
"fromTime": "16:15:00",
"toTime": "23:45:00",
"weekOfTheMonth": "0"
}
],
"startDate": "2022-12-24",
"endDate": "2023-06-04"
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
id | Returns the id of the calendar. |
name | Returns the name of the calendar. |
message | Returns the confirmation message. |
Response Example
{
"id":"16710994420000",
"name":"Sample_Calendar",
"message":"Calendar created successfully."
}
Failure Response Codes
The API will return code within the response as per the following table in case of failure scenarios.
HTTP Status Code | Code within API Response | Description |
---|---|---|
400 | 400 | I/O error on post request. Cannot retry due to server authentication, in streaming mode. |
400 | 400 | End date should be greater than current date |
401 | 430 | Authorization failed. This resource is not allowed to access using this TOKEN or KEY |
401 | 498 | Invalid token or Access token expired |
404 | 404 | Not found |
405 | 405 | Method not supported |
409 | 409 | Calendar name already exists in the system |
500 | 500 | Internal server error |
500 | 1001 | Invalid input JSON |