dansleboby / ubity-sdk-php
The Ubity API SDK allows you to initiate calls, send text messages (SMS), retrieve call recordings, get a user's phone presence status, and a whole lot more.
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2025-03-16 17:48:20 UTC
README
This SDK is not supported by Ubity!
API doc
- Swagger: https://generator.swagger.io/?url=https://raw.githubusercontent.com/dansleboby/ubity-sdk-php/master/swagger.json
- Original: https://doc-api-mtl.ubity.com/
SwaggerClient-php
The Ubity API allows you to initiate calls, send text messages (SMS), retrieve call recordings, get a user's phone presence status, and a whole lot more.
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
Then run composer require dansleboby/ubity-sdk-php "~1.0"
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: apiKey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); $apiInstance = new Swagger\Client\Api\CallsApi( // 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 ); $body = new \Swagger\Client\Model\AnsweringCallRequest(); // \Swagger\Client\Model\AnsweringCallRequest | try { $result = $apiInstance->callAnswerPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CallsApi->callAnswerPost: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiKey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); $apiInstance = new Swagger\Client\Api\CallsApi( // 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 ); $body = new \Swagger\Client\Model\HangupCallRequest(); // \Swagger\Client\Model\HangupCallRequest | try { $result = $apiInstance->callHangupPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CallsApi->callHangupPost: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiKey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); $apiInstance = new Swagger\Client\Api\CallsApi( // 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 ); $body = new \Swagger\Client\Model\CallRequest(); // \Swagger\Client\Model\CallRequest | try { $result = $apiInstance->callPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CallsApi->callPost: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiKey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); $apiInstance = new Swagger\Client\Api\CallsApi( // 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 ); $body = new \Swagger\Client\Model\SendCallVoiceMailRequest(); // \Swagger\Client\Model\SendCallVoiceMailRequest | try { $result = $apiInstance->callSendToVoicemailPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CallsApi->callSendToVoicemailPost: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiKey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer'); $apiInstance = new Swagger\Client\Api\CallsApi( // 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 ); $body = new \Swagger\Client\Model\RunningCallRequest(); // \Swagger\Client\Model\RunningCallRequest | try { $result = $apiInstance->callsPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CallsApi->callsPost: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://api.ubity.com
Class | Method | HTTP request | Description |
---|---|---|---|
CallsApi | callAnswerPost | POST /call_answer | Answering a call |
CallsApi | callHangupPost | POST /call_hangup | Hangup a call |
CallsApi | callPost | POST /call | Initiate an outgoing call on behalf of a user. |
CallsApi | callSendToVoicemailPost | POST /call_send_to_voicemail | Send a call to voicemail (while ringing) |
CallsApi | callsPost | POST /calls | List running calls |
ExtensionsApi | extensionsGet | GET /extensions | Get extensions list |
RecordingsApi | recordingPost | POST /recording | Get a specific call recording from and ID |
RecordingsApi | recordingsGet | GET /recordings | Get recordings list |
RecordingsApi | recordingsYearGet | GET /recordings/{year} | Get recordings list for specific year |
RecordingsApi | recordingsYearMonthDayOutGet | GET /recordings/{year}/{month}/{day}/out | Get recordings list for specific for a day (with mp3) |
RecordingsApi | recordingsYearMonthGet | GET /recordings/{year}/{month} | Get recordings list for a specific month |
SmsApi | smsPost | POST /sms | Text Messages (SMS) |
SmsApi | smsSendGet | GET /sms/send | Text Messages (SMS) |
Documentation For Models
- AnsweringCallRequest
- AnsweringCallResponse
- Call
- CallRequest
- Extension
- ExtensionsList
- HangupCallRequest
- HangupCallResponse
- RecordingList
- RecordingsResponse
- RunningCall
- RunningCallCalls
- RunningCallRequest
- SendCallVoiceMailRequest
- SendCallVoiceMailResponse
- SmsRequest
- SmsResponse
- SmsResponseSms
- SpecificRecordingRequest
- UnAuthorized
Documentation For Authorization
apiKey
- Type: API key
- API key parameter name: key
- Location: URL query string
TODO
- Unit test
Author
API: dev@ubity.com SDK: gpaquin@sigp.ca