Skip to content

Retrieve the datalayer

Request

Retrieves the Datalayer object for the current session. The datalayer can be used to provide contextual data when tracking user activity, for example providing values for 'User Attributes' in hotjar. The /blaize/profile endpoint is preferred for retrieving complete user profile information.
All fields configured in the admin console will be resolved against the current session and returned.
The top-level property in the response object defaults to 'dataLayer' and can be configured in the console under the data layer settings using the 'Data Layer Name' field.
Data layer fields can be grouped by their 'Entity' as configured in the console. An example of the possible groupings is included.

Security
CookieBlaizeSession or JwtQuery or JwtHeaderXBlaizeJwt or JwtHeaderXZephrJwt or JwtBearer or JwtCookie
cURL
curl -i -X GET \
  https://demo-site/blaize/datalayer \
  -b blaize_session=YOUR_API_KEY_HERE

Responses

OK

Headers
Cache-Controlstring

The response cache header max-age can be configured by support, and defaults to zero seconds.

Bodyapplication/json
dataLayerArray of objects
Response
{ "dataLayer": [ { … }, { … }, { … }, { … } ] }