API connection error [solved]
Posted: Wed Aug 14, 2013 8:31 pm
Hi, i'm trying to make a call to the REST API from C#, but i always receive this message:
The X-Authorization hash is well generated (Y2x6RVIwYTRCWkdBZnBKRiFCX2VobFRTOjhkZmVjODcxOWYwZjQ1ZjY4ZGVjNGNmMDA2ODI4MzI2OTQ4ZmQ2MmU=). This is the code i use to make the call:
Anyone has any idea why i'm receiving this message? Or any C# example.
Thanks in advance!
Code: Select all
{"success":false,"error":104,"message":"Authorization header value doesn't match"}
Code: Select all
string url = String.Format("http://{0}/api/{1}", urlBase, method);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.Host = urlBase;
request.Headers.Add("X-Authorization", "Docebo " + code);
request.ContentType = "text/json";
StreamWriter requestStream = new StreamWriter(request.GetRequestStream());
requestStream.Write(json);
requestStream.Close();
With:
urlBase = gmigliarino.docebosaas.com
method = user/checkUsername
json = {"userid": "user.test"}
Thanks in advance!