While posting to the surveymonkey api im expecting a JSON payload but whenever I send it i get a status "3" which on their documentation is an Invalid Request I'm unsure what im supposed to be giving to the api to get the data i need back. Am i missing something that is needed to get this list of surveys back?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.surveymonkey.net/v2/surveys/get_survey_list?api_key=apikey");
request.Headers.Add("Authorization", "bearer " + responseToken);
request.ContentType = "application/json";
request.Method = "POST";
request.Accept = "*/*";
request.UserAgent = "WindowsFormApplication3";
Console.WriteLine(request.UserAgent);
string listString = "";
byte[] listData = encoding.GetBytes(listString);
using (HttpWebResponse listResponse = (HttpWebResponse)request.GetResponse())
{
Console.WriteLine("listResponse = " + listResponse);
bool b = listResponse.GetResponseStream().CanRead;
using (StreamReader reader = new StreamReader(listResponse.GetResponseStream()))
{
Console.WriteLine(reader.ReadToEnd());
}
}
}
catch (Exception aProblem)
{
System.Diagnostics.Debug.WriteLine(aProblem);
}
}
EDIT: If it helps when i use get_user_details instead of get_survey_list i get a valid response which gives the correct information