Overview
The Enrichment API lets you send server-side session data to Contentsquare, so it can be tied to the client-side data your tag or SDK already tracks.
- Base URL of the API:
https://enrichment-api.{cloud}.contentsquare.com/ - Current Version of the API: 1.0
- Authentication: see Authentication — use the
enrichmentscope.
What this API is about
Section titled What this API is aboutContentsquare relies on a web tracking tag or mobile SDK to track session-based data. By session we mean a user's visit on a website or app.
This API allows for enriching the behavioural data tracked by Contentsquare client-side, with other session-based data that can be sent server-side.
For example, you can start reconciling offline and online journeys by enriching web sessions data with phoning data for calls that were triggered from those sessions. As Contentsquare cannot access phone call data during a web session via its tag or SDK, the related data must be sent to Contentsquare server-side, once the calls are ended and processed. In Contentsquare, you can then create user segments based on this phoning data and start answering questions like: "how does a specific journey on my website impact my conversion on the phone?", or "How do users who end up making a qualitative call behave on my website?"
Enrichment Flow overview
Section titled Enrichment Flow overviewMaking an integration based on the Enrichment API up and running goes through the following steps:
- As a starting point, the Provider provides an integration schema to Contentsquare and gets listed in the Contentsquare integrations catalog
- Customers install the integration and provides the Provider with the generated Contentsquare OAuth credentials (client_id/client_secret)
- During web sessions, the Provider pulls Contentsquare session information (project ID, session ID) that will be used by Contentsquare to match the data received server-side
- The Provider can then send enrichment data batches:
- The Provider authenticates with the OAuth credentials provided by the customer, and receives both a JWT access token valid for 1 hour and the dynamic base URL of the enrichment endpoint (that depends on the cloud the target project is installed on)
- The Provider sends the data to the enrichment endpoint with a valid JWT access token
And here is a diagram summarizing the detailed interactions involved in the authentication flow for an integration based on the integration API:
sequenceDiagram
accTitle: User authentication flow
accDescr: This diagram shows the steps a user takes to authenticate with OAuth
participant Customer
participant Provider
participant CS_UI as CS console
participant Auth as Auth API
participant Enrichment as API endpoint
Note over CS_UI,Enrichment: Contentsquare
Customer->>CS_UI: Install integration and create OAuth credentials
CS_UI->>Customer: Return OAuth credentials and integration_id
Customer->>Provider: Provide credentials and integration_id
Provider->>Auth: Authenticate with OAuth credentials<br/>POST https://api.contentsquare.com/v1/oauth/token
Auth->>Provider: JWT access token & Enrichment base URL
Provider->>Enrichment: POST https://enrichment-api.{cloud}.contentsquare.com/v1/enrichments (Send enrichment data)