post https://yourdomain.webexcampaign.io/campaignapi/resources/v3/profile/get
This API is used to retrieve a contacts profile or the linked profiles 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) |
Body Parameters
The following table describes the elements in the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
profile-id | String | Yes | Specifies the profile ID. |
profile-name | String | No | Specifies the profile name. |
key | String | Conditionally Mandatory | Specifies the profile key. Either βkeyβ, βfilterβ, or βfileβ is mandatory. |
file | String | Conditionally Mandatory | Specifies the list of keys that can be provided in the file for batch execution. Record terminator shall be new line (\r\n). Either βfileβ, βkeyβ, or βfilterβis mandatory. |
sync | String | No | Specifies the processing type. The options are: 1 - Synchronous processing 2 - Asynchronous processing The default option is 1. |
include-headers | String | No | This is used when execution mode is set as βfileβ and βasyncβ. 1 - Includes headers in the response file. 2 - Does not include headers in the response file. The default option is 1. |
filter | String | Conditionally Mandatory | Specifies the filter definition. Either βkeyβ, βfilterβ, or βfileβ is mandatory. |
filter.attribute-id | String | Conditionally Mandatory | Specifies the βattribute-idβ or βattribute-nameβ. At least one parameter is mandatory to build a condition. |
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. |
linkfilter | String | No | Specifies the filter on linked profile. |
linkfilter.profile-id | String | No | Specifies the linked profile ID to query. |
linkfilter.profile-name | String | No | Specifies the linked profile name to Query. |
linkfilter.conditions | String | No | Specifies the conditions on linked profile. |
selectfields | String | No | Specifies the fields to return. By default, all fields from the queried profile will be selected. |
selectfields.attribute-id | String | No | Specifies the AttributeID _to select. Either _AttributeID _or _AttributeName should be provided. |
selectfields.attribute-name | String | No | Specifies the _AttributeName _to select. Either _AttributeID _or _AttributeName _should be provided. |
showlinks | String | No | Specifies the linked profile attributes. The options are: 2 - Shows all attributes of linked profile. 1 - Shows only linked attributes. * 0 - Will not show any attributes from the linked profile. The default option is 0. |
selectlinkfields.profile-id | String | No | Specifies the linked profile ID. |
selectlinkfields.profile-name | String | No | Specifies the linked profile name. |
showlinks.attributes | String | No | Specifies the attributes of linked profile. |
Request Example
// Simple Request
{
"profile-id": "56",
"profile-name": "ProfileName",
"key": "9463183918",
"selectfields": [
{"attribute-id":"1","attribute-name":"atb1"},
{"attribute-id":"2","attribute-name":"atb2"},
{"attribute-id":"3","attribute-name":"atb3"}
]
}
{
"profile-id": "56",
"profile-name": "ProfileName",
"sync":"1",
"include-headers":"1",
"filter": [
{
"attribute-id": "1",
"attribute-name": "attribute1",
"rel-op": "Equals",
"val": "1",
"logical-op": "and"
},
{
"attribute-id": "2",
"attribute-name": "age",
"rel-op": "Equals",
"val": "20",
"logical-op": "and"
}
],
"linkfilter": {
"profile-id":"1",
"profile-name":"APPProfile",
"conditions":[
{
"attribute-id": "1",
"attribute-name": "age",
"rel-op": "equals",
"val": "1",
"logical-op": "and"
},
{
"attribute-name": "age",
"attribute-id": "2",
"rel-op": "equals",
"val": "20",
"logical-op": "and"
}]
},
"selectfields": [
{"attribute-id":"1","attribute-name":"atb1"},
{"attribute-id":"2","attribute-name":"atb2"},
{"attribute-id":"3","attribute-name":"atb3"}
],
"showlinks": "1",
"selectlinkfields": [
{
"profile-id": "1",
"profile-name": "Prof1",
"attributes": [
{"id":"4","name":"atb4"},
{"id":"5","name":"atb5"},
{"id":"6","name":"atb6"}
]
},
{
"profile-id": "1",
"profile-name": "Prof2",
"attributes": [
{"id":"7","name":"atb7"},
{"id":"8","name":"atb8"},
{"id":"9","name":"atb9"}
]
}
]
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
attributes | Returns the profile attributes. |
attributes.name | Returns the attribute name. |
attributes.id | Returns the attribute ID. |
attributes.value | Returns the attribute value (String value or another JSON). |
links | Returns the link attributes if any. |
links.profile-id | Returns the link profile ID. |
links.profile-name | Returns the link profile name. |
links.attributes | Returns the link attributes. |
request-id | Returns the request-id when the sync is set as asynchronous. |
file | Returns the file path when the file is set and sync is set as 1. Success File Format: Record separator: New line character (\r\n) Field Separator: Headers: SourceName.AttributeName1, SourceName.AttributeName2, SourceName.AttributeName3 ...Links EnclosedBy: Text Data will be enclosed by double quotes (") and will be escaped by backslash \ if double quote (") is available in the data. Example: 1,2,3,"Postpaid","Prepaid","{\βLinks":[]}" |
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. |
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 |