Research profiling
Submitting a profiler
The Moya Business API supports the arbitrary submission of profiler questions by qualifying suppliers/vendors. Any vendors running their own surverys and have data agreements should use this endpoint to submit candidate profilers. A profiler consists of a research question
and and a list of valid options
for it. There are currently no limits in terms of how many profilers a vendor can submit but this is subject to change.
Example request
curl --location --request POST 'https://api.moya.app/v1/research_profilers' \
--header 'Authorization: Bearer YourSecretToken' \
--header 'Content-Type: application/json' \
--data-raw '{
"question": "Which of these options apply to you?",
"options": ["Option 1", "Option 2", "Option 3"]
]
}'
Example response
{
"profiler_id": "30428d5b-8b8b-4901-b3cc-070b5457e9ea",
"options": {
"option 1": "06c7f6a0-172e-49a3-a3a8-c4f11dcecc1",
"option 2": "511ecabb-d5a7-4ea9-b44c-45cd8521a026",
"option 3": "71dae59c-929f-4b09-8f0d-269553df787e"
}
}
HTTP Request
POST https://api.moya.app/v1/research_profilers
Parameters
Name | Type | Required | Description |
---|---|---|---|
question | String | Yes | Text describing the profiler question. |
options | Array | Yes | List options that are valid answers to the above question. All options are automatically lowercased and deduplicated. At least two options are required. |
Answering a profiler
Qualifying vendors can submit responses/answers to existing profilers, on behalf of registered panelists. Any given panelist can only have a single answer recorded for any profiler they answer via a vendor. Each vendor can only submit panelist answers for profilers that they have created.
Example request
curl --location --request POST 'https://api.moya.app/v1/profiler_answer' \
--header 'Authorization: Bearer YourSecretToken' \
--header 'Content-Type: application/json' \
--data-raw '{
"profiler_id": "30428d5b-8b8b-4901-b3cc-070b5457e9ea",
"option_id": "06c7f6a0-172e-49a3-a3a8-c4f11dcecc1",
"phone_number: "27123456789"
]
}'
HTTP Request
POST https://api.moya.app/v1/profiler_answer
Parameters
Name | Type | Required | Description |
---|---|---|---|
profiler_id | String | Yes | The unique reference for the profiler being answered. |
option_id | String | Yes | The unique reference for the profiler answer being chosen. |
phone_number | String | Yes | The phone number of the panelist on whose behalf this response is being submitted. |
Response
Every successful request is responded to with an empty HTTP response (204 No Content
).
Retrieving profilers
A list of previously created profilers can be fetched with their corresponding answer options and respective ids.
Example request
curl --location --request GET 'https://api.moya.app/v1/research_profilers' \
--header 'Authorization: Bearer YourSecretToken' \
--header 'Content-Type: application/json'
Example response
[
{
"id": "7baabd6a-3bfd-4c53-9460-48759de6b7c9",
"question": "Do you like cheesecake?",
"created_at": "2022-09-23T12:02:33.992607",
"options": [
{
"id": "41187937-803a-4005-9db2-bb4bc6a479e2",
"option": "no"
},
{
"id": "063299ed-17c8-4903-a823-1c890893fdd0",
"option": "yes"
}
]
}
]
HTTP Request
GET https://api.moya.app/v1/research_profilers
Retrieving individual profilers
A previously created profiler can be fetched using its unique id.
Example request
curl --location --request GET 'https://api.moya.app/v1/research_profilers/7baabd6a-3bfd-4c53-9460-48759de6b7c9' \
--header 'Authorization: Bearer YourSecretToken' \
--header 'Content-Type: application/json'
Example response
{
"question": "Do you like cheesecake?",
"created_at": "2022-09-23T12:02:33.992607",
"options": [
{
"id": "41187937-803a-4005-9db2-bb4bc6a479e2",
"option": "no"
},
{
"id": "063299ed-17c8-4903-a823-1c890893fdd0",
"option": "yes"
}
]
}
HTTP Request
DELETE https://api.moya.app/v1/research_profilers/{id}
Deleting individual profilers
A previously created profiler can be deleted using its unique id.
Example request
curl --location --request DELETE 'https://api.moya.app/v1/research_profilers/7baabd6a-3bfd-4c53-9460-48759de6b7c9' \
--header 'Authorization: Bearer YourSecretToken' \
--header 'Content-Type: application/json'
HTTP Request
GET https://api.moya.app/v1/research_profilers/{id}
Response
Every successful request is responded to with an empty HTTP response (204 No Content
).