Skip to content

Latest commit

 

History

History
147 lines (104 loc) · 4.22 KB

File metadata and controls

147 lines (104 loc) · 4.22 KB

BSG\Api\V2\CampaignRCSApi

All URIs are relative to https://one-api.bsg.world, except if the operation defines another base path.

Method HTTP request Description
rcsSend() POST /api/campaigns/rcs/send Send RCS message
rcsSendGroups() POST /api/campaigns/rcs/send-groups Send RCS message to contact list

rcsSend()

rcsSend($send_rcs_campaign): \BSG\Api\V2\Model\RcsSend200Response

Send RCS message

This method provides the ability to send a single rcs message or to send a mass rcs message. It also supports sending messages via an alternative SMS channel if the rcs can’t be delivered

Example

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


// Configure Bearer (JWT) authorization: ExternalAuth
$config = BSG\Api\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new BSG\Api\V2\Api\CampaignRCSApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$send_rcs_campaign = new \BSG\Api\V2\Model\SendRcsCampaign([
    'phones' => [
        0 => [
            'number' => '380661231231',
        ],
    ],
    'sender' => 'rcs_sender',
    'options' => [
        'text' => 'Hello! ☺️',
    ],
]);
try {
    $result = $apiInstance->rcsSend($send_rcs_campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignRCSApi->rcsSend: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
send_rcs_campaign \BSG\Api\V2\Model\SendRcsCampaign

Return type

\BSG\Api\V2\Model\RcsSend200Response

Authorization

ExternalAuth

HTTP request headers

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

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

rcsSendGroups()

rcsSendGroups($send_rcs_campaign_groups): \BSG\Api\V2\Model\RcsSendGroups200Response

Send RCS message to contact list

The method provides the ability to send rcs messages to a group of contacts (the group ID is created in the client’s contact book). The ability to send messages via an alternative SMS channel is also supported

Example

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


// Configure Bearer (JWT) authorization: ExternalAuth
$config = BSG\Api\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new BSG\Api\V2\Api\CampaignRCSApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$send_rcs_campaign_groups = new \BSG\Api\V2\Model\SendRcsCampaignGroups([
    'groups' => [
        0 => 1864275,
    ],
    'sender' => 'rcs_sender',
    'options' => [
        'text' => 'Hello! ☺️',
    ],
]);
try {
    $result = $apiInstance->rcsSendGroups($send_rcs_campaign_groups);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignRCSApi->rcsSendGroups: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
send_rcs_campaign_groups \BSG\Api\V2\Model\SendRcsCampaignGroups

Return type

\BSG\Api\V2\Model\RcsSendGroups200Response

Authorization

ExternalAuth

HTTP request headers

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

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