Category: CDP and Personalize

Sitecore CDP- Create Guests using REST Api

https://{apiEndpoint}/v2/guests

Request to the api-

Use Client Key in User name and API Token in password to send request with Basic Auth-

Response-

Note ref field. The ref field is a guest reference which can be used further to extend or pull the guests details-

See the Properties tab to verify all the guests details-

cURL code snippet-

curl --location --request POST 'https://api.boxever.com/v2/guests' \
--header 'Authorization: Basic <<Enter Token>>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "guestType": "customer",
    "title": "Mr",
    "firstName": "Icy",
    "lastName": "Saber",
    "gender": "male",
    "dateOfBirth": "",
    "emails": [
        "icy.saber@mailfy.com"
    ],
    "phoneNumbers": [
        "01234567890"
    ],
    "nationality": "British",
    "passportNumber": "GB4B9565",
    "passportExpiry": "",
    "street": [
        "Apartment 140",
        "West Drive Avenue"
    ],
    "city": "London",
    "country": "GB",
    "postCode": "SW12",
    "state": "London"
}

C# code snippet-

var client = new RestClient("https://api.boxever.com/v2/guests");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic <<Enter Token>>");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@"    ""guestType"": ""customer"",
" + "\n" +
@"    ""title"": ""Mr"",
" + "\n" +
@"    ""firstName"": ""Icy"",
" + "\n" +
@"    ""lastName"": ""Saber"",
" + "\n" +
@"    ""gender"": ""male"",
" + "\n" +
@"    ""dateOfBirth"": """",
" + "\n" +
@"    ""emails"": [
" + "\n" +
@"        ""icy.saber@mailfy.com""
" + "\n" +
@"    ],
" + "\n" +
@"    ""phoneNumbers"": [
" + "\n" +
@"        ""01234567890""
" + "\n" +
@"    ],
" + "\n" +
@"    ""nationality"": ""British"",
" + "\n" +
@"    ""passportNumber"": ""GB4B9565"",
" + "\n" +
@"    ""passportExpiry"": """",
" + "\n" +
@"    ""street"": [
" + "\n" +
@"        ""Apartment 140"",
" + "\n" +
@"        ""West Drive Avenue""
" + "\n" +
@"    ],
" + "\n" +
@"    ""city"": ""London"",
" + "\n" +
@"    ""country"": ""GB"",
" + "\n" +
@"    ""postCode"": ""SW12"",
" + "\n" +
@"    ""state"": ""London""
" + "\n" +
@"}
" + "\n" +
@"
" + "\n" +
@"";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client
import json

