PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/Telstra/MessagingAPI-SDK-php.git"
}
],
"require": {
"Telstra/MessagingAPI-SDK-php": "*@master"
}
}
Then run composer install
Download the files and include autoload.php:
require_once('/path/to/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Telstra_Messaging\Api\AuthenticationApi(
// 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()
);
$client_id = 'client_id_example'; // string |
$client_secret = 'client_secret_example'; // string |
$grant_type = 'client_credentials'; // string |
try {
$result = $apiInstance->authToken($client_id, $client_secret, $grant_type);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->authToken: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://tapi.telstra.com/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthenticationApi | undefinedauthTokenundefined | undefinedPOST /oauth/token | Generate OAuth2 token |
| MessagingApi | undefinedgetMMSStatusundefined | undefinedGET /messages/mms/{messageid}/status | Get MMS Status |
| MessagingApi | undefinedgetSMSStatusundefined | undefinedGET /messages/sms/{messageId}/status | Get SMS Status |
| MessagingApi | undefinedretrieveMMSResponsesundefined | undefinedGET /messages/mms | Retrieve MMS Responses |
| MessagingApi | undefinedretrieveSMSResponsesundefined | undefinedGET /messages/sms | Retrieve SMS Responses |
| MessagingApi | undefinedsendMMSundefined | undefinedPOST /messages/mms | Send MMS |
| MessagingApi | undefinedsendSMSundefined | undefinedPOST /messages/sms | Send SMS |
| ProvisioningApi | undefinedcreateSubscriptionundefined | undefinedPOST /messages/provisioning/subscriptions | Create Subscription |
| ProvisioningApi | undefineddeleteSubscriptionundefined | undefinedDELETE /messages/provisioning/subscriptions | Delete Subscription |
| ProvisioningApi | undefinedgetSubscriptionundefined | undefinedGET /messages/provisioning/subscriptions | Get Subscription |