post https://yourapihubdomain.io/v1/campaigns
This API is used to create a campaign. You can create deployments within a campaign.
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 of the campaign. |
referenceid | String | No | Specifies a reference id for the campaign. |
imageName | String | No | Specifies the name for the campaign logo image. The size should not be more than 100x100 px size. |
imageContent | String | No (Mandatory only when imageName is provided in the request) | Specifies the image content in base64 format. |
categoryId | String | Yes | Specifies the category id for the campaign. |
priority | Integer | No | Specifies the priority for the campaign. The options are 0 - low 1 - medium * 2 - high |
notifications | Object | Yes | Specifies the notifications to be received for the configured email ids. The parameters are: emailId: Specifies the email id of the notification recipient about the deployment status. description: Specifies the description for the email id that is entered for the notification recipient. status: Specifies the notification recipient is set to active or inactive to receive notifications. The options are: 1- active 0 - inactive excepitonAlert: Specifies if the exception alerts are enabled for the notification recipient. The options are: 1- enabled 0 - not enabled defaultUser: Specifies if the notification recipient is default notification recipient. The options are 1- default recipient * 0 - additional recipient |
alertsettings | Object | Yes | Specifies the alert settings. The parameters are: alertType: Specifies the alert notification. The options are: N0002 |
businessStakeHolder | String | No | Specifies the business stakeholder. |
Request Example
{
"refernceid": "20222023",
"name": "Sample_campaign",
"imageName":"logoimage.png",
"imageContent": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABjCAIAAADihTK7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAABVNSURBVHhe3Z15WBRXusY1LqCiqMgqCCiIoOCezDUxmehoxhgT7yTmJtGbZZLJowYaARW3uMYkxHHDxGiMk0lGjSHGBLpZBARFMaKAIIuo7HZ3nd53+DP3qz6ni6agu6tXfO77vPLQXdXL+fGd73yn6lQ5qHugpe/qulDROnVb/if8OrlaR559nPSHSQMMS6s3",
"categoryId": "Others",
"priority": 0,
"notifications": [
{
"emailId": "[email protected]"
}
],
"alertsettings": [
{
"alertType": "N0002"
}
],
"businessStakeHolder": "marketing"
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
id | Returns the id of the campaign |
name | Returns the name of the campaign |
message | Returns the confirmation message |
Response Example
{
"id":"16710994420000",
"name":"Sample_Campaign",
"message":"Campaign 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 | Campaign category is required |
400 | 400 | Image Content is required. |
400 | 400 | Maximum Permissible Priority is High. User cannot create campaigns above than this priority. |
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 | Failed to add the campaign as the campaign with the given campaign name already exists. |
500 | 500 | Internal server error |
500 | 1001 | Invalid input JSON |