Create Calendar API

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 HeaderDescription
content-typeapplication/json
authorizationAccess token or API Secret Key in Bearer format

Example: Bearer $(key)

Request Headers

The following table describes the elements in the request body:

ParameterTypeMandatoryDescription
nameStringYesSpecifies the name for the calendar.
timezoneIntegerYesSpecifies the time zone code. Refer to the link for the list of timezone codes their respective country or region details.
userGroupStringNoSpecifies the name of the user group in which the calendar is being created.
tenantNameStringNoSpecifies the name of the tenant.
calendarTypeIntegerYesSpecifies the calendar type. The options are:
0 - Basic Calendar
1 - Advanced Calendar
schedulesObjectYesSpecifies 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).
startDateStringYesSpecifies the start date. It should be greater that current date.
endDateStringYesSpecifies 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:

ParameterDescription
idReturns the id of the calendar.
nameReturns the name of the calendar.
messageReturns 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 CodeCode within API ResponseDescription
400400I/O error on post request. Cannot retry due to server authentication, in streaming mode.
400400End date should be greater than current date
401430Authorization failed. This resource is not allowed to access using this TOKEN or KEY
401498Invalid token or Access token expired
404404Not found
405405Method not supported
409409Calendar name already exists in the system
500500Internal server error
5001001Invalid input JSON
Language