freeclimbapi / php-sdk
FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the
Requires
- php: ^7.3 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
- dev-master
- 4.6.0
- 4.5.0
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.0
- 3.2.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 1.1.3
- 1.1.2
- 1.0.1
- dev-VCSWP-23198
- dev-VCSWP-19122
- dev-VCSWP-22702-regen
- dev-VCSWP-22703
- dev-VCSWP-22718
- dev-VCSWP-22535
- dev-VCSWP-21889
- dev-VCSWP-19764
- dev-VCSWP-20372
- dev-VCSWP-20273
- dev-VCSWP-20150
- dev-VCSWP-19961
- dev-VCSWP-18414
- dev-VCSWP-19571
- dev-VCSWP-19258-feature
- dev-VCSWP-19521
- dev-VCSWP-19101
- dev-VCSWP-19258
- dev-VCSWP-19213-changelog-update
- dev-VCSWP-19213
- dev-VCSWP-18905
- dev-VCSWP-18939
- dev-VCSWP-18112
- dev-VCSWP-17763
- dev-ngarg-vail-patch-1
- dev-VCSWP-16885
- dev-VCSWP-16072
- dev-VCSWP-15725
- dev-VCSWP-14055-signing-secrets
This package is auto-updated.
Last update: 2024-10-22 13:33:33 UTC
README
FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
For more information, please visit https://www.freeclimb.com/support/.
Installation & Usage
Requirements
PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.
Composer
To install the bindings via Composer, add the following to composer.json
:
{ "repositories": [ { "type": "vcs", "url": "https://https://github.com/freeclimbapi/php-sdk.git" } ], "require": { "freeclimbapi/php-sdk": "*@dev" } }
Then run composer install
Manual Installation
Download the files and include autoload.php
:
<?php require_once('/path/to/FreeClimbAPI/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure HTTP basic authorization: fc $config = FreeClimb\Api\Configuration::getDefaultConfiguration() ->setUsername('YOUR_ACCOUNT_ID') ->setPassword('YOUR_API_KEY'); $apiInstance = new FreeClimb\Api\Api\DefaultApi( // 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 ); $buy_incoming_number_request = new \FreeClimb\Api\Model\BuyIncomingNumberRequest(); // \FreeClimb\Api\Model\BuyIncomingNumberRequest | Incoming Number transaction details try { $result = $apiInstance->buyAPhoneNumber($buy_incoming_number_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->buyAPhoneNumber: ', $e->getMessage(), PHP_EOL; }
Using PerCL
The PerclScript class provides a convenient wrapper to handle PerCL generation in your responses. Simply execute json_encode
with an instance of the PerclScript
class and you will have PerclCommands
serialized and formatted the way you need.
<?php require_once(__DIR__ . '/vendor/autoload.php'); $say = new \FreeClimb\Api\Model\Say(); $sms = new \FreeClimb\Api\Model\Sms(); $script = new \FreeClimb\Api\Model\PerclScript(); $say->setText("hello world"); $sms->setFrom("from number"); $sms->setTo("to number"); $sms->setText("hello world SMS"); $script->setCommands(array($say, $sms)); json_encode($script); /** * [ * { * "Say": { * "text": "hello world" * } * }, * { * "Sms": { * "from": "from number", * "to": "to number", * "text": "hello world SMS" * } * } * ] */ ?>
API Endpoints
All URIs are relative to https://www.freeclimb.com/apiserver
Models
- AccountRequest
- AccountResult
- AccountResultAllOf
- AccountStatus
- AccountType
- AddToConference
- AddToConferenceAllOf
- AnsweredBy
- ApplicationList
- ApplicationListAllOf
- ApplicationRequest
- ApplicationResult
- ApplicationResultAllOf
- AvailableNumber
- AvailableNumberList
- AvailableNumberListAllOf
- BuyIncomingNumberRequest
- CallDirection
- CallList
- CallListAllOf
- CallResult
- CallResultAllOf
- CallStatus
- Capabilities
- CompletionRequest
- CompletionResult
- ConferenceList
- ConferenceListAllOf
- ConferenceParticipantList
- ConferenceParticipantListAllOf
- ConferenceParticipantResult
- ConferenceParticipantResultAllOf
- ConferenceResult
- ConferenceResultAllOf
- ConferenceStatus
- CreateConference
- CreateConferenceAllOf
- CreateConferenceRequest
- CreateWebRTCToken
- Dequeue
- Enqueue
- EnqueueAllOf
- FilterLogsRequest
- GetDigits
- GetDigitsAllOf
- GetSpeech
- GetSpeechAllOf
- GetSpeechReason
- GrammarFileBuiltIn
- GrammarType
- Hangup
- HangupAllOf
- IfMachine
- IncomingNumberList
- IncomingNumberListAllOf
- IncomingNumberRequest
- IncomingNumberResult
- IncomingNumberResultAllOf
- Language
- LogLevel
- LogList
- LogListAllOf
- LogResult
- MachineType
- MakeCallRequest
- MessageDirection
- MessageRequest
- MessageRequestAllOf
- MessageResult
- MessageResultAllOf
- MessageStatus
- MessagesList
- MessagesListAllOf
- MutableResourceModel
- OutDial
- OutDialAllOf
- PaginationModel
- Park
- ParkAllOf
- Pause
- PauseAllOf
- PerclCommand
- PerclScript
- Play
- PlayAllOf
- PlayBeep
- PlayEarlyMedia
- PlayEarlyMediaAllOf
- QueueList
- QueueListAllOf
- QueueMember
- QueueMemberList
- QueueMemberListAllOf
- QueueRequest
- QueueResult
- QueueResultAllOf
- QueueResultStatus
- RecordUtterance
- RecordUtteranceAllOf
- RecordUtteranceTermReason
- RecordingList
- RecordingListAllOf
- RecordingResult
- RecordingResultAllOf
- Redirect
- RedirectAllOf
- Reject
- RejectAllOf
- RemoveFromConference
- RequestType
- SMSTenDLCBrand
- SMSTenDLCBrandsListResult
- SMSTenDLCBrandsListResultAllOf
- SMSTenDLCCampaign
- SMSTenDLCCampaignsListResult
- SMSTenDLCCampaignsListResultAllOf
- SMSTenDLCPartnerCampaign
- SMSTenDLCPartnerCampaignBrand
- SMSTenDLCPartnerCampaignsListResult
- SMSTenDLCPartnerCampaignsListResultAllOf
- SMSTollFreeCampaign
- SMSTollFreeCampaignsListResult
- SMSTollFreeCampaignsListResultAllOf
- Say
- SayAllOf
- SendDigits
- SendDigitsAllOf
- SetListen
- SetListenAllOf
- SetTalk
- SetTalkAllOf
- Sms
- SmsAllOf
- StartRecordCall
- TFN
- TerminateConference
- TranscribeUtterance
- TranscribeUtteranceAllOf
- TranscribeUtteranceAllOfRecord
- Unpark
- UpdateCallRequest
- UpdateCallRequestStatus
- UpdateConferenceParticipantRequest
- UpdateConferenceRequest
- UpdateConferenceRequestStatus
Authorization
fc
- Type: HTTP basic authentication
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Documentation for verifying request signature
-
To verify the request signature, we will need to use the verifyRequestSignature method within the Request Verifier class
RequestVerifier::verifyRequestSignature($requestBody, $requestHeader, $signingSecret, $tolerance);
This is a method that you can call directly from the request verifier class, it will throw exceptions depending on whether all parts of the request signature is valid otherwise it will throw a specific error message depending on which request signature part is causing issues
This method requires a requestBody of type string, a requestHeader of type string, a signingSecret of type string, and a tolerance value of type int
Example code down below
<?php namespace FreeClimb\Example; use FreeClimb\Api\Util\RequestVerifier; class Example { public function verifyRequestSignatureExample() { $tolerance = 5 * 60; $requestHeader = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8"; $requestBody = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}"; $signingSecret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7794"; RequestVerifier::verifyRequestSignature($requestBody, $requestHeader, $signingSecret, $tolerance); } }
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.0.0
- Package version:
4.6.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen