bsg/php-sdk

BSG One-API SDK for SMS, Viber, RCS, WhatsApp and messaging services

Maintainers

Package info

github.com/bsgworld/php-sdk

Homepage

pkg:composer/bsg/php-sdk

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.8 2026-03-20 01:17 UTC

This package is auto-updated.

Last update: 2026-03-20 01:22:06 UTC


README

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Installation

composer require bsgworld/php-sdk

Requirements

  • PHP 7.4 or later
  • Guzzle HTTP client (installed automatically)

Getting Started

Please follow the installation procedure and then run the following:

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



$apiInstance = new BSG\Api\V2\Api\AuthApi(
    // 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()
);
$login_request = new \BSG\Api\V2\Model\LoginRequest([
    'api_key' => 'live_XXXXXXXXXXXXXXXXXXXX',
]);
try {
    $result = $apiInstance->login($login_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthApi->login: ', $e->getMessage(), PHP_EOL;
}

$token = $result->getBearer();

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


$apiInstance = new BSG\Api\V2\Api\CampaignSMSApi(
    // 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
);
$sms_send_request = new \BSG\Api\V2\Model\SmsSendRequest([
    'phones' => [
        0 => [
            'number' => 380661231231,
        ],
    ],
    'sender' => 'Vet klinika',
    'text' => 'test',
]);
try {
    $result = $apiInstance->smsSend($sms_send_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignSMSApi->smsSend: ', $e->getMessage(), PHP_EOL;
}

Endpoints

All URIs are relative to https://one-api.bsg.world

Class Method HTTP request Description
AccountSettingsApi getSettingsAddressBookFieldsById GET /api/settings/address-book-fields/{id} Get settings value
AuthApi login POST /api/auth/login Receive JWT token
AuthApi refreshToken POST /api/auth/refresh Refresh JWT token
BalanceApi accountBalance GET /api/accounts/balance Get balance
BalanceApi accountTariffs GET /api/accounts/tariff Get tariffs
CampaignApi campaign GET /api/campaigns/{id} Get campaign info
CampaignApi campaignDetails GET /api/campaigns/{id}/detail Get campaign details
CampaignApi campaignPrice POST /api/campaigns/price Calculate campaign price
CampaignApi campaignSend POST /api/campaigns/send Send campaign
CampaignApi campaignStop PATCH /api/campaigns/{id}/stop Cancel campaign
CampaignApi campaigns GET /api/campaigns List of campaigns
CampaignRCSApi rcsSend POST /api/campaigns/rcs/send Send RCS message
CampaignRCSApi rcsSendGroups POST /api/campaigns/rcs/send-groups Send RCS message to contact list
CampaignSMSApi smsSend POST /api/campaigns/sms/send Send SMS campaign
CampaignSMSApi smsSendGroups POST /api/campaigns/sms/send-groups Send SMS to contact list
CampaignSMSApi smsSendIndividual POST /api/campaigns/sms/send-individual Send SMS with different text
CampaignViberApi viberSend POST /api/campaigns/viber/send Send Viber campaign
CampaignWhatsAppApi postCampaignsWhatsappSend POST /api/campaigns/whatsapp/send Send WhatsApp campaign
ContactApi contact GET /api/contacts/{id} Get contact by ID
ContactApi contactCreate POST /api/contacts Create a contact
ContactApi contactDelete DELETE /api/contacts/{id} Delete contact
ContactApi contactUpdate PUT /api/contacts/{id} Update contact
ContactApi contacts GET /api/contacts List of contacts
ContactApi contactsDelete POST /api/contacts/delete Delete multiple contacts
ContactApi contactsSearch GET /api/contacts/search Search contacts
ContactFieldApi contactFieldCreate POST /api/contacts/fields Create contact field
ContactFieldApi contactFieldUpdate PATCH /api/contacts/fields/{id} Update contact field
ContactFieldApi contactFields GET /api/contacts/fields List of contact fields
ContactFieldApi postContactsFieldsDelete POST /api/contacts/fields/delete Delete contact fields by ids
ContactListApi contactList GET /api/groups/{id} Get list by id
ContactListApi contactListAttach POST /api/groups/attach Add contacts to the list
ContactListApi contactListCreate POST /api/groups Create list
ContactListApi contactListDelete DELETE /api/groups/{id} Delete list
ContactListApi contactListDetach POST /api/groups/detach Remove contacts from the list
ContactListApi contactListSearch GET /api/groups/search Search list
ContactListApi contactListUpdate PUT /api/groups/{id} Update list
ContactListApi contactLists GET /api/groups List of contact lists
EmailApi emailSend POST /api/email/send-emails Send Email
EmailApi emailTemplateSend POST /api/email/send-template-emails Send Email template
MessageRCSApi rcsSingle POST /api/messages/rcs/send Send single RCS message
MessagesApi sendMessage POST /api/messages/send Send single message
MessagesSMSApi getMessages GET /api/messages Find messages
MessagesWhatsAppApi whatsappSingle POST /api/messages/whatsapp/send Send single WhatsApp message
SendersApi senderRequestLegal POST /api/senders/requests/legal Sender registration by a legal entity
SendersApi senderRequestNatural POST /api/senders/requests/natural Sender registration by an individual
SendersApi senderRequests GET /api/senders/requests/sms List of Sender Requests
SendersApi senders GET /api/senders List of Senders
ShortDomainsApi shortUrlsDomain GET /api/short-url/domains/{uuid} Get domain by uuid
ShortDomainsApi shortUrlsDomainCreate POST /api/short-url/domains Add domain
ShortDomainsApi shortUrlsDomainRemove DELETE /api/short-url/domains/{uuid} Remove domain
ShortDomainsApi shortUrlsDomainUpdate PUT /api/short-url/domains/{uuid} Update domain
ShortDomainsApi shortUrlsDomains GET /api/short-url/domains List of domains
ShortLinksApi shortUrlsClicks GET /api/short-url/clicks List of clicks
ShortLinksApi shortUrlsLink GET /api/short-url/links/{uuid}/statistics Get short link statistic
ShortLinksApi shortUrlsLinkCreate POST /api/short-url/links Create short link
ShortLinksApi shortUrlsLinkDelete DELETE /api/short-url/links/{uuid} Remove short link
ShortLinksApi shortUrlsLinkUpdate PUT /api/short-url/links/{uuid} Update short link
ShortLinksApi shortUrlsLinks GET /api/short-url/links List of short links
StatisticApi statJobsCreate POST /api/stat/jobs Create new job
StatisticApi statJobsDelete DELETE /api/stat/jobs/{id} Delete job result
StatisticApi statJobsList GET /api/stat/jobs List statistic jobs
StatisticApi statJobsShow GET /api/stat/jobs/{id} Load job result
StopListApi stoplistAdd POST /api/stoplist/attach Add contacts to stop list
StopListApi stoplistItems GET /api/stoplist List the contacts of stop lists
StopListApi stoplistRemove POST /api/stoplist/detach Remove contacts from stop list
StopListApi stoplistSearch GET /api/stoplist/search Search contacts in Stop lists
TwoFAOTPApi cancelOtp POST /api/2fa/authentications/{id}/cancel Cancel the authentication session
TwoFAOTPApi otpList GET /api/2fa/authentications List of authentication sessions
TwoFAOTPApi resendOtp POST /api/2fa/authentications/otp/{id}/resend Resend the one-time code
TwoFAOTPApi sendOtp POST /api/2fa/authentications/otp Send One-time password
TwoFAOTPApi statusOtp GET /api/2fa/authentications/{id} Check authentication status
TwoFAOTPApi verifyOtp POST /api/2fa/authentications/otp/{id}/verify Check one-time Code
TwoFATemplatesApi otpTemplate GET /api/2fa/authentications/templates/{templateId} Get message template
TwoFATemplatesApi otpTemplateCreate POST /api/2fa/authentications/templates Create a message template
TwoFATemplatesApi otpTemplateDelete DELETE /api/2fa/authentications/templates/{templateId} Delete a message template
TwoFATemplatesApi otpTemplateList GET /api/2fa/authentications/templates List of message templates

Models

Authorization

Authentication schemes defined for the API:

ExternalAuth

  • Type: Bearer authentication (JWT)

InternalAuth

  • Type: Bearer authentication (JWT)

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0
    • Generator version: 7.12.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen