Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 2.07 KB

AuthenticationApi.md

File metadata and controls

62 lines (43 loc) · 2.07 KB

Telstra_Messaging\AuthenticationApi

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

Method HTTP request Description
authToken POST /oauth/token Generate OAuth2 token

authToken

\Telstra_Messaging\Model\OAuthResponse authToken($client_id, $client_secret, $grant_type)

Generate OAuth2 token

To generate an OAuth2 Authentication token, pass through your Client key and Client secret that you received when you registered for the API Free Trial Product. The grant_type should be left as client_credentials and the scope as NSMS. The token will expire in one hour.

Example

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

Parameters

Name Type Description Notes
client_id string
client_secret string
grant_type string [default to 'client_credentials']

Return type

\Telstra_Messaging\Model\OAuthResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]