Help Invoke URL/REST API

Invoke URL/REST API

Invoke URL/REST API lets you automate your IT workflows by connecting your Site24x7 event data with multiple third-party applications. It's an ‘user defined HTTP call back action’ popularly also known as a Webhook. It works as an event based output mechanism. You can define specific events in Site24x7, such as a status or attribute change of a monitor. Once an incident or event occurs in Site24x7, it will post the event data to the Hook URL specified by you. You can map an Invoke URL/REST API action at a monitor level or attribute level. You can further pass incident and custom parameters associated with the outage monitor along with the body of the POSTED URL.

Use Case:

A typical task that can be achieved via Invoke URL/REST API is management and streamlining of Site24x7 incidents, alerts, or messages in third-party Incident Management tools or Team Collaboration softwares. It will greatly improve team collaboration and improve productivity of your staff.

  • Integrate with third party softwares like PagerDuty, VictorOps etc. to handle Site24x7 alerts in their unified dashboard.
  • Build powerful workflows with applications like Slack or HipChat, where you can post your Site24x7 incident outages as messages in Slack channels or HipChat rooms. 

Set up Invoke URL/REST API

  1. Login to Site24x7.
  2. Navigate to Admin >  IT Automation Templates Add Automation Templates.
  3. Pick the Automation type as Invoke URL/REST API.
  4. Mention the following details to set up Invoke URL/REST API:
    • Display Name: Specify a name to identify the action specified.
      For example: Server Restart
    • URL: Specify the URL which would trigger your intented action.
    • HTTP method: Specify the CRUD method used for connecting with the site. Site24x7 supports GET, POST, PUT, PATCH, and DELETE methods.
      POST, PUT, PATCH, and DELETE HTTP submission methods support request sending in JSON format.
    • HTTP request headers: Sometimes you might want to customize the default HTTP request header information. In such cases, the additional header name and header value can be added here.
    • User agent: Set customized user agent (web browser) for sending your request and the HTTP headers. You can choose from the available user agents.
    • Authentication Method: Specify the radio button and update the credentials accordingly.
      • Basic/NTLM CredentialsConfigure your Basic/NTLM based authorization. Windows NTLM is the authentication protocol used on systems running on Windows OS.
        Credentials: Specify your Username and Password for URLs requiring Basic/NTLM based authentication.
      • OAuth: Pick the OAuth radio button, if you're monitoring a resource that is secured by OAuth framework.
        Provider Name: Select the OAuth Provider Name from your preconfigured list or create a new OAuth profile by clicking the + button.
    • Send Incident Parameters: Select this option to enable incident parameters associated to your monitor outage to be passed along with the body of your POST URL. Learn more about Incident Parameters.
      Incident parameters will be passed along with the POST URL, only when there is an actual status change, or attribute change associated with the monitor. No Incident parameters will be sent while executing a Test IT Automation.

    • Send Custom Parameters: Write specific code to pass parameters in the format Param name=value pair for POST and GET HTTP methods. You can POST the request in the JSON format. While passing the Custom Parameter during your HTTP request, you can specify a predefined Global Parameter in the Name or Value field. Global Parameters get substituted with your defined Constant or the actual Dynamic Values in your HTTP response. Custom Parameters should be passed using either of the following syntaxes: 

Custom Parameters syntax when specified in JSON format:

Custom Parameters syntax when not specified in JSON format:

    • Time-out: Enter the time in seconds to determine how long the Site24x7 servers should wait before considering the websites as non-responsive. Enter a time in seconds that is not the usual response time of your website. The Time-out is set at 15 seconds, by default. You can define a time-out between 1-90 seconds.
    • Send the Automaton Result via Email: Share automation results via an email to your user alert group configured in the notification profile.  This email will contain parameters including the automation name, type of automation, incident reason, destination hosts, and more.
      If you've multiple automations executed in one data collection, a consolidated email will be sent.
    • Click Save.

Test the Automation

Once you set up an Invoke URL/REST API, go to the IT Automation Summary page (Admin > IT Automation Templates) and use the  icon for a test run. Read more.

Click on the IT Automation Logs to view the list of automations executed by date.

Passing Incident and Custom Parameters During an Invoke URL/REST API: 

Say, you've defined a set of Global Parameters to be used as your Custom Parameter Name: Value Pairs. Then you've specified your Custom Parameters to be passed in the body of your POSTED URL.


When the Invoke URL/REST API action is executed for your specified monitor status change or attribute change, the following Custom Parameters also gets passed in the URL body. You can find at the bottom of screen shot below that the global parameter value has been substituted with a constant or dynamic value in your HTTP response. Since, this was a Test Invocation, no incident parameters were passed along with your defined Custom Parameters.

However in the below example, the JSON response for the HTTP request clearly highlights and lists the actual Incident Parameters that were passed along with all the Custom Parameter values specified by you. 

 

Map the Automation with Events

For an automation to be executed, map it with the desired event. This can be done in two ways:

A maximum of five automations can be associated per attribute (monitor level and child level).
You can also schedule the automations to  execute them one after the other.
Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help Invoke URL/REST API