Skip to content

Latest commit

 

History

History
165 lines (114 loc) · 5.87 KB

ProvisioningApi.md

File metadata and controls

165 lines (114 loc) · 5.87 KB

Telstra_Messaging\ProvisioningApi

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

Method HTTP request Description
createSubscription POST /messages/provisioning/subscriptions Create Subscription
deleteSubscription DELETE /messages/provisioning/subscriptions Delete Subscription
getSubscription GET /messages/provisioning/subscriptions Get Subscription

createSubscription

\Telstra_Messaging\Model\ProvisionNumberResponse createSubscription($provision_number_request)

Create Subscription

Invoke the provisioning API to get a dedicated mobile number for an account or application. Note that Free Trial apps will have a 30-Day Limit for their provisioned number. If the Provisioning call is made several times within that 30-Day period, it will return the expiryDate in the Unix format and will not add any activeDays until after that expiryDate. For paid apps, a provisioned number can be allotted for a maximum of 5 years. If a Provisioning call is made which will result to activeDays > 1830, the response body will indicate that the provisioned number is already valid for more than 5 years.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: auth
$config = Telstra_Messaging\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Telstra_Messaging\Api\ProvisioningApi(
    // 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(),
    $config
);
$provision_number_request = new \Telstra_Messaging\Model\ProvisionNumberRequest(); // \Telstra_Messaging\Model\ProvisionNumberRequest | A JSON payload containing the required attributes

try {
    $result = $apiInstance->createSubscription($provision_number_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProvisioningApi->createSubscription: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
provision_number_request \Telstra_Messaging\Model\ProvisionNumberRequest A JSON payload containing the required attributes

Return type

\Telstra_Messaging\Model\ProvisionNumberResponse

Authorization

auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

deleteSubscription

deleteSubscription($delete_number_request)

Delete Subscription

Delete a mobile number subscription from an account

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: auth
$config = Telstra_Messaging\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Telstra_Messaging\Api\ProvisioningApi(
    // 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(),
    $config
);
$delete_number_request = new \Telstra_Messaging\Model\DeleteNumberRequest(); // \Telstra_Messaging\Model\DeleteNumberRequest | EmptyArr

try {
    $apiInstance->deleteSubscription($delete_number_request);
} catch (Exception $e) {
    echo 'Exception when calling ProvisioningApi->deleteSubscription: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
delete_number_request \Telstra_Messaging\Model\DeleteNumberRequest EmptyArr

Return type

void (empty response body)

Authorization

auth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

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

getSubscription

\Telstra_Messaging\Model\GetSubscriptionResponse getSubscription()

Get Subscription

Get mobile number subscription for an account

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: auth
$config = Telstra_Messaging\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Telstra_Messaging\Api\ProvisioningApi(
    // 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(),
    $config
);

try {
    $result = $apiInstance->getSubscription();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProvisioningApi->getSubscription: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\Telstra_Messaging\Model\GetSubscriptionResponse

Authorization

auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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