Identity Records
- Introduction to the REST API for Identities
- Building the Base URL for the API Calls
- Example: Get the Details for a Known Identity
Introduction to the REST API for Identities
To manage identity records that are stored in SAS Customer Intelligence 360 through a REST API, use endpoints in the Marketing Data API. With this REST API, you can perform these actions:
- submit a query based on an ID’s value to retrieve the internal ID (data hub ID) that corresponds to that identity record
- return detailed information about an identity
The developer documentation for this API is available at Marketing Data API.
Building the Base URL for the API Calls
To successfully use the Marketing Data API, start with the correct URL domain.
- Find the host name for the REST
API.
Navigate to
Administration
Data and Integrations. Click Access Points.- Make note of the value of the
External gateway host field. This is the root URL
for any API calls that go through the external API gateway. Use the value in
this field when you see the variable
<external gateway host> in the
documentation.
An example might use the following URL for an endpoint:
https://<external gateway host>/<endpoint>
- Use this base URL with the API paths to make
calls. For example:
GET https://<external gateway host>/marketingData/identityRecords
Example: Get the Details for a Known Identity
In this example, you send a series of REST calls to retrieve the detailed identity record for a known ID value (such as a customer ID).
- To authenticate with the REST API, specify your
authorization token as the bearer token in all REST API calls. This token might be
a
static JWT or an access token.
Note: Use the term “Bearer” as a prefix and add a space before the value of the JWT.
The header should be similar to this example:
Using a Token as the Authorization Header Header Attribute
Value
Authorization
Bearer eyJ0eXAiOGciO.DAxMGFhODEJ9.BRv_nD6v - Send a GET call to retrieve
the internal ID (the data hub ID) for a known ID type. In the GET
call, define a query parameter based on the ID’s value and
type:
- Set the parameter to
one of these values:
customerId,loginId, orvisitorId. - Set the parameter equal
to a known identity that matches the parameter’s type. For
example, if the parameter is
customerId, the value should be a known customer ID.
For example, this call submits a query based on the customer ID value
qtmart_cust100043:GET https://<external gateway host>/marketingData/identityRecords?customerId=qtmart_cust100043In the response, make note of an identity's ID value. This is an example of a successful response:
{ "id": "d6f0dd7a-c747-4a6b-b605-bd11195fe394", "version": 1, "links": [ { "method": "GET", "rel": "self", "href": "https://<external gateway host>/marketingData/identityRecords/d6f0dd7a-c747-4a6b-b605-bd11195fe394", "uri": "/identityRecords/d6f0dd7a-c747-4a6b-b605-bd11195fe394", "type": "application/vnd.sas.marketing.data.identityRecord" } ] } - Set the parameter to
one of these values:
- Send a GET call by using
a data hub ID to retrieve other identity information that is associated
with that customer:
GET https://<external gateway host>/marketingData/identityRecords/<data hub ID>For example, here is a sample response that uses the data hub ID from the previous step (d6f0dd7a-c747-4a6b-b605-bd11195fe394):
{ "id": "d6f0dd7a-c747-4a6b-b605-bd11195fe394", "version": 1, "identities": [ { "id": "374942", "type": "subject_id", "source": "520af261-0108-4bc0-8dd9-623efe67aab8", "createTime": "2020-05-08 17:09:59.203", "attributes": { "cci.user_email": "Aayma.Baker@myEmail.com", "cci.recent_purchase_date": "2013-04-21 00:00:00.0", "cci.product_sub_start": "2018-11-20 00:00:00.0", "cci.country": "UnitedStates", "cci.zip": "02112", "cci.age": "21", "cci.product_sub_end": "2020-12-31 00:00:00.0", "cci.birthday": "1993-12-11 00:00:00.0", "cci.sign_up": "2018-03-09 00:00:00.0", "cci.city": "Boston", "cci.first_name": "Aayma", "cci.loyalty_sign_up": "2018-07-02 00:00:00.0", "cci.last_name": "Baker", "cci.trial_end": "2021-06-07 00:00:00.0", "cci.gender": "F", "cci.last_order": "2018-07-25 00:00:00.0", "cci.children": "N" } }, { "id": "aayma.baker100043.lcj", "type": "login_id", "source": "520af261-0108-4bc0-8dd9-623efe67aab8", "createTime": "2020-05-08 17:09:59.202", "attributes": { "cci.user_email": "Aayma.Baker@myEmail.com", "cci.recent_purchase_date": "2013-04-21 00:00:00.0", "cci.product_sub_start": "2018-11-20 00:00:00.0", "cci.country": "UnitedStates", "cci.zip": "02112", "cci.age": "21", "cci.product_sub_end": "2020-12-31 00:00:00.0", "cci.birthday": "1993-12-11 00:00:00.0", "cci.sign_up": "2018-03-09 00:00:00.0", "cci.city": "Boston", "cci.first_name": "Aayma", "cci.loyalty_sign_up": "2018-07-02 00:00:00.0", "cci.last_name": "Baker", "cci.trial_end": "2021-06-07 00:00:00.0", "cci.gender": "F", "cci.last_order": "2018-07-25 00:00:00.0", "cci.children": "N" } }, { "id": "8ad91916-cfb0-4354-b6a3-74618dee834e", "type": "visitor_id", "source": "import", "attributes": { "cci.user_email": "Aayma.Baker@myEmail.com", "cci.recent_purchase_date": "2013-04-21 00:00:00.0", "cci.product_sub_start": "2018-11-20 00:00:00.0", "cci.country": "UnitedStates", "cci.zip": "02112", "cci.age": "21", "cci.product_sub_end": "2020-12-31 00:00:00.0", "cci.birthday": "1993-12-11 00:00:00.0", "cci.sign_up": "2018-03-09 00:00:00.0", "cci.city": "Boston", "cci.first_name": "Aayma", "cci.loyalty_sign_up": "2018-07-02 00:00:00.0", "cci.last_name": "Baker", "cci.trial_end": "2021-06-07 00:00:00.0", "cci.gender": "F", "cci.last_order": "2018-07-25 00:00:00.0", "cci.children": "N" } }, { "id": "qtmart_cust100043", "type": "customer_id", "source": "520af261-0108-4bc0-8dd9-623efe67aab8", "createTime": "2020-05-08 17:09:59.203", "attributes": { "cci.user_email": "Aayma.Baker@myEmail.com", "cci.recent_purchase_date": "2013-04-21 00:00:00.0", "cci.product_sub_start": "2018-11-20 00:00:00.0", "cci.country": "UnitedStates", "cci.zip": "02112", "cci.age": "21", "cci.product_sub_end": "2020-12-31 00:00:00.0", "cci.birthday": "1993-12-11 00:00:00.0", "cci.sign_up": "2018-03-09 00:00:00.0", "cci.city": "Boston", "cci.first_name": "Aayma", "cci.loyalty_sign_up": "2018-07-02 00:00:00.0", "cci.last_name": "Baker", "cci.trial_end": "2021-06-07 00:00:00.0", "cci.gender": "F", "cci.last_order": "2018-07-25 00:00:00.0", "cci.children": "N" } } ], "links": [ { "method": "GET", "rel": "self", "href": "https://<external gateway host>/marketingData/identityRecords/d6f0dd7a-c747-4a6b-b605-bd11195fe394", "uri": "/identityRecords/d6f0dd7a-c747-4a6b-b605-bd11195fe394", "type": "application/vnd.sas.marketing.data.identityRecord" } ] }