Child pages
  • WHM API 1 Functions - send_test_pushbullet_note

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

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.
Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/send_test_pushbullet_note?api.version=1&access_token=a1b2c3d4e5f6g7h8i9j0
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/send_test_pushbullet_note?api.version=1&access_token=a1b2c3d4e5f6g7h8i9j0
Expand
titleCommand Line
Code Block
languagebash
whmapi1 send_test_pushbullet_note access_token=a1b2c3d4e5f6g7h8i9j0

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{  
   "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"
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<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>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

   

Parameters

ParameterTypeDescriptionPossible valuesExample
access_tokenstring

Required

The Pushbullet token to use.

A valid Pushbullet token.

Note
titleNotes:
  • 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
titleWarning:

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