Description

This function uses the specified URL to send a test message through the POST method of HTTP as form data.

The function automatically generates a message title and body and includes a unique string in the test message. When the test message returns, the system searches for the ID string and returns it.

If the function does not detect the correct ID string in the returned message, the function fails.

The test's success or failure depends on various conditions. For example:

  • Valid access token.
  • Network configuration.
  • Service outages.
  • External server rate limit.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/send_test_posturl?api.version=1&url=https%3A%2F%2Fwww.example.com%2Fevents.cgi%3Fapikey%3D12345%26user%3Dusername*password%3D12345luggage
https://hostname.example.com:2087/cpsess##########/xml-api/send_test_posturl?api.version=1&url=https%3A%2F%2Fwww.example.com%2Fevents.cgi%3Fapikey%3D12345%26user%3Dusername*password%3D12345luggage
whmapi1 send_test_posturl url=https%3A%2F%2Fwww.example.com%2Fevents.cgi%3Fapikey%3D12345%26user%3Dusername*password%3D12345luggage

{  
   "data":{  
      "message_id":"555a3994-173a4a271062d"
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"send_test_posturl"
   }
}
<result>
    <data>
        <message_id>555a3b48-1b167d113be2c</message_id>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>send_test_posturl</command>
    </metadata>
</result>

   

Parameters

ParameterTypeDescriptionPossible valuesExample
urlstring

Required

The URL and query string to send.

A valid URL in uuencoded format.

The system automatically sends the parameter's hostname, subject, and body with the relevant data from the alert.

  • To send additional parameters, include those keys after the URL. For example, to send the apikey parameter with a value of XXXXX, append ?apikey=XXXXX to the URL.
  • To add additional parameters and values, separate those additional values with the ampersand character ( & ) instead of the question mark character ( ? ). For example, to include a state parameter of Texas and a status parameter of CRITICAL, append ?apikey=XXXXX&state=Texas&status=CRITICAL to the URL.
  • If you enter a secure URL (https://), that site's certificate must be valid.

https%3A%2F%2Fwww.example.com%2Fevents.cgi%3Fapikey%3D12345%26user%3Dusername*password%3D12345luggage

Returns

ReturnTypeDescriptionPossible valuesExample
message_idstring

The test message's ID.

A valid string.

554d2cbd-efe61da3cacb