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 


https://hostname.example.com:2083/cpsess##########/execute/Pushbullet/send_test_message?access_token=a1b2c3d4e5f6g7h8i9j0

$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',
    )
);

 

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',
    }
);

 

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

 

uapi --user=username Pushbullet send_test_message access_token=a1b2c3d4e5f6g7h8i9j0

{  
   "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)"
      }
   },
}

   

Parameters

ParameterTypeDescriptionPossible valuesExample
access_tokenstring

Required

The Pushbullet access token.

A valid Pushbullet access token.

  • 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.

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