Go to All Forums

[API issues] You are not authorized to perform this operation

Hi team

 We are facing an issue when we are not able to use site24 API. Also i have given the scope Site24x7.Admin.Read while generating the code to get access token. i am able to get the token but  It is  still not working.  

 $ curl www.site24x7.com/api/monitors -H 'Authorization: Zoho-authtoken <token>'
{"error_code":1100,"message":"You are not authorized to perform this operation"}

 How to fix It?

 but for other api like , to see monitor status using scope  Site24x7.Msp.Read i am able get the response.

Br,

Almas

Like (2) Reply
Replies (7)

Re: [API issues] You are not authorized to perform this operation

Dear Abhishek,

   Did you pass the 'zaaid' as the additional cookie header parameter? Providing the zaaid ensure you get /put the right data from the api.

From our Site24x7 API doc .

To operate your MSP customer account using APIs, you must pass an additional cookie header parameter “zaaid”. You can obtain this unique “zaaid” parameter for your individual customer accounts by initiating a GET API request “/api/short/msp/customers”. You can use the “zaaid” parameter received in this API response.

I guess this will help you solve your problem. Let us know if it helped. 

-Jasper

Product Manager, Site24x7

Like (0) Reply

Re: Re: [API issues] You are not authorized to perform this operation

I want to get the list of monitors of our portal . Not customers

 We are facing an issue when we are not able to use site24 API. Also i have given the scope Site24x7.Admin.Read while generating the code to get access token. i am able to get the token but  It is  still not working.  

 $ curl www.site24x7.com/api/monitors -H 'Authorization: Zoho-authtoken <token>'
{"error_code":1100,"message":"You are not authorized to perform this operation"}

 

 

Like (0) Edit Delete Reply

Re: Re: Re: [API issues] You are not authorized to perform this operation

www.site24x7.com/help/api/#list-monitor i am talking about this api request

Like (0) Edit Delete Reply

Re: Re: [API issues] You are not authorized to perform this operation

as you can see no cookie is required in the header request. 

Like (0) Edit Delete Reply

Re: Re: Re: [API issues] You are not authorized to perform this operation

Dear Abhishek,

    Since you are working on MSP, in order to get the list of monitors you need to pass the zaaid. If you are working on getting list monitors for N customers you need to make N requests. 

"By default, all API requests executed as part of the MSP account operation will use the standard header parameters. You do not have to generate any additional cookie headers to initiate an API request. However, If you initiate an API request for an unauthorized MSP operation, the following error message will be shown "You are not authorized to perform this operation."

For this api www.site24x7.com/help/api/#list-monitor pass in the zaaid of the customer as a cookie parameter in the header.

$ curl https://www.site24x7.com/api/monitors 
-H "Content-Type: application/json;charset=UTF-8"
-H "Accept: application/json; version=2.0"
-H "Authorization: Zoho-oauthtoken <authtoken>"
-H "Cookie: zaaid=<actual zaaid>"

Please read the msp api help doc for full reference with examples.

We have separate APIs for getting global MSP account data across all Customer Accounts. That's the reason you're able to get the current status across customers. 

-Jasper

Like (0) Reply

Re: Re: Re: Re: [API issues] You are not authorized to perform this operation

i am now applying cookie and getting the same error!! may i know how can i get tagname of monitors ?? any api is there which can give me the tagname along with monitor name??

 

 

 

Like (0) Reply

Re: Re: Re: Re: [API issues] You are not authorized to perform this operation

what scope to give for authorization code  for acces token api???

Like (0) Reply

Was this post helpful?