Skip to content

Latest commit

 

History

History
114 lines (80 loc) · 4.12 KB

PushApi.md

File metadata and controls

114 lines (80 loc) · 4.12 KB

Chabok\Client\PushApi

All URIs are relative to https://sandbox.push.adpdigital.com/api

Method HTTP request Description
pushByQuery POST /push/byQuery Push a text message to a segment of devices
pushToUsers POST /push/toUsers Push multiple text messages to users

pushByQuery

\Chabok\Client\Model\PushResponse pushByQuery($payload)

Push a text message to a segment of devices

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ApiSecurity,  Get your 'YOUR_API_KEY' from http://sandbox.push.adpdigital.com/front/account/edit 
Chabok\Client\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY');
// Get your 'App_ID' from http://sandbox.push.adpdigital.com/front/account/edit 
Chabok\Client\Configuration::getDefaultConfiguration()->setAppId('App_ID');
// Make Dev mode enable If you want to test your App on Development environment or don't have Chabok premium account
Chabok\Client\Configuration::getDefaultConfiguration()->setDevMode(true);
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Chabok\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer');

$api_instance = new Chabok\Client\Api\PushApi();
$payload = new \Chabok\Client\Model\SegmentPush(); // \Chabok\Client\Model\SegmentPush | 

try {
    $result = $api_instance->pushByQuery($payload);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PushApi->pushByQuery: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
payload \Chabok\Client\Model\SegmentPush

Return type

\Chabok\Client\Model\PushResponse

Authorization

ApiSecurity

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pushToUsers

\Chabok\Client\Model\PushResponse[] pushToUsers($messages)

Push multiple text messages to users

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ApiSecurity,  Get your 'YOUR_API_KEY' from http://sandbox.push.adpdigital.com/front/account/edit 
Chabok\Client\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY');
// Get your 'App_ID' from http://sandbox.push.adpdigital.com/front/account/edit 
Chabok\Client\Configuration::getDefaultConfiguration()->setAppId('App_ID');
// Make Dev mode enable If you want to test your App on Development environment or don't have Chabok premium account
Chabok\Client\Configuration::getDefaultConfiguration()->setDevMode(true);
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Chabok\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer');

$api_instance = new Chabok\Client\Api\PushApi();
$messages = new \Chabok\Client\Model\Push(); // \Chabok\Client\Model\Push | 

try {
    $result = $api_instance->pushToUsers($messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PushApi->pushToUsers: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
messages \Chabok\Client\Model\Push

Return type

\Chabok\Client\Model\PushResponse[]

Authorization

ApiSecurity

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]