Published:
As the excerpt described, I have been working on a video for the Discover Sitecore YouTube channel related to Sitecore CDP/Personalize with the use of Real-time, also referred to as the Stream APIs typically used by the Sitecore CDP JavaScript library to track events in the browser. Technically by using the API’s I am in essence mimicking the behavior you might trigger if another system wanted to track behavior such as a Mobile application or maybe even a third-party system.
As was the case with Sitecore XP, it was always great if you could kill the .NET session, especially when you wanted to test the output of something you might be demonstrating to a customer in real-time or content for a video/blog. Unlike in the days of the .NET development and the .NET application with XP, where you might need to build a custom admin page that you could call while logged in to kill the session, in the realm of Sitecore CDP, you have a way to do this at any point, as long as you have a Browser Ref. In a previous blog topic on my blog about Getting the Guest Ref from the Browser Ref, I talked a little more about these different references. So you could theoretically kill the session at any point for the user by writing some JavaScript, but I’ll cover today how to do this using an API request using Postman. You might be in the middle of a demonstration like I was when creating the YouTube content, and need to show the browsed session versus the open session in Sitecore CDP (keeping in mind that CDP is the only way to view your guest data).
I’m going to show this in postman, but anything could work here to make these requests including CURL.
You can view the postman request script here if you would like to import this into Postman: Gist Postman Script.
Or you can just refer to the screenshots below. You’ll need to create an environment for your specific Tenant of CDP/Personalize and then you’ll need values for the following:
api-us
if you are accessing a tenant in the US