Survey
POST
/surveys/{survey_id}/responsesSubmit Survey Response
Submit a survey response.
The account_id is automatically set from the authenticated user. Each user can only submit once per survey.
Requires: Bearer token.
Request
Example
curl -X POST 'https://api.paycose.com/api/v1/app1/platform/wallet/surveys/{{survey_id}}/responses' \
-H 'X-Session-Token: {{session_token}}' \
-H 'X-Country: {{country}}' \
-H 'X-Test-Mode: {{x_test_mode}}' \
-d '{
"answers": [
{
"question_id": "q1",
"answer": "easy"
},
{
"question_id": "q2",
"answer": [
"charges",
"invoices"
]
},
{
"question_id": "q3",
"answer": 4
},
{
"question_id": "q4",
"answer": true
},
{
"question_id": "q5",
"answer": "Acme Corp"
},
{
"question_id": "q6",
"answer": "Great product!"
}
],
"metadata": {
"source": "dashboard"
}
}'Headers
| Name | Value | Description |
|---|---|---|
| X-Session-Token | {{session_token}} | |
| X-Country | {{country}} | |
| X-Test-Mode | {{x_test_mode}} | true=wallet_test, false=wallet_live (default). Toggle the x_test_mode collection variable to flip every applicable request. |
Body
| Name | Type | Value |
|---|---|---|
| answers | array | [6] |
| metadata | object | {…} |
{
"answers": [
{
"question_id": "q1",
"answer": "easy"
},
{
"question_id": "q2",
"answer": [
"charges",
"invoices"
]
},
{
"question_id": "q3",
"answer": 4
},
{
"question_id": "q4",
"answer": true
},
{
"question_id": "q5",
"answer": "Acme Corp"
},
{
"question_id": "q6",
"answer": "Great product!"
}
],
"metadata": {
"source": "dashboard"
}
}Responses
00
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"location": "<string>",
"object": "<string>",
"message": "<string>",
"code": 0,
"key": "<string>",
"i18n_key": "<string>",
"provider": "<string>",
"provider_code": "<string>",
"param": "<string>",
"request_id": "<string>",
"reason": "<string>"
}200200 OK
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"id": "<string>",
"object": "<string>",
"created_at": "<RFC3339 timestamp>",
"updated_at": "<RFC3339 timestamp>",
"survey_id": "<string>",
"account_id": "<string>",
"status": "<string>",
"submitted_at": "<RFC3339 timestamp>",
"metadata": {},
"answers": [
{
"id": "<string>",
"question_id": "<string>",
"answer": null
}
]
}400400 Bad Request
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"location": "<string>",
"object": "<string>",
"message": "<string>",
"code": 0,
"key": "<string>",
"i18n_key": "<string>",
"provider": "<string>",
"provider_code": "<string>",
"param": "<string>",
"request_id": "<string>",
"reason": "<string>"
}401401 Unauthorized
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
Body
{
"location": "<string>",
"object": "<string>",
"message": "<string>",
"code": 0,
"key": "<string>",
"i18n_key": "<string>",
"provider": "<string>",
"provider_code": "<string>",
"param": "<string>",
"request_id": "<string>",
"reason": "<string>"
}