Tailwind Logo

Accessing CDP profiles using Postman

Customer Data Platform

Published: 2023-08-22

We haven't covered CDP + Personalize much on the blog, but we'll start sharing tips regularly. Although an overview of the product would be ideal, we'll begin by sharing tips. First, we'll use Postman to create and update profiles.

Postman Configuration

The API for processing data against a Sitecore CDP varies by Region. In this case, I will use https://api-engage-ap.sitecorecloud.io because I have an Asian CDP instance. The URL of the server is specified in the following page.

For authentication, basic authentication is provided, and an API is provided from the CDP administration screen.

cdppostman01.png

When you get to the API access screen, you can check your Client Key and API Token, where Client Key is your user name and API Token is your password.

cdppostman02.png

Start Postman and create a new HTTP request. At this time, use the settings on the Auth tab to create the basic authentication settings.

cdppostman03.png

You are now ready to go. Open the profile registered as a sample and execute data acquisition using the key used in the URL. The result is as follows, which was obtained as Json data.

cdppostman04.png

Create a profile

Access to data creation through the API is described in the following page.

Now, let's start creating the post using Postman. The difference from the last time is that since we are not taking data, we choose POST for HTTP processing and pass the following Json data to /v2/guests.

JSON
 {
    "guestType": "顧客",
    "title": "Mr",
    "firstName": "Shinichi",
    "lastName": "Haramizu",
    "gender": "male",
    "dateOfBirth": "1971-12-08T00:00:00.000Z",
    "emails": [
        "haramizu@outlook.com"
    ],
    "phoneNumbers": [
        "0345236900"
    ],
    "nationality": "Japan",
    "city": "Minato-ku",
    "country": "JP",
    "postCode": "1070062",
    "state": "Tokyo"
}

The screen looks like this

cdppostman05.png

The result will return Json data in the following form.

cdppostman06.png

If you go to browse the guest list from the administration screen, you will see that a new profile has been created.

cdppostman07.png

Search profiles

In the first step of this article, we used the user's key to get the data, but in reality, we need to look up the key by email address or other means. So this time, we will use the email address to retrieve the key. To actually access the key, use Query Params and specify the email address used in the registration as the email address. Then some data is returned in the following form.

cdppostman08.png

A key is displayed in the items : href field in the result, and this key can be used to retrieve detailed information about this user。

cdppostman09.png

Update Profile

To update the guest list, use the key obtained in the previous step to update the guest list. In actuality, the key is entered in /v2/guests/guestRef and the post is made. In this case, specify only the items you wish to update in Json.

JSON
{
    "firstName": "真一",
    "lastName": "原水",
    "postCode": "107-0062"
}

Postman allows you to see the results of the execution in the following form.

cdppostman10.png

The management screen will confirm that the name has been updated.

cdppostman11.png

Deleting a created profile

Profiles that have been created for verification purposes, such as this one, can be deleted using Postman. Deletion is very easy, and can be done by specifying Delete instead of Get / Post.

cdppostman12.png

If a result of 200 is displayed after execution, the data has been deleted.

Summary

In this case, we used Postman to perform the process of creating, verifying, and updating a new profile. We have shown that it is possible to create and update profiles in such a simple procedure.

Tags