conn = http.client.HTTPSConnection("api.boxever.com")
payload = json.dumps({
  "guestType": "customer",
  "title": "Mr",
  "firstName": "Icy",
  "lastName": "Saber",
  "gender": "male",
  "dateOfBirth": "",
  "emails": [
    "icy.saber@mailfy.com"
  ],
  "phoneNumbers": [
    "01234567890"
  ],
  "nationality": "British",
  "passportNumber": "GB4B9565",
  "passportExpiry": "",
  "street": [
    "Apartment 140",
    "West Drive Avenue"
  ],
  "city": "London",
  "country": "GB",
  "postCode": "SW12",
  "state": "London"
})
headers = {
  'Authorization': 'Basic <Enter Token>>',
  'Content-Type': 'application/json'
}
conn.request("POST", "/v2/guests", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference-

https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/use-the-create-guest-function-in-sitecore-cdp-rest-api.html

https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/overview-of-sitecore-cdp-rest-apis.html

https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/sitecore-cdp-guest-extensions-data-model-for-rest-api.html

Loading

Sitecore CDP- Generate browser ID

The browser ID is a universally unique identifier (UUID) that Sitecore CDP assigns to every user of your application. It associates sessions, events, and orders with the respective user.

To generate browser id at server side in this case using postman use following URL-

https://{{apiEndpoint}}/{{apiVersion}}/browser/create.json?client_key={{CLIENT_KEY}}&message={}

API Endpoint

{{apiEndpoint}} – API target endpoint depends on the region client key is available in. Following are the regions and url available at the point of writing this blog and as per this document

Europe – https://api.boxever.com

Asia Pacific – https://api-ap-southeast-2-production.boxever.com

United States – https://api-us.boxever.com

See here for more details on the Sitecore CDP Rest API

API Version

API Version is v1.2

Client Key

See here for more details on How to get Client Key and API Token

Get the client key from the Sandbox/CDP & Personalise portal.

Login to portal – https://app.boxever.com/#/

Top right click the clog icon. Select API Access option

Get teh client key from this page-

Request/Response-

Status- OK. The request was served successfuly

Anantmous(Guest) should be created. Browser ID is in “ref” field in the response

Check the guest details in portal with the Browser ID-

Goto the Guests page –

Search guests with browser id. (bid: <<browser id>>)

This should the Guest Type as Visitor which means its Anonymous and not yet known or uniquely identified.

CURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/browser/create.json?client_key=<<client key>>&message={}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/browser/create.json?client_key=<<client key>>&message={}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/browser/create.json?client_key=<<code key>>&message=%7B%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

References

Preparing to integrate with Sitecore CDP

Understanding integration details

Loading

Sitecore CDP – Send Checkout Event

The CHECKOUT event captures a guest’s action of checking out an order.

After you send this event, you can view the event in the guest profile.

API url for CHECKOUT event

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

Request payload for CHECKOUT event

In the session event you should be able to see the Purchase Complete event with the Order Number where the customer completed the checkout.

This should help to get the revenue earned.

cURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={"channel":"WEB","type":"CHECKOUT","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"7ed103bd-08c2-47f4-8f69-91141ca3200d","status":"PURCHASED","reference_id":"ORDER_1"}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={\"channel\":\"WEB\",\"type\":\"CHECKOUT\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"7ed103bd-08c2-47f4-8f69-91141ca3200d\",\"status\":\"PURCHASED\",\"reference_id\":\"ORDER_1\"}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<Client Key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22CHECKOUT%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%227ed103bd-08c2-47f4-8f69-91141ca3200d%22,%22status%22:%22PURCHASED%22,%22reference_id%22:%22ORDER_1%22%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference- https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/send-a-checkout-event-to-sitecore-cdp.html

Loading

Sitecore CDP – Send Confirm Event

The CONFIRM event captures the confirmation of purchased products.

Use the following endpoint for sending the confirm event.

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

ADD event

See how to create a browser id and Add Event before a confirm event is sent.

CONFIRM Event

Search Customer by browserid or Name.

You should be able to see the customer Online at that point odf instance

Click on Timeline and View Session details

Get the session details and should see the Order Confirmed event

Clieck on the settings icon to see more details-

cURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={"channel":"WEB","type":"CONFIRM","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"7ed103bd-08c2-47f4-8f69-91141ca3200d","product":[{"item_id":"EXACT_90"}]}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={\"channel\":\"WEB\",\"type\":\"CONFIRM\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"7ed103bd-08c2-47f4-8f69-91141ca3200d\",\"product\":[{\"item_id\":\"EXACT_90\"}]}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<Client Key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22CONFIRM%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%227ed103bd-08c2-47f4-8f69-91141ca3200d%22,%22product%22:%5B%7B%22item_id%22:%22EXACT_90%22%7D%5D%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference- https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/send-a-confirm-event-to-sitecore-cdp.html

Loading

Sitecore CDP Intergration Series

Sitecore CDP and Personalize FAQs

How to get the Client Key and API Token?

How to create and get the point of sale?

How to debug?

How to get the base URL for Sitecore CDP Rest API?

What is the latest version of Javascript Library?

How to get Fullstack Experience friendly id?

What if the size of the compressed batch file exceeds the max limit i.e. 50MB?

Why I recieve HTTP 400 response when uploading the batch file?

Why I recieve HTTP 409 response when uploading the batch file?

How to delete a guest profile without using Batch API?

What access do you need to setup the Point of sale for Sitecore CDP and Personalize?

How to generate the browser id using postman?

Integrate using direct HTTP requests

Sending VIEW Event using direct HTTP requests

Send IDENTITY Event using direct HTTP request

Send ADD Event using direct HTTP request

Send CONFIRM Event using direct HTTP request

Send CHECKOUT Event using direct HTTP request

Upload guest data

Abandon cart with force close event

Loading

Sitecore CDP – Abandon cart with force close event

You can force close event to test Abandon Cart. This works only in non-prod environments.

Assumption- An identified guest which is active and has added products in cart.

If you are corectly tracking you should see in the timeline Session and event a Product been added.

So whilst developing if you want to force close this session, since you might not want to wait for 20 minutes for session to expire or whatever time is set to expire the session, you can force close the session to see or perform the next steps if the cart is been abandoned.

The force close event can be triggered by providing message type as FORCE_CLOSE in the payload.

Send the payload to this endpoint. For more details on what should be the apiEndpoint and client key see this blog

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

var browser_id = pm.environment.get("browserId") -- browser id
var pointOfSale = pm.environment.get("PointOfSale") -- point of sale

var message = {    
    "channel": "WEB",
    "type": "FORCE_CLOSE",
    "language": "EN",
    "currency": "GBP",
    "page": "home page",
    "pos": pointOfSale,
    "browser_id": browser_id
}

postman.setEnvironmentVariable("message", JSON.stringify(message));

Since the session is now closed we can see the Abandoned Revenue. Further reminder mails can be sent to user to complete the purchase on the abandoned cart.

Hope this helps.

Loading

Sitecore CDP – Upload guest data

Prepare guest data file to upload

Prepare Json file

Take a sample guest data from here

Sample data guest looks like this-

{
   "ref":"b4b92667-54e9-444f-8f64-11672fe9843a",
   "schema":"guest",
   "mode":"upsert",
   "value":{
      "guestType":"customer",
      "firstSeen":"2010-03-07T16:15:11.000Z",
      "lastSeen":"2012-08-23T16:17:16.000Z",
      "firstName": "Eager",
      "lastName": "Benz",
      "email": "eager.benz@malify.com",
      "extensions":[
         {
            "name":"ext",
            "key":"default",
            "loyaltytier":"level2",
            "rewardBalance":"50125"            
         }
      ]
   }
}
{
   "ref":"0cc6c80b-0b19-446f-9e14-579f75a96c4a",
   "schema":"guest",
   "mode":"upsert",
   "value":{
      "guestType":"customer",
      "firstSeen":"2010-03-07T16:15:11.000Z",
      "lastSeen":"2012-08-23T16:17:16.000Z",
      "firstName": "Goofy",
      "lastName": "Trovalds",
      "email": "goofy.trovalds@malify.com",
      "extensions":[
         {
            "name":"ext",
            "key":"default",
            "loyaltytier":"level3",
            "rewardBalance":"50130"            
         }
      ]
   }
}

Load the data in json file. Note that the above is a single row in a json and repeat the rows to upload multiple guets. This is not a json formatted file and should not have “,” to seperate rows as normally json file has. Highlighted email is important to identify the customer and add/update the extended data. This depends on the rule setup for your environment to identify the customer.

gzip the json file to upload

Example-

tar -czvf guest-upload.gz .\guest-upload.json

Generate MD5 File Checksum

Upload the gzip file to generate the check sum on this url –

https://emn178.github.io/online-tools/md5_checksum.html

Prepare Pre-signed Request

Create a new guid for the below batch upload. This guid will be used to know the status of the batch upload.

https://api.boxever.com/v2/batches/<<your guid>>

Request body –

{
    "checksum": "aaab5899b405bc3cb1d9b*******",
    "size": 412
}

Setup the Basic Auth before sending the request-

Request after setting up Authentication and body-

Response-

location – where the file needs to be uploaded. Will see this is next request where we actually upload file.

expiry – date time until the location to upload file is valid

The response should be saved in environment with uploadURL and batchRef variable-

Upload file

Upload URL request should contain the URL received from the pre-signed request-

Set the headers-

x-amz-server-side-encryption – AES256

Content-Md5 – <<Hex to Base checksum value>>

Content-Md5 is the Hex to Base64 converted value of checksum

Use this url to convert to base64-

https://base64.guru/converter/encode/hex

Request Headers should look like this-

The request signature we calculated does not match the signature you provided. Check your key and signing method.

Send request to the provided URL with the attached gzip file and headers. Response 200 Ok

Check the status of the uploaded file-

https://api.boxever.com/v2/batches/{{batchRef}}

The upload is queued and may take time depending on the items queued.

With the below request it shows the upload request is processing.

This request took almost 2 hours to complete, and the response here is error where 1 of the guets is updated but opther failed.

This is the log, where you should be able to rectify any errors in json file-

Lets check the other guest if available in portal-

Errors

SignatureDoesNotMatch

Loading

Sicore CDP – Send Add Event using direct HTTP request

The ADD event captures the product details when a user adds the product(s) to their online cart.

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

To know more what should be the API endpoint and api version see this blog

Pre-requisite- The guest has to be created which can be identitfied as browserid

Generate browser id – see how to generate browserid using postman here

URL – contains event to create Add event. – highlighted below.

Add the Product details the user must have added in cart and send the below request to Sitecore CDP.

At this point the Guest must have been identified as the Customer. Search Customer by browserid or Name.

Should the current activity of the customer.

Click on Timeline and View Session details

The session should show the product been added to the cart. Based on this if the product remains in cart for certain time and the user doen’t checkout you may provision to trigger abandon cart event.

cURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={"channel":"WEB","type":"CONFIRM","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"7ed103bd-08c2-47f4-8f69-91141ca3200d","product":[{"item_id":"EXACT_90"}]}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={\"channel\":\"WEB\",\"type\":\"CONFIRM\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"7ed103bd-08c2-47f4-8f69-91141ca3200d\",\"product\":[{\"item_id\":\"EXACT_90\"}]}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<Client Key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22CONFIRM%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%227ed103bd-08c2-47f4-8f69-91141ca3200d%22,%22product%22:%5B%7B%22item_id%22:%22EXACT_90%22%7D%5D%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference-

https://doc.sitecore.com/cdp/en/developers/api/index-en.html#UUID-51cdc30a-8344-72dc-457c-98aa2866da39

Loading

Sitecore CDP – Send Identity Event using direct HTTP request

An IDENTITY event contains data that enables Sitecore CDP to perform identity resolution. When Sitecore CDP receives an IDENTITY event, it runs a linking algorithm to try to match guest data from separate guest profiles, based on your organization’s identity rules. 

A guest is identified with the browser id. To search the guest Navigate to the Guest list page and search for the guest with the browwser id.

To identify the guest as a Customer provide the payload with the type as IDENTITY and the Customer details, such as their email, firstname, lastname etc.

Sending a request through postman- use below URL-

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

To know more what should be the API endpoint and api version see this blog

Pre-requisite- The guest has to be created which can be identitfied as browserid

Generate browser id – see how to generate browserid using postman here

URL – contains event to create view event.

To know more about the point of sale and how to create see blog

var browser_id = pm.environment.get("browserId")
var pointOfSale = pm.environment.get("PointOfSale")

var message = {    
    "channel": "WEB",
    "type": "IDENTITY",
    "language": "EN",
    "currency": "GBP",
    "page": "Login",
    "pos": pointOfSale,
    "browser_id": browser_id,
    "title": "Sir",
    "email": "pgrill@malify.com",
    "firstname": "Patoral",
    "lastname": "Grill"
}

postman.setEnvironmentVariable("message", JSON.stringify(message));

Now search the Guest by browserid and the Gust Type should be Customer as the Guest has been identified.

CURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/event/create.json?client_key=<<client key>>&message={"channel":"WEB","type":"IDENTITY","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"7ed103bd-08c2-47f4-8f69-91141ca3200d","title":"Sir","email":"pgrill@malify.com","firstname":"Pastoral","lastname":"Grill"}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/event/create.json?client_key=<<code key>>&message={\"channel\":\"WEB\",\"type\":\"IDENTITY\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"7ed103bd-08c2-47f4-8f69-91141ca3200d\",\"title\":\"Sir\",\"email\":\"pgrill@malify.com\",\"firstname\":\"Pastoral\",\"lastname\":\"Grill\"}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code cnippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<client key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22IDENTITY%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%227ed103bd-08c2-47f4-8f69-91141ca3200d%22,%22title%22:%22Sir%22,%22email%22:%22pgrill@malify.com%22,%22firstname%22:%22Pastoral%22,%22lastname%22:%22Grill%22%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

References-

https://doc.sitecore.com/cdp/en/developers/api/index-en.html#UUID-279a4b64-8bb2-2e5d-3ec7-6b469e284dc7

Loading

Sitecore CDP- Sending View Event using direct HTTP requests

The VIEW event captures the guest’s action of viewing a page. To track guest behavior use VIEW event on all pages.

Sending a request through postman- use below URL-

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

To know more what should be the API endpoint and api version see this blog

Generate browser id – see how to generate browserid using postman here

URL – contains event to create view event.

Message-

var browser_id = pm.environment.get("browserId")
var pointOfSale = pm.environment.get("PointOfSale")

var message = {    
    "channel": "WEB",
    "type": "VIEW",
    "language": "EN",
    "currency": "GBP",
    "page": "home page",
    "pos": pointOfSale,
    "browser_id": browser_id
}

postman.setEnvironmentVariable("message", JSON.stringify(message));

Check the view event in Sitecore CDP portal-

Search the Broswer Id in guests page-

Select the Anonymous Visitor.

Select the Timeline tab

Select the orange color settings icon to check the view event details which is only displayed in debug mode-

See the detials the message that was sent as part of request-

CURL command for same –

curl --location -g --request GET 'https://api-engage-eu.sitecorecloud.io/v1.2/event/create.json?client_key=<<enter client key>>&message={"channel":"WEB","type":"VIEW","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"<<enter browser id>>"}'

C# code-

var client = new RestClient("https://api-engage-eu.sitecorecloud.io/v1.2/event/create.json?client_key=<<enter client key>>&message={\"channel\":\"WEB\",\"type\":\"VIEW\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"<<enter browser id>>\"}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python- http client code snippet-

import http.client

conn = http.client.HTTPSConnection("api-engage-eu.sitecorecloud.io")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<enter client key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22VIEW%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%22<<enter browser id>>%22%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference-

https://doc.sitecore.com/cdp/en/developers/api/index-en.html#UUID-281a2b8f-627d-a71b-4a1f-df545bc617e9

Loading