Search code examples
c#apirestcurlgetresponse

Header of GetResponse API version-3 in C# (MVC-5)


I am a bit confused that when I get the error:

Problem during authentication process, check headers!
Unable to authenticate user, incorrect token

There is definitely something wrong with request header.

Can any one tell me the correct way of sending a request to GetResponse API?

I am using this way:

var request = new RestRequest("/campaigns", Method.GET);
request.AddHeader("X-Auth-Token", "api-key " + auth.myAuthorizationKey);

The header looks like this in request while debugging:

{X-Auth-Token=api-key d042eeae34ce076913681cc5c872741e2c5f88d2}

Solution

  • Use APIKEY instead AuthorizationKey