Create / Update contact profile API

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.

Run In Postman

Request 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 Parameters

The following table describes the elements in the request body:

ParameterTypeMandatoryDescription
profile-nameStringYesSpecifies the profile name.
keyStringConditionally MandatorySpecifies the profile key. Either “key”, or “filter” is mandatory.
filterStringConditionally MandatorySpecifies the filter definition. Either “key”, or “filter” is mandatory.
filter.attribute-nameStringConditionally MandatorySpecifies the “attribute-id” or “attribute-name”. At least one parameter is mandatory to build a condition.
filter.rel-opStringConditionally MandatorySpecifies the relational operator. The options are:

Equals
GreaterThan
GreaterThanEquals
NotEquals
LessThan
LessThanEquals
filter.logical-opStringConditionally MandatorySpecifies the logical operator. The options are:

and
or
filter.valStringConditionally MandatorySpecifies the value to compare.
upsertStringNoUsed 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.
attributesStringYesSpecifies the attributes to be created or updated with values based on given primary key of the profile or filter.
update-linkStringNoSpecifies 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.
exparamStringNoSpecifies 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:

ParameterDescription
update-countSpecifies the profile update count.
transaction-idSpecifies 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 CodeCode within API ResponseDescription
2001010The request was not processed.
1001Invalid input JSON - One of 'ProfileID' or 'ProfileName' parameter is mandatory. "
3005Invalid Profile ID
7031Profile Id and Profile name do not match.
401430Authorization failed. This resource is not allowed to access using this TOKEN or KEY
498Invalid token or Access token expired
405405Method not supported
429429Too many requests. Throttle limit reached for the time window.
499499Request failed. Check the exact reason of failure in application code and description of error stream.
500500Internal server error
1001Invalid input JSON
Language