Code Monkey home page Code Monkey logo

messagingapi-sdk-php's Introduction

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

messagingapi-sdk-php's People

Contributors

developersteve avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

messagingapi-sdk-php's Issues

MessagingApi getSMSStatus blank response

Doing a call do getSMSStatus with a valid message id returns a blank class.

$status Telstra_Messaging\Model\OutboundPollResponse (1)
→protected container -> array (4)
to => null
received_timestamp => null
sent_timestamp => null
delivery_status => null

In the MessagingApi class, the api call in the getSMSStatusWithHttpInfo function is returning a JSON array but the ObjectSerializer::deserialize dose not seem to expect it.
[ { "to": "+XXXXXXXXX", "sentTimestamp": "2018-02-08T15:57:53+10:00", "receivedTimestamp": "2018-02-08T15:57:52+10:00", "deliveryStatus": "DELIVRD" } ]

composer.json needs updating

Theres an error happening for composer install due to php-cs-fixer dependancy on older php versions. It returns an error unless you have PHP 7.1 or 7.2 installed

friendsofphp/php-cs-fixer v1.12.0 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.3.11) does not satisfy that requirement.

The fix (at least it worked for me) is to just allow the latest version to install

"friendsofphp/php-cs-fixer": "~1.12"

needs to become

"friendsofphp/php-cs-fixer": "*"

MessagingApi retrieveSMSResponses not working

Calling this returns an array of InboundPollResponses, all blank

Telstra_Messaging\Model\InboundPollResponse (1)
→protected container -> array (6)
to => null
from => null
body => null
received_timestamp => null
more_messages => null
message_id => null

But the JSON content is
{ "status": "RECEIVED", "destinationAddress": "+XXXX", "senderAddress": "+XXXX", "message": "Tests 4", "sentTimestamp": "2018-02-08T16:42:49+10:00" }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.