post https://yourapihubdomain.io/v1/purposes
This API is used to get all the Purposes that are available in the tenant.
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 Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
name | String | Yes | Specifies the name of the purpose. |
group | String | No | Specifies the group of the purpose. If the group is not specified, then the purpose will be created under "Default" group. |
description | String | No | Specifies the description of the purpose. |
Request Example
{
"name": "Marketing_Purpose",
"group": "DEFAULT",
"description": "Marketing purpose"
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
name | Returns the name of the Purpose. |
id | Returns the id of the Purpose. |
message | Returns a confirmation message. |
Response Example
{
"id": "738",
"name": "Marketing_Purpose",
"message": "Purpose added/updated 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 | Please enter the Purpose Name |
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 | This Purpose already exists. Please enter a different Purpose value to save. |
500 | 500 | Internal server error |
500 | 1001 | Invalid input JSON |