403 Error on request from .net project

403 Error on request from .net project

I have a problem when calling this API " https://desk.zoho.com/api/v1/organizations" with a valid "Zoho-oauthtoken 1000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" token passed in the authorization header I get a 403 forbidden error.

When calling this from Postman with the same token (header="Authorization: Zoho-oauthtoken 1000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) it works ok.


This is the code fragment which get executed:
var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);

ttpWebRequest.Method = "GET";

httpWebRequest.Headers.Add(HttpRequestHeader.Authorization, currentToken); HttpWebResponse httpResponse;

try

{

      httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();

}

catch (Exception e)

{
      Console.WriteLine(e.Message);

      throw;
}

Anybody got an idea?

Thanks.
Hans Vermeulen