Go to All Forums

Issue while getting data using API


Suddenly I started Getting the Error "The remote server returned an error 403 forbidden" in My C# Code while getting data from Site24 API . It was working few days back but now stopped working. Below is my Code. Token is also active in account. What i am missing. ?

innerurl = "https://www.site24x7.com/api/reports/sla_reports/availability?period=3";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(innerurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Accept = "*/*";
httpWebRequest.Method = "GET";
httpWebRequest.Headers["Authorization"] = "My Token Here";
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); [Here it gives 401 Forbidden]
Like (3) Reply
Replies (3)

Re: Issue while getting data using API

Hi Vandan,

    Hope you are able to get the reports now, if not please contact support@site24x7.com as it will involve some troubleshooting of your account.

Generally 403 forbidden error is thrown in the following scenarios,

1. Wrong authtoken or token deleted.

2. The user does not have permission to access to that module.

3. The role could have been changed. 
Product Manager, Site24x7
Like (0) Reply

Re: Issue while getting data using API

Did you ever make progress on this issue? I am getting a 403 forbidden response using this method even though entering the URL with my authtoken directly into a browser succeeds. I've had trouble finding any documentation apart from this thread on using ASP.net's httpWebRequest class as a substitute for CURL.

Like (0) Reply

Re: Re: Issue while getting data using API

Dear Warren, 

  Could post some more details on this. Like what API you were trying to access and the code snippet if possible. We'll check it out and let you know. 


Product Manager, Site24x7 

Like (0) Reply

Was this post helpful?