Download the PHP package callr/sdk-php without Composer
On this page you can find all versions of the php package callr/sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download callr/sdk-php
More information about callr/sdk-php
Files in callr/sdk-php
Package sdk-php
Short Description CALLR PHP SDK for JSON-RPC API
License MIT
Homepage https://github.com/THECALLR/sdk-php
Informations about the package sdk-php
PHP SDK for CALLR API
JSON-RPC 2.0 PHP class, to use with CALLR API.
- API documentation: http://www.callr.com/docs/
- SDK Installation guide: see INSTALLING.php.md
- Example projects: https://github.com/THECALLR/examples-php
-
JSON-RPC 2.0 Specification: http://www.jsonrpc.org/specification
- Easy to use Client class, built for PHP 5.4+
- Can be used for both the API and Real-time calls
- Requires:
php5-curl
Composer
You should use Composer (https://getcomposer.org/) to manage your PHP dependencies.
If you do not have a composer.json
file yet, create one at the root of your project, download Composer, and launch composer update
.
The composer.json
file should look like this:
Add all the libraries you need in composer.json
. Do not forget to run composer update
each time you edit the file.
Then you just need to include one file in your code:
Usage
Init
Login-as
If you want to log in as another sub-customer or sub-user (one you have access
to), you can call the logAs
method on the chosen authenticator :
Available authenticators are the classic login / password (sent through a BASIC http request) or the Api-Key. Both supports the Login-As feature.
Sending SMS
Without options
Method
Personalized sender
Your sender must have been authorized and respect the sms_sender format
Method
If you want to receive replies, do not set a sender - we will automatically use an SMS number
Method
Force GSM encoding
The default behaviour is to send your SMS with GSM 7-bit encoding. However, if your text contains a character that is not in the GSM 7-bit charset (Basic Character Set), we will send it as 16-bit UCS-2 (UNICODE) - using 2 bytes per character.
You can however force the encoding to be used at any time, using the force_encoding property.
If you force a GSM encoding, we will try to convert non-GSM characters to GSM ones. « becomes ", € becomes e, etc. The full mapping is available when calling the method sms.get_gsm_charset_mapping.
Please note that whatever the encoding forced or used, you always send your text as a JSON string to our API, without any special processing. The charset is applied in our platform before sending to the carriers.
Method
Objects
Long SMS (availability depends on carrier)
We automatically handle concatenated SMS. The number of SMS parts billed will be set on the parts property of the SMS object. The object can be sent to you using Webhooks.
If your SMS is GSM 7-bit encoded:
- If it's equals or less than 160 characters, it counts as 1 SMS.
- If it's more than 160 characters, the split is done every 153 characters.
If your SMS is UNICODE encoded:
- If it's equals or less than 70 characeters, it counts as 1 SMS.
- If it's more than 70 characters, the split is done every 67 characters.
Method
Specify your SMS nature (alerting or marketing)
Method
Objects
Custom data
Method
Objects
Delivery Notification - set URL to receive notifications
To receive delivery notifications (DLR), you have to subscribe to the webhook sms.mt.status_update (see below).
Method
Inbound SMS - set URL to receive inbound messages (MO) and replies
Do not set a sender if you want to receive replies - we will automatically use an SMS number.
To receive inbound messages (MO), you have to subscribe to the webhook sms.mo (see below).
Method
Get an SMS
Method
Objects
Webhooks
See our online documentation: http://www.callr.com/docs/webhooks/
Subscribe to webhooks
Method
Objects
List available webhooks
Method
REALTIME
Create a REALTIME app with a callback URL
App name format
Method
Objects
Start a REALTIME outbound call
Method
Objects
Inbound Calls - Assign a phone number to a REALTIME app
Method
Objects
DIDs
List available countries with DID availability
Method
Objects
Get area codes available for a specific country and DID type
Method
Objects
Get DID types available for a specific country
Method
Objects
Buy a DID (after a reserve)
Method
Objects
Cancel your order (after a reserve)
Method
Cancel a DID subscription
Method
View your store quota status
Method
Objects
Get a quote without reserving a DID
Method
*Objects/
Reserve a DID
Method
Objects
View your order
Method
Objects
Conferencing
Create a conference room
Method
Objects
Assign a DID to a room
Method
Create a PIN protected conference room
Method
Objects
Call a room access
Method
Media
List your medias
Method
Create an empty media
Method
Upload/Import a media
Method
Use Text-to-Speech
Method
CDR
Get inbound or outbound CDRs
Method
Objects
Broadcast messages to a target
Without options
Method
Objects
All versions of sdk-php with dependencies
ext-curl Version *
ext-json Version *