UAPI Functions - Pushbullet::send_test_message

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

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

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

 cPanel Template Toolkit

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

 Command Line

uapi --user=username Pushbullet send_test_message access_token=a1b2c3d4e5f6g7h8i9j0

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 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 (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

Parameter

Type

Description

Possible values

Example

 access_token 

 string 

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

Return

Type

Description

Possible values

Example

 message_id 

 string 

The test message's ID.

A valid string.

 554d2cbd-efe61da3cacb 

payload

hash

 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. 

 

 

 

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....