0

I am trying to get the survey id by using API through PostMan.

I have below requests generated but still I am not able to get the survey id.

Request 1:-

GET - https://api.surveymonkey.com/oauth/authorize?

with below parameter passed- 
response_type = code
redirect_uri = <<OAUTH_REDIRECT_URL>>
client_id = <<CLIENT_ID>>

Request 2:-

POST - https://api.surveymonkey.com/oauth/token

with below parameters passed-
client_id = <<CLIENT_ID>>
client_secret = <<SECRET_KEY>>
code = <<ACCESS_TOKEN>>
grant_type = authorization_code
redirect_uri = <<OAUTH_REDIRECT_URL>>

However, after second request, I am getting below error-

{
    "error_description": "Missing required parameter(s): client_id, client_secret, code, grant_type, redirect_uri",
    "error": "invalid_request"
}

Please suggest if I am missing anything.

Krunal
  • 1,138
  • 1
  • 9
  • 28
  • Possible duplicate of [Missing parameters when requesting OAUTH token survey monkey v3](https://stackoverflow.com/questions/43793757/missing-parameters-when-requesting-oauth-token-survey-monkey-v3) – denis_lor Mar 14 '19 at 17:17
  • No its not, what about the first request. Does that sounds ok? – Krunal Mar 14 '19 at 17:27

1 Answers1

0

In the first GET request I assume all 3 parameters are recognized and properly parsed by SurveyMonkey API because you aren't getting an error message.

In the second POST request I assume all parameters are unrecognized because the error message says all parameters are missing.

This suggest to me that GET and POST requests use different methods to pass their parameters.

This answer mentions that using the GET method of passing parameters will not work for POST request.

Answer above has a Node.JS web service client implementation. If you are working with a PHP/CURL stack you can try to copy this implementatin instead.

Hugues Beauséjour
  • 8,067
  • 1
  • 9
  • 22