Hi!
I try to authenticate and send my first request, but I get the 403 error.
Here is my code, whose ENDPOINT is: "https://api.pulseway.com/v3/"
var ENDPOINT = _configuration["PulsewayService:ENDPOINT"];
var TOKEN_ID = _configuration["PulsewayService:TOKEN_ID"];
var TOKEN_SECRET = _configuration["PulsewayService:TOKEN_SECRET"];
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(ENDPOINT);
var auth = TOKEN_ID + ":" + TOKEN_SECRET;
var authBytes = Encoding.ASCII.GetBytes(auth);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(authBytes));
var response = await client.GetAsync("devices");
response.EnsureSuccessStatusCode();
}
I get the same error with postman.
Have I made a mistake?
Thanks for your help!
Cyril