Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function sends a Pushbullet™ test message to determine that the token is valid and that the account holder can receive the message.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Pushbullet/send_test_message?access_token=a1b2c3d4e5f6g7h8i9j0

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Send test message to Pushbullet.
$test_pushbullet = $cpanel->uapi(
    'Pushbullet', 'send_test_message',
    array(
        'access_token'       => 'a1b2c3d4e5f6g7h8i9j0',
    )
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Send test message to Pushbullet.
my $test_pushbullet = $cpliveapi->uapi(
    'Pushbullet', 'send_test_message',
    {
        'access_token'       => 'a1b2c3d4e5f6g7h8i9j0',
    }
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Get an array of privileges. -->
[% execute( 'Pushbullet', 'send_test_message', { access_token => 'a1b2c3d4e5f6g7h8i9j0'} ); %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username Pushbullet send_test_message access_token=a1b2c3d4e5f6g7h8i9j0

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ },
   "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)"
      }
   },
}

Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
access_tokenstring

Required

The Pushbullet access token.

A valid Pushbullet access token.

Notes:

  • Your Pushbullet token is available on Pushbullet's My Account page 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.