Skip to content

bsgworld/php-sdk-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BSG API PHP Client

Comprehensive API for sending SMS, Viber messages, HLR/MNP requests and service management

For more information, please visit https://bsg.world.

Installation

composer require bsgworld/php-sdk-v1

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



// Configure API key authorization: ApiKeyAuth
$config = BSG\Api\V1\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BSG\Api\V1\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');


$apiInstance = new BSG\Api\V1\Api\CommonApi(
    // 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
);

try {
    $result = $apiInstance->commonGetBalanceBase();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommonApi->commonGetBalanceBase: ', $e->getMessage(), PHP_EOL;
}

Endpoints

All URIs are relative to https://api.sms-service.local

Class Method HTTP request Description
CommonApi commonGetBalanceBase GET /rest/common/balance Get account balance (basic)
CommonApi commonGetBalanceBasePost POST /rest/common/balance Get account balance (basic) (POST)
CommonApi commonGetBalanceV2 GET /rest/common/getbalance Get account balance (extended)
CommonApi commonGetBalanceV2Post POST /rest/common/getbalance Get account balance (extended) (POST)
CommonApi commonGetPrice GET /rest/common/price Get SMS price
CommonApi commonGetPricePost POST /rest/common/price Get SMS price (POST)
CommonApi commonGetTariff GET /rest/common/tariff Get tariff information
CommonApi commonGetTariffPost POST /rest/common/tariff Get tariff information (POST)
ExportsApi exportsDeleteFile DELETE /rest/exports/file Delete export file
ExportsApi exportsGetFile GET /rest/exports/file Download export file
ExportsApi exportsGetList GET /rest/exports/list List export jobs
ExportsApi exportsRequestExport POST /rest/exports/create Request data export
ExportsApi exportsRequestExportPut PUT /rest/exports/create Request data export (PUT)
HLRApi hlrCreateObjects POST /rest/hlr/create Perform HLR lookup
HLRApi hlrCreateObjectsPut PUT /rest/hlr/create Perform HLR lookup (PUT)
HLRApi hlrCreateObjectsSync POST /rest/hlr/check Perform synchronous HLR lookup
HLRApi hlrCreateObjectsSyncPut PUT /rest/hlr/check Perform synchronous HLR lookup (PUT)
HLRApi hlrGetBalance GET /rest/hlr/balance Get account balance
HLRApi hlrGetBalancePost POST /rest/hlr/balance Get account balance
HLRApi hlrGetPrices GET /rest/hlr/prices Get HLR pricing
HLRApi hlrGetStatusByExtId GET /rest/hlr/reference/{reference} Get HLR result by reference
MNPApi mnpCreateBatchMnp POST /rest/mnp/create MNP lookup for multiple numbers (JSON body)
MNPApi mnpCreateObjectsPut PUT /rest/mnp/create Perform MNP lookup (PUT)
MNPApi mnpGetPrices GET /rest/mnp/prices Get MNP pricing
MNPApi mnpGetStatusByExtId GET /rest/mnp/reference/{reference} Get MNP result by reference
MNPApi mnpGetStatusById GET /rest/mnp/{id} Get MNP result by ID
MNPSyncApi mnpSyncCreateObjects POST /rest/mnp-sync/create Perform synchronous MNP lookup
MNPSyncApi mnpSyncCreateObjectsPut PUT /rest/mnp-sync/create Perform synchronous MNP lookup (PUT)
MNPSyncApi mnpSyncGetPrices GET /rest/mnp-sync/prices Get MNP pricing
SMSApi smsCheckPrice POST /rest/sms/price Check SMS price
SMSApi smsCheckPricePut PUT /rest/sms/price Check SMS price (PUT)
SMSApi smsCreateObjects POST /rest/sms/create Send SMS message
SMSApi smsCreateObjectsPut PUT /rest/sms/create Send SMS message (PUT)
SMSApi smsGet2WayIncoming GET /rest/sms/2wayIncoming Get 2-way incoming messages
SMSApi smsGet2WaySenders GET /rest/sms/2waySenders Get 2-way senders
SMSApi smsGetBalance GET /rest/sms/balance Get account balance
SMSApi smsGetBalancePost POST /rest/sms/balance Get account balance
SMSApi smsGetMassStatus POST /rest/sms/getStatus Get status for multiple SMS messages
SMSApi smsGetPrices GET /rest/sms/prices Get SMS pricing
SMSApi smsGetStatusByExtId GET /rest/sms/reference/{reference} Get SMS status by reference
SMSApi smsGetStatusById GET /rest/sms/{id} Get SMS status by ID
SMSApi smsGetTaskStatus GET /rest/sms/task/{taskId} Get task status
ViberApi viberCheckPrice POST /rest/viber/price Check Viber message price
ViberApi viberCheckPricePut PUT /rest/viber/price Check Viber message price (PUT)
ViberApi viberCreateObjects POST /rest/viber/create Send Viber message
ViberApi viberCreateObjectsPut PUT /rest/viber/create Send Viber message (PUT)
ViberApi viberGetBalance GET /rest/viber/balance Get account balance
ViberApi viberGetBalancePost POST /rest/viber/balance Get account balance
ViberApi viberGetPrices GET /rest/viber/prices Get Viber pricing
ViberApi viberGetStatusByExtId GET /rest/viber/reference/{reference} Get Viber status by reference

Models

Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-API-KEY
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@bsg.world

About this package

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

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

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages