This API is used to create or update a contact profile that matches the given criteria.
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.
Go to the Postman Collection section to learn how to import a Postman collection. Click the below button, If you already know how to import a postman collection.
Request 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
The following table describes the elements in the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
profile-name | String | Yes | Specifies the profile name. |
key | String | Conditionally Mandatory | Specifies the profile key. Either “key”, or “filter” is mandatory. |
filter | String | Conditionally Mandatory | Specifies the filter definition. Either “key”, or “filter” is mandatory. |
filter.attribute-name | String | Conditionally Mandatory | Specifies the “attribute-id” or “attribute-name”. At least one parameter is mandatory to build a condition. |
filter.rel-op | String | Conditionally Mandatory | Specifies the relational operator. The options are: Equals GreaterThan GreaterThanEquals NotEquals LessThan LessThanEquals |
filter.logical-op | String | Conditionally Mandatory | Specifies the logical operator. The options are: and or |
filter.val | String | Conditionally Mandatory | Specifies the value to compare. |
upsert | String | No | Used to create or update profile. The options are: 0 - Creates a Profile if it does not exist. 1 - (Default) Creates a Profile if it does not exist. Updates Profile, if exists. * 2 - Update Profile if exists. |
attributes | String | Yes | Specifies the attributes to be created or updated with values based on given primary key of the profile or filter. |
update-link | String | No | Specifies the update link. The options are: 1 - Ignores the link profile and return success after updating the profile. 2 - (Default) Creates an empty linked profile and then updates the main profile. * 3 - Fail the complete profile update if link does not exists. |
exparam | String | No | Specifies the extra parameters that can be passed for audit logging purpose. You can pass up to 10 extra parameters. |
Request Example
{
"profile-name": "profile_test",
"upsert": "1",
"attributes": [{
"attribute-name": "firstname",
"val": "Matt"
}, {
"attribute-name": "lastname",
"val": "Adam"
}
],
"filter": [{
"attribute-name": "",
"rel-op": "equals",
"val": "1",
"logical-op": "and"
}, {
"attribute-name": "atbname1",
"rel-op": "equals",
"val": "1",
"logical-op": "and"
}
]
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
update-count | Specifies the profile update count. |
transaction-id | Specifies the unique transaction ID. |
Under certain conditions, this API may return "200 OK" and "update-count" response parameter value as '0'. This may indicate that your request body param values could be incorrect, if you were expecting one or more profile records to be created or updated.
Therefore, we recommend that within your application that invokes this API, you should interrogate not just the 'Response Code', but also the value of the 'update-count' response parameter. Then you can write some logic within your application to throw an error if the 'update-count' unexpectedly returns a '0' value. This will help you diagnose any errors within your request body parameters.
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 |
---|---|---|
200 | 1010 | The request was not processed. |
1001 | Invalid input JSON - One of 'ProfileID' or 'ProfileName' parameter is mandatory. " | |
3005 | Invalid Profile ID | |
7031 | Profile Id and Profile name do not match. | |
401 | 430 | Authorization failed. This resource is not allowed to access using this TOKEN or KEY |
498 | Invalid token or Access token expired | |
405 | 405 | Method not supported |
429 | 429 | Too many requests. Throttle limit reached for the time window. |
499 | 499 | Request failed. Check the exact reason of failure in application code and description of error stream. |
500 | 500 | Internal server error |
1001 | Invalid input JSON |