Inputs

The Site24x7Provider class handles authentication and interacts with the Site24x7 API to install webhooks and fetch alerts. Here are the primary methods and their parameters:

Main Class Methods

  • setup_webhook(tenant_id, keep_api_url, api_key, setup_alerts)

    • tenant_id (str): Tenant identifier.
    • keep_api_url (str): URL to send alert data.
    • api_key (str): API key for authentication.
    • setup_alerts (bool): Whether to setup alerting capabilities (default is True).
  • _get_alerts()

    • Returns a list of AlertDto objects representing the alerts.

Authentication Parameters

The Site24x7ProviderAuthConfig class is used for API authentication and includes:

  • zohoRefreshToken (str): Refresh token for Zoho authentication. Required
  • zohoClientId (str): Client ID for Zoho authentication. Required
  • zohoClientSecret (str): Client Secret for Zoho authentication. Required
  • zohoAccountTLD (str): Top-Level Domain for the Zoho account. Options include .com, .eu, .com.cn, .in, .com.au, .jp. Required

Connecting with the Provider

To use the Site24x7 Provider, initialize it with the necessary authentication credentials and provider configuration. Ensure that your Zoho account credentials (Client ID, Client Secret, and Refresh Token) are correctly set up in the Site24x7ProviderAuthConfig.

Steps to Obtain a Refresh Token

  1. Registration and Client Credentials:

    • Navigate to Zoho API Console.
    • Sign in or sign up using the email associated with your Site24x7 account.
    • Register your application using the “Self Client” option to get your Client ID and Client Secret.
  2. Generating Grant Token:

    • Go to the Zoho Developer Console and access your registered Self Client.
    • In the “Generate Code” tab, input the required scopes (Site24x7.Admin.Read, Site24x7.Admin.Create, Site24x7.Operations.Read), description, and time duration.
    • Click “Generate” and copy the provided code.
  3. Generating Access and Refresh Tokens:

    • Use the grant token to make a POST request to https://accounts.zoho.com/oauth/v2/token to obtain the access and refresh tokens.
    curl -X POST 'https://accounts.zoho.com/oauth/v2/token' \
         -d 'client_id=your_client_id' \
         -d 'client_secret=your_client_secret' \
         -d 'code=your_grant_token' \
         -d 'grant_type=authorization_code'
    
    

    OR

    import requests
    
    response = requests.post(
        'https://accounts.zoho.com/oauth/v2/token',
        data={
            'client_id': 'your_client_id',
            'client_secret': 'your_client_secret',
            'code': 'your_grant_token',
            'grant_type': 'authorization_code'
        }
    )
    refresh_token = response.json().get('refresh_token')
    

Notes

  • Ensure that the necessary scopes Site24x7.Admin.Read, Site24x7.Admin.Create, Site24x7.Operations.Read are included when generating the grant token, as they dictate the API functionalities accessible via the provider.
  • Zoho API Console Link

Webhook Integration Modifications

The webhook integration grants Keep access to the following scopes within Site24x7:

  • authenticated
  • valid_tld

The webhook can be accessed via the “Alarms” section in the Site24x7 console.