Getting Started with Site24x7 APIs
Site24x7 APIs help you achieve all the operations that can be performed on our web client. The API requires Authtoken as an account identifier. This API is built using the REST principles which ensures predictable URLs that make writing applications easy. The API follows HTTP rules, where a wide range of HTTP clients can be used to interact with the API. All Site24x7 APIs require an Authorization request header for authentication and is authenticated using an authtoken. You can programmatically generate an authtoken using the Zoho Accounts API.
Programmatically use the APIs:
Create Authtoken
Submit an HTTP POST request to the below URL.
https://accounts.zohoportal.com/accounts/client/authtoken
Below are the mandatory case sensitive params to be passed in the URL.
Parameter | Description |
portal | <portal_id>* |
<email> | |
password | <password> |
client_portal | true |
scopes | Site24x7/site24x7api |
desc | api |
grant_type |
password |
- Generate an MSP authtoken (while you're in your MSP session).
- Submit an HTTP GET API request, with the generated MSP authtoken to the following URL:
https://www.site24x7.com/api/msp/customers/portals - The JSON response will contain the details about the required "portal_id".
Request Sample:
curl
-X POST
-H "Cache-Control: no-cache" "https://accounts.zohoportal.com/accounts/client/authtoken?portal=12353635607&email=accountcontact@zohocorp.com&password=11411111&client_portal=true&scopes
=Site24x7/site24x7api&desc=api&grant_type=password"
Response Sample:
{"t":"json","data":{"token":"12353635607.13213743991.ce2af7cfdf47e3ef6262c20f1c06487ac2fbf210b4c34ef3d1f11c671"}}
Delete Authtoken
If you choose to delete an existing authtoken, simply submit an HTTP POST request to the below URL.
https://accounts.zohoportal.com/accounts/client/authtoken/delete
Below are the mandatory case sensitive params to be passed in the URL.
Parameter | Description |
portal | <portalid> |
authtoken | <authtoken> |
Request Sample:
curl
-X POST
-H "Cache-Control: no-cache" "https://accounts.zohoportal.com/accounts/client/authtoken/delete?portal=12353635607&authtoken=12353635607.13213743991.ce2af7cfdf47e3ef6262c20f1c06487ac2fbf210b4c34ef3d1f11c671"
Response Sample:
{"t":"json","data":{"response":true}}
How to use Authtoken for APIs
To successfully use authtokens for APIs, you must first extract the relevant value for the parameter "zaid", obtained from the response of the GET request (https://www.site24x7.com/api/msp/customers/portals). Once you obtain the "zaid" value, you can either pass this mandatory parameter in your API request or set it as a cookie header with the cookie name "clientportal".
Request Sample:
Using additional parameter:
curl
-X GET
-H "Content-Type: application/json;charset=UTF-8"
-H "Accept: application/json; version=2.0"
-H "Authorization: Zoho-authtoken 12353635607.13213743991.ce2af7cfdf47e3ef6262c20f1c06487ac2fbf210b4c34ef3d1f11c671" https://www.site24x7.com/api/monitor_groups/status?zaid=j2db7FrteGyJWxa/JjpJlw==
Using cookie header:
curl
-X GET
-H "Content-Type: application/json;charset=UTF-8"
-H "Accept: application/json; version=2.0"
-H "Authorization: Zoho-authtoken 12353635607.13213743991.ce2af7cfdf47e3ef6262c20f1c06487ac2fbf210b4c34ef3d1f11c671"
-H "Cookie: clientportal=j2db7FrteGyJWxa/JjpJlw=="
https://www.site24x7.com/api/monitor_groups/status
Response Sample:
{"code":0,"message":"success","data":[{"group_name":"zohocorp.com","group_id":"20390000087595","monitors":3,"status":2,"error_monitors":1,"top_group":true}]}