Child pages
  • WHM API 1 Functions - send_test_pushbullet_note
Skip to end of metadata
Go to start of metadata

 

Description

This function uses the specified access token to send a test Pushbullet™ note.

The function automatically generates a message title and body, and it 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.

You can also review the user's Pushbullet channel history to confirm that the server sent and received the message.

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

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

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/send_test_pushbullet_note?api.version=1&access_token=a1b2c3d4e5f6g7h8i9j0
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/send_test_pushbullet_note?api.version=1&access_token=a1b2c3d4e5f6g7h8i9j0
 Command Line
whmapi1 send_test_pushbullet_note access_token=a1b2c3d4e5f6g7h8i9j0


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "data":{  
      "message_id":"555a3994-173a4a271062d",
      "payload":{  
         "dismissed":false,
         "body":"This message confirms that "hostname.example.com" (192.168.0.20) can send a message to you via Pushbullet.\n\nThis message was sent on Monday, May 18, 2015 at 7:12:20 PM UTC.",
         "receiver_email":"user@example.com",
         "direction":"self",
         "sender_iden":"ujw5ScArtjU",
         "iden":"ujw5ScArtjUsjAeRXXMLGS",
         "sender_name":"Firstname Lastname",
         "active":true,
         "sender_email":"user@example.com",
         "receiver_email_normalized":"user@example.com",
         "modified":1431976341.39182,
         "created":1431976341.38872,
         "sender_email_normalized":"user@example.com",
         "type":"note",
         "receiver_iden":"ujw5ScArtjU",
         "title":"Test message (ID: 555a3994-173a4a271062d)"
      }
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"send_test_pushbullet_note"
   }
}
 Output (XML)
<result>
    <data>
        <message_id>555a3b48-1b167d113be2c</message_id>
        <payload>
            <dismissed>0</dismissed>
            <body>This message confirms that &#x201C;hostname.example.com&#x201D; (192.168.0.20) can send a message to you via Pushbullet.
            
            This message was sent on Monday, May 18, 2015 at 7:19:36 PM UTC.</body>
            <receiver_email>user@example.com</receiver_email>
            <direction>self</direction>
            <sender_iden>ujw5ScArtjU</sender_iden>
            <iden>ujw5ScArtjUsjAzB10eZga</iden>
            <sender_name>Firstname Lastname</sender_name>
            <active>1</active>
            <sender_email>user@example.com</sender_email>
            <receiver_email_normalized>user@example.com</receiver_email_normalized>
            <modified>1431976777.33303</modified>
            <created>1431976777.3299</created>
            <sender_email_normalized>user@example.com</sender_email_normalized>
            <type>note</type>
            <receiver_iden>ujw5ScArtjU</receiver_iden>
            <title>Test message (ID: 555a3b48-1b167d113be2c)</title>
        </payload>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>send_test_pushbullet_note</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
access_tokenstring

Required

The Pushbullet token to use.

A valid Pushbullet token.

Notes:

  • To access your Pushbullet token, navigate to Pushbullet's My Account page. It will appear under the Access Token heading.
  • This is confidential information that your server sends via a secure channel.
a1b2c3d4e5f6g7h8i9j0

Returns

ReturnTypeDescriptionPossible valuesExample
message_idstring

The test message's ID.

A valid string.

554d2cbd-efe61da3cacb
payloadhash

The payload from the Pushbullet server.

 

For more information, visit Pushbullet's API documentation.

Warning:

This return may contain values that are Boolean primitives. JSON properly represents these, but XML represents them as 0 or 1.