Cyrion Posted April 4 Posted April 4 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
Ash Posted May 21 Posted May 21 The ENDPOINT should be the instance name - not "https://api.pulseway.com/v3/"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now