Object endpoints

The metrics API replicates the behavior of the analysis context in Contentsquare. To get a metric, you can filter by device, segment etc. Plus, for page groups and zones metrics, you will have to define for which page group or zones you want data. To help you, we provide an API that retrieves these objects: segments, page groups etc.

GET /v1/segments

Get the list of all segments for a project. More information regarding segments in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

  • ids   string  

    Filter the results and get a list of segments that matches the ids provided.
    Multiple IDs should be separated by a comma.

Example of response

{
"payload": [
{
"id": 1,
"name": "New visitors",
"source": "contentsquare",
"createdAt": "2019-11-21T09:46:16.000Z",
"updatedAt": "2019-11-21T09:46:16.000Z"
}
],
"success": true
}

GET /v1/goals

Get the list of all goals for a project. More information regarding goals in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

Example of response

{
"payload": [
{
"id": 100,
"name": "Reach Cart",
"type": "pageview",
"createdAt": "2019-10-05T10:34:42.670Z",
"updatedAt": "2019-11-21T09:46:09.000Z"
}
],
"success": true
}

GET /v1/mappings

Get the list of all mappings for a project. More information regarding mappings in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

  • ids   string  

    Filter the results and get a list of segments that matches the ids provided.
    Multiple IDs should be separated by a comma.

Example of response

{
"payload": [
{
"id": 101010,
"name": "New Zoning Mapping",
"description": "Test",
"createdAt": "2019-11-05T09:44:51.000Z",
"updatedAt": "2019-11-05T09:45:05.000Z"
}
],
"success": true
}

GET /v1/mappings/{mappingId}

Get information for a specific mapping More information regarding mappings in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

Path parameters

  • mappingId   integer   Required

    The Mapping ID.

Example of response

{
"payload": [
{
"id": 101010,
"name": "New Zoning Mapping",
"description": "Test",
"createdAt": "2019-11-05T09:44:51.000Z",
"updatedAt": "2019-11-05T09:45:05.000Z"
}
],
"success": true
}

GET /v1/mappings/{mappingId}/page-groups

Get all the page groups for a specific mapping More information regarding mappings and page groups in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

Path parameters

  • mappingId   integer   Required

    The Mapping ID.

Example of response

{
"payload": [
{
"id": 1010,
"name": "Product Pages",
"category": "Other"
}
],
"success": true
}

GET /v1/page-groups/{pageGroupId}

Get information about a page and all the related mappings More information regarding page groups in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

Path parameters

  • pageGroupId   integer   Required

    The Page Group ID.

Example of response

{
"payload": {
"id": 1010,
"name": "Product pages",
"category": "Other",
"mappings": [
{
"id": 147,
"name": "Ecommerce",
"description": null,
"createdAt": "2018-10-16T11:37:36.000Z",
"updatedAt": "2019-08-21T07:12:18.000Z"
},
{
"id": 148,
"name": "All pages",
"description": null,
"createdAt": "2018-10-16T12:49:49.000Z",
"updatedAt": "2019-08-21T07:12:23.000Z"
}
]
},
"success": true
}

GET /v1/page-groups/{pageGroupId}/zonings

Get all the zonings for a page group More information regarding zonings in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

Path parameters

  • pageGroupId   integer   Required

    The Page Group ID.

Example of response

{
"payload": [
{
"id": 100,
"name": "Revamp product page",
"createdAt": "2019-10-25T13:12:45.000Z",
"lastUpdatedAt": "2019-10-29T11:11:22.000Z"
}
],
"success": true
}

GET /v1/zonings/{zoningId}/zones

Get all the zones for a zoning More information regarding zonings in Contentsquare

Query parameters

  • projectId   integer  

    Required only for an account-level API key. The target project.

Path parameters

  • zoningId   integer   Required

    The Zoning ID.

Example of response

{
"payload": [
{
"id": 100,
"name": "Add to cart button"
}
],
"success": true
}