Skip to content

telstra/MessagingAPI-SDK-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Messaging SDK

  • API version: 2.2.9
  • Package version: 1.0.6

Requirements

PHP 5.5 and later

Installation & Usage

Composer

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

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

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;
}

?>

Documentation for API Endpoints

All URIs are relative to https://tapi.telstra.com/v2

Class Method HTTP request Description
AuthenticationApi authToken POST /oauth/token Generate OAuth2 token
MessagingApi getMMSStatus GET /messages/mms/{messageid}/status Get MMS Status
MessagingApi getSMSStatus GET /messages/sms/{messageId}/status Get SMS Status
MessagingApi retrieveMMSResponses GET /messages/mms Retrieve MMS Responses
MessagingApi retrieveSMSResponses GET /messages/sms Retrieve SMS Responses
MessagingApi sendMMS POST /messages/mms Send MMS
MessagingApi sendSMS POST /messages/sms Send SMS
ProvisioningApi createSubscription POST /messages/provisioning/subscriptions Create Subscription
ProvisioningApi deleteSubscription DELETE /messages/provisioning/subscriptions Delete Subscription
ProvisioningApi getSubscription GET /messages/provisioning/subscriptions Get Subscription

Documentation For Models

Documentation For Authorisation

auth

  • Type: OAuth
  • Flow: application
  • Authorisation URL:
  • Scopes:
  • NSMS: NSMS

Author