Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
CDPCloud Portal
Sitecore CDP Developer Documentation
  • Developing with Sitecore CDP
        • Integrate using the Engage SDK script and Google Tag Manager
        • Integrate using the Engage SDK script
        • Integrate a React app using the Engage SDK package
        • Integrate a Next app using the Engage SDK package (client-set cookies)
        • Integrate a Next.js app using the Engage SDK package (server-set cookies)
        • Integrate using direct HTTP requests
        • Upgrade from the Boxever JavaScript Library to the Engage SDK
    • IP allowlists
  1. Walkthroughs for integrating
  1. Walkthroughs for integrating
  2. Integrate using direct HTTP requests

Integrate using direct HTTP requests

This topic explains how to integrate using direct HTTP requests. This is useful if you want to integrate Sitecore CDP with a native app or native mobile app.

To follow this walkthrough, you'll use a terminal or an API testing tool, for example, Postman. This walkthrough uses cURL in the Git Bash terminal to demonstrate making HTTP requests. In production, you make the HTTP requests in your code base.

This walkthrough describes how to:

  1. Get the browser ID from Sitecore CDP.

  2. Send your first VIEW event.

  3. Verify that Sitecore CDP captured your VIEW event.

Before you begin
  • Collect the required details about your Sitecore CDP instance.

  • Make sure you're familiar with the HTTP request-response cycle and with making HTTP requests in the terminal using cURL.

Get the browser ID from Sitecore CDP

The first step to integrating is to make an HTTP request to Sitecore CDP to get the browser ID. You have to include the browser ID in every subsequent request you make to Sitecore CDP.

To get the browser ID:

  1. In your terminal, make the following HTTP request.

    Replace the placeholder values with the required details from your Sitecore CDP instance.

    curl -X GET -g '<stream_api_target_endpoint_PLACEHOLDER>/v1.2/browser/create.json?client_key=<client_key_PLACEHOLDER>'

    Example request:

    curl -X GET -g 'https://api-engage-eu.sitecorecloud.io/v1.2/browser/create.json?client_key=ZpHxO9WvLOfQRVPlvo0BqB8YjGYuFfNe'

    The HTTP response body is a JSON object that contains a ref key.

    The ref key contains the browser ID.

       "ref" : "a38b230c-11eb-4cf9-8d5d-274e9f344925​",
  2. Note down the browser ID. You'll include it in every subsequent request you make to Sitecore CDP.

Send your first VIEW event

After you have retrieved the browser ID, you send an event as key-value pairs.

To send an event:

  1. Prepare the key-value pairs that describe the VIEW event. In a later step, you pass them to the message query parameter in the URL. You must prepare the key-value pairs to be valid in the URL. Make sure that you:

    • Wrap every key and every value in double quotes "".

    • Don't add line breaks.

    • Don't add spaces around keys and around values.

    Example key-value pairs:

    "browser_id":"a38b230c-11eb-4cf9-8d5d-274e9f344925​","channel":"MOBILE_APP","type":"VIEW","language":"EN","currency":"EUR","page":"homepage","pos":"myretailsite/ireland"
    Important

    Note that the "browser_id" key contains the browser ID that you retrieved in a previous step.

    Every event that you send to Sitecore CDP must include the browser ID.

  2. In your terminal, make the following HTTP request, passing the key-value pairs to the message query parameter.

    Replace the placeholder values with the required details from your Sitecore CDP instance.

    In the message query parameter, replace the placeholder values with event object values specific to your organization.

    curl -X GET -g '<stream_api_target_endpoint_PLACEHOLDER>/v1.2/event/create.json?client_key=<client_key_PLACEHOLDER>&message={"browser_id":"<browser_id_PLACEHOLDER>","channel":"<channel_PLACEHOLDER>","type":"<type_PLACEHOLDER>","language":"<language_PLACEHOLDER>","currency":"<currency_PLACEHOLDER>","page":"<page_PLACEHOLDER>","pos":"<pos_PLACEHOLDER>"}'

    Example request:

    curl -X GET -g 'https://api-engage-eu.sitecorecloud.io/v1.2/event/create.json?client_key=ZpHxO9WvLOfQRVPlvo0BqB8YjGYuFfNe&message={"browser_id":"a38b230c-11eb-4cf9-8d5d-274e9f344925​","channel":"MOBILE_APP","type":"VIEW","language":"EN","currency":"EUR","page":"homepage","pos":"myretailsite/ireland"}'

    The event data is sent to Sitecore CDP.

Verify that Sitecore CDP captured your VIEW event

After you have sent a VIEW event, you log in to Sitecore CDP and find the event.

To verify that Sitecore CDP captured your VIEW event:

  1. In Sitecore CDP, click Guests, then in the search dropdown, select Browser ID and enter the browser ID that you retrieved in a previous step.

    Example search string:

    a38b230c-11eb-4cf9-8d5d-274e9f344925​

    An anonymous guest displays.

    Search field in the Guests screen.

    This is you making an HTTP request to get the browser ID in a previous step. Next, you find the VIEW event associated with this guest.

  2. Click the guest. The guest profile displays.

  3. On the guest profile page, click Event viewer. A list of events associated with this guest displays. The list contains a VIEW event. This is the event that was triggered in the previous procedure.

Next steps

You've now successfully integrated your app with Sitecore CDP. You made an HTTP request to get the browser ID. Then, using the browser ID, you sent a VIEW event and verified that Sitecore CDP captures data about your users in real time.

Next, you can:

  • Send other types of events, for example, an IDENTITY event.

  • Learn more about the browser ID.

If you have suggestions for improving this article, let us know!

Documentation Assistant

This assistant uses AI to generate responses based on Sitecore documentation. While it has access to official sources, answers may be incomplete or inaccurate and should not be considered official advice or support.
Powered by
k
kapa.ai
Protected by reCAPTCHA

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use