Surveys API

complete answering returns 201

POST /api/v1/surveys

Request

Headers

Accept: application/json
X-Api-Token: saUHhpPuEef1NUnBevWhYUFV_Pex9ACETw
X-Api-Email: user-173@example.com

Route

POST /api/v1/surveys

Body

{"data":{"question_1":"a","question_2":"b","billing_country":"ATA"},"survey":"onboarding_aug_2017"}

cURL

curl "http://localhost:3000/api/v1/surveys" -d '{"data":{"question_1":"a","question_2":"b","billing_country":"ATA"},"survey":"onboarding_aug_2017"}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: saUHhpPuEef1NUnBevWhYUFV_Pex9ACETw" \
	-H "X-Api-Email: user-173@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 207

Status

201 Created

Body

{
  "id": 1,
  "user_id": 175,
  "school_id": 86,
  "survey": "onboarding_aug_2017",
  "data": {
    "question_1": "a",
    "question_2": "b",
    "billing_country": "ATA"
  },
  "created_at": "2019-10-31T21:59:45Z",
  "updated_at": "2019-10-31T21:59:45Z"
}