Please note: All new registrants to the Panopto Community Forum must be approved by a forum moderator or admin. As such, if you navigate to a feature that is members-only, you may receive an error page if your registration has not yet been approved. We apologize for any inconvenience and are approving new members as quickly as possible.
C# Getting 403 Forbidden when calling REST API
Collin Looby
Tyro
in API
Hey all, I was finally able to figure out how to successfully retrieve an auth token. Now when I call the REST api passing along the token, I get a 403 Forbidden error message.
My basic code is below. Also note that the client created in Panopto was for User Based Server Application. Any help would be greatly appreciated!
client = new HttpClient();
client.BaseAddress = new Uri("https://johndeere.hosted.panopto.com");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
Uri uri = new Uri("https://johndeere.hosted.panopto.com/api/v1/users/me/sessions/viewed");
response = await client.GetAsync(uri);
jsonString = await response.Content.ReadAsStringAsync();
Tagged:
0
Answers
Hi Collin,
It looks like there may be a small error in the URL to call the API.
Can you try changing it to "https://johndeere.hosted.panopto.com/Panopto/api/v1/users/me/sessions/viewed"?
Please let me know if you have any other questions.
Thanks,
Kevin