Download the PHP package ringcentral/ringcentral-php without Composer
On this page you can find all versions of the php package ringcentral/ringcentral-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ringcentral/ringcentral-php
More information about ringcentral/ringcentral-php
Files in ringcentral/ringcentral-php
Package ringcentral-php
Short Description RingCentral Platform PHP SDK
License MIT
Homepage http://developers.ringcentral.com
Informations about the package ringcentral-php
RingCentral SDK for PHP
RingCentral Developers is a cloud communications platform which can be accessed via more than 70 APIs. The platform's main capabilities include technologies that enable: Voice, SMS/MMS, Fax, Glip Team Messaging, Data and Configurations.
Additional resources
- RingCentral API Reference - an interactive reference for the RingCentral API that allows developers to make API calls with no code.
- Document - an interactive reference for the SDK code documentation.
Requirements
- PHP 7.2+
- CURL extension
- MCrypt extension
Installation
Please choose one of the following installation options:
With Composer (recommended)
The installation of composer is local by default. We suggest that you install it at the top level of your application's directory structure.
-
Install composer:
More info about installation on Linux / Unix / OSX and Windows.
-
Run the Composer command to install the latest version of SDK:
- Require Composer's autoloader in your PHP script (assuming it is in the same directory where you installed Composer):
PHAR with bundled dependencies
This is not recommended! Use Composer as modern way of working with PHP packages.
-
Download PHAR file
- Require files:
Please keep in mind that bundled dependencies may interfere with your other dependencies.
Basic Usage
Initialization
You also may supply custom AppName and AppVersion parameters with your application codename and version. These parameters are optional but they will help a lot to identify your application in API logs and speed up any potential troubleshooting. Allowed characters for AppName and AppVersion are: letters, digits, hyphen, dot and underscore.
For production use RingCentral\SDK\SDK::SERVER_PRODUCTION
constant. Or type in the server URL by hand.
Authentication
Check authentication status:
Authenticate user with jwt:
Authenticate user with authorization code:
Authentication lifecycle
Platform class performs token refresh procedure if needed. You can save authentication between requests in CGI mode:
Important! You have to manually maintain synchronization of SDK's between requests if you share authentication. When two simultaneous requests will perform refresh, only one will succeed. One of the solutions would be to have semaphor and pause other pending requests while one of them is performing refresh.
Performing API call
Multipart response
Loading of multiple comma-separated IDs will result in HTTP 207 with Content-Type: multipart/mixed
. This response will
be parsed into multiple sub-responses:
Send SMS - Make POST request
Get Platform error message
How to debug HTTP
You can set up any HTTPS sniffer (e.g. proxy server, like Charles) and route SDK traffic to it by providing a custom Guzzle Client instance:
Subscriptions
Webhook Subscriptions
When webhook subscription is created, it will send a request with validation-token
in headers to webhook address. Webhook address should return a success request with validation-token
in headers to finish webhook register.
WebSocket Subscriptions
We need to create websocket connection before creating subscription. When websocket connection get error, need to re-created websocket and subscription manually.
PubNub Subscriptions
This is deprecated, please use WebSocket Subscription.
Please keep in mind that due to limitations of the PubNub library, which is synchronous, subscriptions may expire and must be re-created manually.
Multipart Requests
SDK provides a helper to make sending of faxes easier.
How to demo?
Clone the repo and create a file demo/_credentials.php
copy the contents from the file 'demo/_credentialsSample.php' as shown below:
Then execute:
Should output:
After that script will wait for any presence notification. Make a call to your account or make outbound call from your account. When you will make a call, script will print notification and exit.
Please take a look in demo
folder to see all the demos.
All versions of ringcentral-php with dependencies
ext-json Version *
php Version >=7.2
guzzlehttp/psr7 Version ^2.1.0
pubnub/pubnub Version ^4.7.0|^6.0
symfony/event-dispatcher Version ^2|^3|^4|^5|^6
guzzlehttp/guzzle Version ^6.3.3|^7.4.1
ratchet/pawl Version ^0.4.1