Raj Mohan
Raj Mohan

Reputation: 543

How to send result in survey monkey using CURL

I create a new survey form using survey monkey, and i get all questions using api and create custom form in my site. Now how can we update the result in survey monkey using CURL. I tired this /surveys/{id}/pages/{id}/questions/{id} but no response.

Version : V3

Upvotes: 0

Views: 709

Answers (1)

General Kandalaft
General Kandalaft

Reputation: 2285

By "update the result" I presume you mean you want to create a new response for your survey.

You can do that with the response API. There is cURL examples on the right side of the page. Something along the lines of:

curl -i -X POST https://api.surveymonkey.net/v3/collectors/{collector_id}/responses \
     -H "Content-Type: application/json" -H "Authorization:bearer <your_access_token>" \
     -d '{
            "pages": [{
                "id": "<page_id>",
                "questions": [{
                    "answers": [{
                        "choice_id": "<choice_id>"
                    }],
                    "id": "<question_id>"
                }, {
                    "answers": [{
                        "text": "<open ended response>"
                    }],
                    "id": "<question_id>"
                }]
            }]
         }'

Depending on the question types you have in your survey. Make sure you have a collector created already.

Given you are just trying to embed a survey on your website, I recommend you just use a website collector instead of trying to automate this yourself (depending on your use case).

Upvotes: 1

Related Questions