1. Go to this page and download the library: Download inmobile/inmobile-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
inmobile / inmobile-sdk example snippets
/*
* Require autoload, to automatically load the SDK, after installing via composer.
* Execute the following command now, if you haven't already: composer the Inmobile API Client
*/
$api = new InmobileApi('my-api-token');
/*
* Send the message
*/
$response = $api->messages()->send(
Message::create('This is a message text to be sent')
->from('1245')
->to('4512345678')
);
$response->toArray();
/**
* "results": [
* {
* "numberDetails": {
* "countryCode": "45",
* "phoneNumber": "12345678",
* "rawMsisdn": "45 12 34 56 78",
* "isValidMsisdn": true,
* "isAnonymized": false
* },
* "text": "This is a message text to be sent",
* "from": "1245",
* "smsCount": 1,
* "messageId": "INMBL",
* "encoding": "gsm7"
* }
* ]
*/
$api->tools()->numbersToParse([
NumberToParse::create($countryHint = 'DK', $rawMsisdn = '12 34 56 78')
NumberToParse::create($countryHint = '45', $rawMsisdn = '12 34 56 78')
]);
// If you wish to parse a single number, you can do so by passing a single NumberToParse object
$api->tools()->numbersToParse(NumberToParse::create($countryHint = 'DK', $rawMsisdn = '12 34 56 78'));