Get contact profile API

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.

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)

Body Parameters

The following table describes the elements in the request body:

ParameterTypeMandatoryDescription
profile-idStringYesSpecifies the profile ID.
profile-nameStringNoSpecifies the profile name.
keyStringConditionally MandatorySpecifies the profile key. Either β€œkey”, β€œfilter”, or β€œfile” is mandatory.
fileStringConditionally MandatorySpecifies 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.
syncStringNoSpecifies the processing type. The options are:

1 - Synchronous processing
2 - Asynchronous processing
The default option is 1.
include-headersStringNoThis 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.
filterStringConditionally MandatorySpecifies the filter definition. Either β€œkey”, β€œfilter”, or β€œfile” is mandatory.
filter.attribute-idStringConditionally MandatorySpecifies the β€œattribute-id” or β€œattribute-name”. At least one parameter is mandatory to build a condition.
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.
linkfilterStringNoSpecifies the filter on linked profile.
linkfilter.profile-idStringNoSpecifies the linked profile ID to query.
linkfilter.profile-nameStringNoSpecifies the linked profile name to Query.
linkfilter.conditionsStringNoSpecifies the conditions on linked profile.
selectfieldsStringNoSpecifies the fields to return. By default, all fields from the queried profile will be selected.
selectfields.attribute-idStringNoSpecifies the AttributeID _to select. Either _AttributeID _or _AttributeName should be provided.
selectfields.attribute-nameStringNoSpecifies the _AttributeName _to select. Either _AttributeID _or _AttributeName _should be provided.
showlinksStringNoSpecifies 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-idStringNoSpecifies the linked profile ID.
selectlinkfields.profile-nameStringNoSpecifies the linked profile name.
showlinks.attributesStringNoSpecifies 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:

ParameterDescription
attributesReturns the profile attributes.
attributes.nameReturns the attribute name.
attributes.idReturns the attribute ID.
attributes.valueReturns the attribute value (String value or another JSON).
linksReturns the link attributes if any.
links.profile-idReturns the link profile ID.
links.profile-nameReturns the link profile name.
links.attributesReturns the link attributes.
request-idReturns the request-id when the sync is set as asynchronous.
fileReturns 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 CodeCode within API ResponseDescription
2001010The request was not processed.
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