Skip to main content

Discover

note

Your entitlements change which datasets and authorization groups you can call. The API only exposes and accepts datasets from the TelmarHelixa provider. A valid API key without access to the requested dataset returns 403, and a mnemonic in the audience you cannot access returns 401. See Authentication.

Getting started​

URL REQUEST (POST)
https://engines.api.telmar.com/omg/prd/v1/crosstab

Ranks items by affinity with a single audience on POST /crosstab.

The API ranks items against that audience and returns the top items in one payload. There is nothing to page.

Every request needs a Telmar-Engine-Authorizer API key.

Main parameters​

Dataset and authorization group​

surveyCode is the dataset code. The API only exposes and accepts datasets from the TelmarHelixa provider. authorizationGroup is required and must be a group provisioned for the caller.

A mnemonic in audience or items that the caller cannot access returns 401.

Dataset and authorization group
{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA"
}

Audience​

audience is exactly one coding statement. An empty audience, or more than one statement, returns 400.

An audience that is too small to rank returns 400.

Audience
{
"audience": "(GMEN=#1) AND (AGE18_34=#1)"
}

Table and weight​

table and weightIndex are required. weightIndex selects the survey weight.

Table and weight
{
"table": "#1",
"weightIndex": 1
}

Limit​

limit is optional. It is the maximum number of ranked items in the response. The default is 10. The maximum is 50.

Limit
{
"limit": 5
}

Optional items​

items adds candidate items to rank. They are included in the same ranked list. Unknown mnemonics in items follow failOnMnemonicNotFound (default true).

Items
{
"items": ["HX_BRAND_0412"]
}

Let's go to examples​

Every payload below is synthetic. The shared constants they reuse — the dataset, the authorization group, the audience, and the items — are documented once in the example gallery.

Ranked items for one audience​

POST/crosstab200 OKExample

The default Discover call. One audience, and the top items by affinity. Use it when a planner needs the items that over-index against an audience.

note

Items are ordered by affinity (highest first), then proj, then mnemonic. The items array is capped at limit and may be shorter.

URL REQUEST (POST)
{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(GMEN=#1) AND (AGE18_34=#1)",
"table": "#1",
"weightIndex": 1,
"limit": 5
}
The same call as curl
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(GMEN=#1) AND (AGE18_34=#1)",
"table": "#1",
"weightIndex": 1,
"limit": 5
}'
We will receive a json like this — 200 OK
{
"success": true,
"message": "ok",
"discover": {
"audienceSize": {
"proj": 24180.2
},
"items": [
{
"rank": 1,
"mnemonic": "HX_BRAND_0412",
"label": "Brand A",
"affinity": 3.42,
"proj": 2210.4,
"audiencePercent": 9.14,
"itemPercent": 41.8,
"stability": 0
},
{
"rank": 2,
"mnemonic": "HX_BRAND_0088",
"label": "Brand B",
"affinity": 2.97,
"proj": 1504,
"audiencePercent": 6.22,
"itemPercent": 36.3,
"stability": 0
}
]
}
}

Optional items included in the ranking​

POST/crosstab200 OKExample

You already have item mnemonics to consider. Send them in items and they are ranked with the audience in the same list.

note

items is optional. Supplied items appear in the same ranked items array, ordered by affinity.

URL REQUEST (POST)
{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(GMEN=#1) AND (AGE18_34=#1)",
"items": [
"HX_BRAND_0412",
"HX_BRAND_0088"
],
"table": "#1",
"weightIndex": 1,
"limit": 5
}
The same call as curl
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(GMEN=#1) AND (AGE18_34=#1)",
"items": [
"HX_BRAND_0412",
"HX_BRAND_0088"
],
"table": "#1",
"weightIndex": 1,
"limit": 5
}'
We will receive a json like this — 200 OK
{
"success": true,
"message": "ok",
"discover": {
"audienceSize": {
"proj": 24180.2
},
"items": [
{
"rank": 1,
"mnemonic": "HX_BRAND_0412",
"label": "Brand A",
"affinity": 3.42,
"proj": 2210.4,
"audiencePercent": 9.14,
"itemPercent": 41.8,
"stability": 0
},
{
"rank": 2,
"mnemonic": "HX_BRAND_0088",
"label": "Brand B",
"affinity": 2.97,
"proj": 1504,
"audiencePercent": 6.22,
"itemPercent": 36.3,
"stability": 0
}
]
}
}

Audience is not a single coding statement​

POST/crosstab400 Bad RequestExample

The call was sent with two audience statements. audience must be a single coding statement — the audience every item is ranked against.

note

To compare two audiences, make two Discover calls.

URL REQUEST (POST)
{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": [
"(GMEN=#1)",
"(GWOMEN=#1)"
],
"table": "#1",
"weightIndex": 1,
"limit": 5
}
The same call as curl
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": [
"(GMEN=#1)",
"(GWOMEN=#1)"
],
"table": "#1",
"weightIndex": 1,
"limit": 5
}'
We will receive a json like this — 400 Bad Request
{
"success": false,
"error": "audience must be a single coding statement."
}

Audience mnemonic the caller cannot access​

POST/crosstab401 UnauthorizedExample

The API key is valid, and a mnemonic in the audience or in items is not cleared for this authorization group.

note

401 here is about a coding statement you sent, which is separate from a missing or expired Telmar-Engine-Authorizer header. Do not retry until the mnemonic or the authorization group changes.

URL REQUEST (POST)
{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(SECRET_CODE=#1)",
"table": "#1",
"weightIndex": 1,
"limit": 5
}
The same call as curl
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(SECRET_CODE=#1)",
"table": "#1",
"weightIndex": 1,
"limit": 5
}'
We will receive a json like this — 401 Unauthorized
{
"success": false,
"error": "The audience is not accessible for this authorization group."
}

Account is not enabled for the Discover API​

POST/crosstab403 ForbiddenExample

The API key is valid, but this account is not enabled for the Discover API.

note

This is a commercial boundary. Contact Sales to enable the Discover API — no payload change will resolve it.

URL REQUEST (POST)
{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(GMEN=#1) AND (AGE18_34=#1)",
"table": "#1",
"weightIndex": 1,
"limit": 5
}
The same call as curl
curl -X POST 'https://engines.api.telmar.com/omg/prd/v1/crosstab' \
-H 'Telmar-Engine-Authorizer: SAMPLE.ENGINE.AUTHORIZER' \
-H 'Content-Type: application/json' \
-d '{
"surveyCode": "HXUS",
"authorizationGroup": "CLIENTA",
"audience": "(GMEN=#1) AND (AGE18_34=#1)",
"table": "#1",
"weightIndex": 1,
"limit": 5
}'
We will receive a json like this — 403 Forbidden
{
"success": false,
"error": "The Discover API is not enabled for this account."
}