we have a survey in surveymonkey and using c# to try and add the email addresses to the survey using the surveymonkey api. the api works fine for GETS but we have yet to get a POST to work. all we get back is
"docs": "https://developer.surveymonkey.com/api/v3/#error-codes", "message": "There was an error retrieving the requested resource.", "id": "1020", "name": "Resource Not Found", "http_status_code": 404
all of the id's are correct as we can GET information about the survey but cannot POST to it. we have granted all the scopes so there shouldn't be a limitation or restriction on that side. SurveyMonkey api support might as well not exist as they are a complete waste of time and cannot answer a single question about their api.
the code below is our latest attempt at calling out to the api with a POST. we put the actual ids in the uri instead of {id} I did not include our id's here for the obvious reasons.
using (var client = new HttpClient()) { var uri = new Uri("https://api.surveymonkey.net/v3/surveys/{id}/collectors/{id}/messages/{id}/recipients-d"); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",ConfigurationManager.AppSettings["SurveyMonkeyAccessToken"]); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var content = new StringContent("{ \"email\": + " + emailAddress + " }", Encoding.UTF8, "application/json"); var response = client.PostAsync(uri,content); ParseSurveyPostResponses(response) }
anyone successfully post to a surveymonkey survey using their V3 api?
Url
you are hitting? Theid=1020
may be a clue to your problem. – JuanR