Skip to main content
Version: 3.x

POST /players/impanel

The /players/impanel endpoint ingests a participant’s demographic and qualification data.
This information is used by TapResearch’s targeting system to determine which surveys the user is eligible for.
Call this endpoint before requesting surveys so that /campaigns can return only the campaigns the user qualifies for.


Request

Headers

NameRequiredDescription
X-Api-TokenYour API token.
X-User-IdentifierUnique user identifier.

Body Parameters (JSON)

NameTypeRequiredDescription
country_idIntegerCountry ID from /countries.
profile_dataArrayArray of qualification responses from /qualifications.
tsIntegerCurrent Unix timestamp (in seconds).
sechStringSHA-256 hash of user_identifier:timestamp, signed with your API secret.

Profile Data Format

Each object in profile_data represents a qualification and its responses.

FieldTypeDescription
question_idIntegerID of the qualification question.
valuesArraySelected pre_code integers or text values, depending on the question type.

Example Request

{
"country_id": 1,
"profile_data": [
{
"question_id": 42,
"values": [25]
},
{
"question_id": 43,
"values": [1, 2]
},
{
"question_id": 44,
"values": ["94568"]
}
],
"ts": 1713456789,
"sech": "a3f9b6c40b31..."
}

Response

A successful impanelment returns:

{ "success": true }

If there’s an issue, an error object is returned with details:

{ "error": "Invalid security hash" }

Notes

  • The API secret must never be included in the request — only use it server-side to generate the sech hash.
  • Use the pre_code values from /qualifications for Single select and Multi select data points.
  • The sech is computed as a SHA-256 digest of user_identifier:ts using your API secret.
  • Both ts and sech must be provided as JSON fields in the request body.
  • Call this endpoint before retrieving campaigns from /campaigns.
  • A 200 OK response with "success": true confirms the participant has been impaneled successfully.