Sending enrichment data batches to Contentsquare
Once the Provider has collected the required Contentsquare session identifiers, they can start enriching the Contentsquare data with their own data.
Sending a batch of enrichment data falls into 2 steps:
- Authenticating and retrieving the right enrichment endpoint dynamically
- Sending the enrichment data to this endpoint with a valid JWT
Authentication
Section titled AuthenticationSee the dedicated Authentication section.
Sending data to the enrichment endpoint
Section titled Sending data to the enrichment endpointPrerequisites
Section titled Prerequisites- Step 3: the Provider must have the knowledge of which Contentsquare project ID and sessions the data will enrich
- Step 4.1: the Provider must have a valid JWT and base URL for the enrichment endpoint
- All the enrichments of a batch sent to the enrichment endpoint have to match the schema version of the integration provided in the request (if an enrichment gets rejected, then the full batch will be rejected)
HTTP Request
Section titled HTTP RequestRequest
Section titled Request- Endpoint (returned by the authentication call in step 4.1):
https://enrichment-api.{cloud}.contentsquare.com/v1/enrichments
- Method:
POST
- Header:
Authorization: Bearer {JWT access token}
- Body:
integrationVersion
: a schema version for the integration must be specified so that Contentsquare can know which schema the data must match. Every time a new schema is created, Contentsquare provides the provider with a new integration version. The Provider must take care of sending data that match the right schema version. If the Provider has only one schema registered, then theintegrationVersion
should remain1
by default.enrichmentNumber
: as a Contentsquare session can be enriched with up to 3 enrichments, each enrichment must be indexed so that it can potentially be updated later (see the dedicated section on how to update an enrichment). Index should start at 1 and can be max 3. If no enrichment number is specified by the Provider, it will be considered as1
by default (meaning that if the Provider never specifies any enrichment number, any new enrichment for a session will overwrite the previous one and there will be only 1 enrichment per session - with index1
)
Response
Section titled ResponseSuccess 200
(Empty body)
Errors
Section titled ErrorsUnauthorized: 401
: invalid JWT token
Section titled Unauthorized: 401: invalid JWT tokenBad request 400
: data validation failed
Section titled Bad request 400: data validation failedBad request 400
: bad integration version
Section titled Bad request 400: bad integration versionExample
Section titled ExampleRequest
Section titled RequestResponse
Section titled ResponseSuccess 200
Limitations
Section titled Limitations- EnrichmentNumber:
- Min: 1
- Max: 3
- Number of enrichments per batch: max 200
- Sessions that started more than 7 days ago cannot be enriched (enrichment for those sessions will not be rejected but no data will be available in the Contentsquare platform in the end)