diff --git a/README.md b/README.md index b77fb41..c93a2bd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ - API version: 2.2.6 -- Package version: 1.0.4 +- Package version: 1.0.4.1 ## Requirements @@ -22,7 +22,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi } ], "require": { - "Telstra/MessagingAPI-SDK-php": "*" + "Telstra/MessagingAPI-SDK-php": "*@master" } } ``` @@ -59,9 +59,9 @@ $apiInstance = new Telstra_Messaging\Api\AuthenticationApi( // 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 | +$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); @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description *AuthenticationApi* | [**authToken**](docs/Api/AuthenticationApi.md#authtoken) | **POST** /oauth/token | Generate OAuth2 token *MessagingApi* | [**getMMSStatus**](docs/Api/MessagingApi.md#getmmsstatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status *MessagingApi* | [**getSMSStatus**](docs/Api/MessagingApi.md#getsmsstatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status +*MessagingApi* | [**retrieveMMSResponses**](docs/Api/MessagingApi.md#retrievemmsresponses) | **GET** /messages/mms | Retrieve MMS Responses *MessagingApi* | [**retrieveSMSResponses**](docs/Api/MessagingApi.md#retrievesmsresponses) | **GET** /messages/sms | Retrieve SMS Responses *MessagingApi* | [**sendMMS**](docs/Api/MessagingApi.md#sendmms) | **POST** /messages/mms | Send MMS *MessagingApi* | [**sendSMS**](docs/Api/MessagingApi.md#sendsms) | **POST** /messages/sms | Send SMS @@ -119,4 +120,8 @@ Class | Method | HTTP request | Description - **NSMS**: NSMS +## Author + + + diff --git a/composer.json b/composer.json index c093d3e..64f90b5 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,14 @@ { - "name": "telstra/messagingapi-sdk-php", - "version": "1.0.4", - "description": "Telstra Messaging SDK - PHP Library", + "name": "Telstra/MessagingAPI-SDK-php", + "version": "1.0.4.1", + "description": "", "keywords": [ - "swagger", + "openapitools", + "openapi-generator", "php", "sdk", "api", + "rest", "telstradev" ], "homepage": "https://dev.telstra.com", diff --git a/docs/Api/AuthenticationApi.md b/docs/Api/AuthenticationApi.md index d737a1f..a078084 100644 --- a/docs/Api/AuthenticationApi.md +++ b/docs/Api/AuthenticationApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description 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.
   #!/bin/bash   # Obtain these keys from the Telstra Developer Portal   CLIENT_KEY=\"your client key\"   CLIENT_SECRET=\"your client secret\"   curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \\   -d 'grant_type=client_credentials&client_id=$CLIENT_KEY&client_secret=CLIENT_SECRET&scope=NSMS' \\   'https://tapi.telstra.com/v2/oauth/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 @@ -24,9 +24,9 @@ $apiInstance = new Telstra_Messaging\Api\AuthenticationApi( // 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 | +$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); @@ -43,7 +43,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **client_id** | **string**| | **client_secret** | **string**| | - **grant_type** | **string**| | [default to client_credentials] + **grant_type** | **string**| | [default to 'client_credentials'] ### Return type diff --git a/docs/Api/MessagingApi.md b/docs/Api/MessagingApi.md index 6c1d7c4..62da04a 100644 --- a/docs/Api/MessagingApi.md +++ b/docs/Api/MessagingApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**getMMSStatus**](MessagingApi.md#getMMSStatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status [**getSMSStatus**](MessagingApi.md#getSMSStatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status +[**retrieveMMSResponses**](MessagingApi.md#retrieveMMSResponses) | **GET** /messages/mms | Retrieve MMS Responses [**retrieveSMSResponses**](MessagingApi.md#retrieveSMSResponses) | **GET** /messages/sms | Retrieve SMS Responses [**sendMMS**](MessagingApi.md#sendMMS) | **POST** /messages/mms | Send MMS [**sendSMS**](MessagingApi.md#sendSMS) | **POST** /messages/sms | Send SMS @@ -32,7 +33,7 @@ $apiInstance = new Telstra_Messaging\Api\MessagingApi( new GuzzleHttp\Client(), $config ); -$messageid = "messageid_example"; // string | Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms +$messageid = 'messageid_example'; // string | Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms try { $result = $apiInstance->getMMSStatus($messageid); @@ -59,7 +60,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) @@ -69,7 +70,7 @@ Name | Type | Description | Notes Get SMS Status -If no notification URL has been specified, it is possible to poll for the message status.
  #!/bin/bash   #!/bin/bash   # Example of how to poll for a message status   AccessToken=\"Consumer Access Token\"   MessageId=\"Previous supplied Message Id, URL encoded\"   curl -X get -H \"Authorization: Bearer $AccessToken\" \\     -H \"Content-Type: application/json\" \\     \"https://tapi.telstra.com/v2/messages/sms/$MessageId\" 
Note that the `MessageId` that appears in the URL must be URL encoded, just copying the `MessageId` as it was supplied when submitting the message may not work. +If no notification URL has been specified, it is possible to poll for the message status. Note that the `MessageId` that appears in the URL must be URL encoded. Just copying the `MessageId` as it was supplied when submitting the message may not work. SMS Status with Notification URL --- When a message has reached its final state, the API will send a POST to the URL that has been previously specified.
{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later. ### Example ```php @@ -85,7 +86,7 @@ $apiInstance = new Telstra_Messaging\Api\MessagingApi( new GuzzleHttp\Client(), $config ); -$message_id = "message_id_example"; // string | Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. +$message_id = 'message_id_example'; // string | Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. try { $result = $apiInstance->getSMSStatus($message_id); @@ -112,7 +113,56 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **retrieveMMSResponses** +> \Telstra_Messaging\Model\MMSContent[] retrieveMMSResponses() + +Retrieve MMS Responses + +Messages are retrieved one at a time, starting with the earliest response. If the subscription has a `notifyURL`, response messages will be logged there instead. # Notification URL Format for MMS Replies
{   \"status\": \"RECEIVED\",   \"destinationAddress\": \"+61418123456\",   \"senderAddress\": \"+61421987654\",   \"subject\": \"Foo\",   \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",   \"envelope\": \"string\",   \"MMSContent\":     [       {         \"type\": \"text/plain\",         \"filename\": \"text_1.txt\",         \"payload\": \"string\"       },       {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"       }     ] }
The fields are: | Field | Description | | --- | --- | | `status` | The final state of the message. | | `destinationAddress` |The number the message was sent to. | | `senderAddress` | The number the message was sent from. | | `subject` | The subject assigned to the message. | | `sentTimestamp` | Time handling of the message ended. | | `envelope` | Information about about terminal type and originating operator. | | `MMSContent` | An array of the actual content of the reply message. | | `type` | The content type of the message. | | `filename` | The filename for the message content. | | `payload` | The content of the message. | + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Telstra_Messaging\Api\MessagingApi( + // 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->retrieveMMSResponses(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MessagingApi->retrieveMMSResponses: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Telstra_Messaging\Model\MMSContent[]**](../Model/MMSContent.md) + +### Authorization + +[auth](../../README.md#auth) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) @@ -122,7 +172,7 @@ Name | Type | Description | Notes Retrieve SMS Responses -Messages are retrieved one at a time, starting with the earliest response. The API supports the encoding of the full range of emojis in the reply message. The emojis will be in their UTF-8 format. If the subscription has a `notifyURL`, response messages will be logged there instead. +Messages are retrieved one at a time, starting with the earliest response. The API supports the encoding of the full range of emojis in the reply message. The emojis will be in their UTF-8 format. If the subscription has a `notifyURL`, response messages will be logged there instead. # Notification URL Format for SMS Response
{   \"to\":\"+61472880123\",   \"from\":\"+61412345678\",   \"body\":\"Foo4\",   \"sentTimestamp\":\"2018-04-20T14:24:35\",   \"messageId\":\"DMASApiA0000000146\" }
The fields are: | Field | Description | | --- |--- | | `to` | The number the message was sent to. | | `from` | The number the message was sent from. | | `body` | The content of the SMS response. | | `sentTimestamp` | Time handling of the message ended. | | `messageId` | The ID assigned to the message. | ### Example ```php @@ -161,13 +211,13 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **sendMMS** -> \Telstra_Messaging\Model\MessageSentResponse sendMMS($body) +> \Telstra_Messaging\Model\MessageSentResponse sendMMS($send_mms_request) Send MMS @@ -187,10 +237,12 @@ $apiInstance = new Telstra_Messaging\Api\MessagingApi( new GuzzleHttp\Client(), $config ); -$body = new \Telstra_Messaging\Model\SendMmsRequest(); // \Telstra_Messaging\Model\SendMmsRequest | A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit +$send_mms_request = new \Telstra_Messaging\Model\SendMmsRequest(); // \Telstra_Messaging\Model\SendMmsRequest | A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + try { - $result = $apiInstance->sendMMS($body); + $result = $apiInstance->sendMMS($send_mms_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling MessagingApi->sendMMS: ', $e->getMessage(), PHP_EOL; @@ -202,7 +254,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Telstra_Messaging\Model\SendMmsRequest**](../Model/SendMmsRequest.md)| A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit | + **send_mms_request** | [**\Telstra_Messaging\Model\SendMmsRequest**](../Model/SendMmsRequest.md)| A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + | ### Return type @@ -220,11 +274,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **sendSMS** -> \Telstra_Messaging\Model\MessageSentResponse sendSMS($payload) +> \Telstra_Messaging\Model\MessageSentResponse sendSMS($send_sms_request) Send SMS -Send an SMS Message to a single or multiple mobile number/s.

Send message to a single number:

  #!/bin/bash   # Use the Messaging API-v2 to send an SMS   # Note: only to: and body: are required   AccessToken=\"Access Token\"   Dest=\"Destination number\"   curl -X POST -H \"Authorization: Bearer $AccessToken\" -H \"Content-Type: application/json\" -d \"{     \\\"to\\\":\\\"$Dest\\\",     \\\"body\\\":\\\"Test Message\\\",     \\\"from\\\": \\\"+61412345678\\\",     \\\"validity\\\": 5,     \\\"scheduledDelivery\\\": 1,     \\\"notifyURL\\\": \\\"\\\",     \\\"replyRequest\\\": false     \\\"priority\\\": true   }\" \"https://tapi.telstra.com/v2/messages/sms\" 
\\

Send message to multiple numbers:

 #!/bin/bash   # Use the Messaging API to send an SMS   AccessToken=\"Access Token\"   Dest=\"Destination number\"   curl -X post -H \"Authorization: Bearer $AccessToken\" \\     -H \"Content-Type: application/json\" \\     -d '{ \"to\":\"$dest1, $dest2, $dest3\", \"body\":\"Test Message\" }' \\     https://tapi.telstra.com/v2/messages/sms   

+Send an SMS Message to a single or multiple mobile number/s.
 
 ### Example
 ```php
@@ -240,10 +294,12 @@ $apiInstance = new Telstra_Messaging\Api\MessagingApi(
     new GuzzleHttp\Client(),
     $config
 );
-$payload = new \Telstra_Messaging\Model\SendSMSRequest(); // \Telstra_Messaging\Model\SendSMSRequest | A JSON or XML payload containing the recipient's phone number and text message.  This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit.
+$send_sms_request = new \Telstra_Messaging\Model\SendSMSRequest(); // \Telstra_Messaging\Model\SendSMSRequest | A JSON or XML payload containing the recipient's phone number and text message.
+This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit.
+
 
 try {
-    $result = $apiInstance->sendSMS($payload);
+    $result = $apiInstance->sendSMS($send_sms_request);
     print_r($result);
 } catch (Exception $e) {
     echo 'Exception when calling MessagingApi->sendSMS: ', $e->getMessage(), PHP_EOL;
@@ -255,7 +311,9 @@ try {
 
 Name | Type | Description  | Notes
 ------------- | ------------- | ------------- | -------------
- **payload** | [**\Telstra_Messaging\Model\SendSMSRequest**](../Model/SendSMSRequest.md)| A JSON or XML payload containing the recipient's phone number and text message.  This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. |
+ **send_sms_request** | [**\Telstra_Messaging\Model\SendSMSRequest**](../Model/SendSMSRequest.md)| A JSON or XML payload containing the recipient's phone number and text message.
+This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit.
+ |
 
 ### Return type
 
diff --git a/docs/Api/ProvisioningApi.md b/docs/Api/ProvisioningApi.md
index 19575ef..767bda9 100644
--- a/docs/Api/ProvisioningApi.md
+++ b/docs/Api/ProvisioningApi.md
@@ -10,11 +10,11 @@ Method | HTTP request | Description
 
 
 # **createSubscription**
-> \Telstra_Messaging\Model\ProvisionNumberResponse createSubscription($body)
+> \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.  
   #!/bin/bash   curl -X POST \\   https://tapi.telstra.com/v2/messages/provisioning/subscriptions \\   -H 'authorization: Bearer $ACCESS_TOKEN' \\   -H 'cache-control: no-cache' \\   -H 'content-type: application/json' \\   -d '{   \"activeDays\":30,   \"notifyURL\":\"http://example.com/callback\",   \"callbackData\":     {       \"anything\":\"some data\"     }   }' 
+Invoke the provisioning API to get a dedicated mobile number for an account or application. ### Example ```php @@ -30,10 +30,10 @@ $apiInstance = new Telstra_Messaging\Api\ProvisioningApi( new GuzzleHttp\Client(), $config ); -$body = new \Telstra_Messaging\Model\ProvisionNumberRequest(); // \Telstra_Messaging\Model\ProvisionNumberRequest | A JSON payload containing the required attributes +$provision_number_request = new \Telstra_Messaging\Model\ProvisionNumberRequest(); // \Telstra_Messaging\Model\ProvisionNumberRequest | A JSON payload containing the required attributes try { - $result = $apiInstance->createSubscription($body); + $result = $apiInstance->createSubscription($provision_number_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProvisioningApi->createSubscription: ', $e->getMessage(), PHP_EOL; @@ -45,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Telstra_Messaging\Model\ProvisionNumberRequest**](../Model/ProvisionNumberRequest.md)| A JSON payload containing the required attributes | + **provision_number_request** | [**\Telstra_Messaging\Model\ProvisionNumberRequest**](../Model/ProvisionNumberRequest.md)| A JSON payload containing the required attributes | ### Return type @@ -63,7 +63,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **deleteSubscription** -> deleteSubscription($body) +> deleteSubscription($delete_number_request) Delete Subscription @@ -83,10 +83,10 @@ $apiInstance = new Telstra_Messaging\Api\ProvisioningApi( new GuzzleHttp\Client(), $config ); -$body = new \Telstra_Messaging\Model\DeleteNumberRequest(); // \Telstra_Messaging\Model\DeleteNumberRequest | EmptyArr +$delete_number_request = new \Telstra_Messaging\Model\DeleteNumberRequest(); // \Telstra_Messaging\Model\DeleteNumberRequest | EmptyArr try { - $apiInstance->deleteSubscription($body); + $apiInstance->deleteSubscription($delete_number_request); } catch (Exception $e) { echo 'Exception when calling ProvisioningApi->deleteSubscription: ', $e->getMessage(), PHP_EOL; } @@ -97,7 +97,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\Telstra_Messaging\Model\DeleteNumberRequest**](../Model/DeleteNumberRequest.md)| EmptyArr | + **delete_number_request** | [**\Telstra_Messaging\Model\DeleteNumberRequest**](../Model/DeleteNumberRequest.md)| EmptyArr | ### Return type @@ -110,7 +110,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) @@ -158,7 +158,7 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Model/InboundPollResponse.md b/docs/Model/InboundPollResponse.md index 52d1189..eccb3a3 100644 --- a/docs/Model/InboundPollResponse.md +++ b/docs/Model/InboundPollResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **string** | message status | [optional] -**destination_address** | **string** | The phone number (recipient) that the message was sent to(in E.164 format). | [optional] +**destination_address** | **string** | The phone number (recipient) that the message was sent to (in E.164 format). | [optional] **sender_address** | **string** | The phone number (sender) that the message was sent from (in E.164 format). | [optional] **message** | **string** | Text of the message that was sent | [optional] **message_id** | **string** | Message Id | [optional] diff --git a/docs/Model/MMSContent.md b/docs/Model/MMSContent.md index 64e57c7..2a5a0ba 100644 --- a/docs/Model/MMSContent.md +++ b/docs/Model/MMSContent.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **string** | The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar | +**type** | **string** | The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar\" | **filename** | **string** | The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. | **payload** | **string** | | diff --git a/docs/Model/OAuthResponse.md b/docs/Model/OAuthResponse.md index 5f10d3d..e78364a 100644 --- a/docs/Model/OAuthResponse.md +++ b/docs/Model/OAuthResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **access_token** | **string** | OAuth access token | [optional] **token_type** | **string** | OAuth token type | [optional] -**expires_in** | **string** | OAuth expity time | [optional] +**expires_in** | **string** | OAuth expiry time | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/ProvisionNumberRequest.md b/docs/Model/ProvisionNumberRequest.md index ef46bfc..e32fa86 100644 --- a/docs/Model/ProvisionNumberRequest.md +++ b/docs/Model/ProvisionNumberRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active_days** | **int** | The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. | [optional] -**notify_url** | **string** | A callback URL that will be POSTed to whenever a new message arrives at this destination address. If this is not provided then you can make use the Get Replies API to poll for messages. | [optional] +**notify_url** | **string** | A notification URL that will be POSTed to whenever a new message (e.g. a reply to a message sent) arrives at this destination address. If this is not provided then you can use the Get /sms or /mms API to poll for reply messages. *Please note that the notification URLs and the Get /sms or /mms call are exclusive. If a notification URL has been set then the GET call will not provide any useful information.* | [optional] **callback_data** | **string** | A JSON that will be sent as the body in the POST to the notifyURL. This can be any meaningful data relevant to your application. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/SendMmsRequest.md b/docs/Model/SendMmsRequest.md index e53008d..05d35b2 100644 --- a/docs/Model/SendMmsRequest.md +++ b/docs/Model/SendMmsRequest.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **from** | **string** | This will be the source address that will be displayed on the receiving device. If it is not present then it will default to the MSISDN assigned to the app. If replyRequest is set to true, then this field will be ignored. | -**to** | **string** | This is the destination address. | +**to** | **string** | This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] | **subject** | **string** | The subject that will be used in an MMS message. | **reply_request** | **bool** | If set to true, the reply message functionality will be implemented and the to address will be ignored if present. | **notify_url** | **string** | Notify url | [optional] -**mms_content** | [**\Telstra_Messaging\Model\MMSContent[]**](MMSContent.md) | An Array of content that will be sent in an MMS message. If this array is present it will cause the body element to be ignored, and the message will be sent as an MMS. | +**mms_content** | [**\Telstra_Messaging\Model\MMSContent[]**](MMSContent.md) | An array of content that will be sent in an MMS message. If this array is present it will cause the `body` element to be ignored, and the message will be sent as an MMS. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Model/SendSMSRequest.md b/docs/Model/SendSMSRequest.md index fe9e337..d12cb8d 100644 --- a/docs/Model/SendSMSRequest.md +++ b/docs/Model/SendSMSRequest.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**to** | **string** | Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. Can be an array of strings if sending to multiple numbers: `\"to\": \"+61412345678, +61418765432\"` | +**to** | **string** | Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. Can be an array of strings if sending to multiple numbers: `\"to\":[\"+61412345678\", \"+61418765432\"]` | **body** | **string** | The text body of the message. Messages longer than 160 characters will be counted as multiple messages. This field contains the message text, this can be up to 1900 (for a single recipient) or 500 (for multiple recipients) UTF-8 characters. As mobile devices rarely support the full range of UTF-8 characters, it is possible that some characters may not be translated correctly by the mobile device | **from** | **string** | The Alphanumeric sender ID of up to 11 characters or phone number the SMS was sent from. If not present, the service will use the mobile number associated with the application (in E.164 format). This feature is only available on paid plans. | [optional] **validity** | **int** | How long the platform should attempt to deliver the message for. This period is specified in minutes from the message. Normally if the message cannot be delivered immediately, it will be stored and delivery will be periodically reattempted. The network will attempt to send the message for up to seven days. It is possible to define a period smaller than 7 days by including this parameter and specifying the number of minutes that delivery should be attempted. eg: including `\"validity\": 60` will specify that if a message can't be delivered within the first 60 minutes them the network should stop. | [optional] diff --git a/lib/Api/AuthenticationApi.php b/lib/Api/AuthenticationApi.php index cb5168a..f8bb558 100644 --- a/lib/Api/AuthenticationApi.php +++ b/lib/Api/AuthenticationApi.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -44,8 +44,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class AuthenticationApi { @@ -59,6 +59,11 @@ class AuthenticationApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -267,19 +272,19 @@ function ($exception) { protected function authTokenRequest($client_id, $client_secret, $grant_type) { // verify the required parameter 'client_id' is set - if ($client_id === null) { + if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $client_id when calling authToken' ); } // verify the required parameter 'client_secret' is set - if ($client_secret === null) { + if ($client_secret === null || (is_array($client_secret) && count($client_secret) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $client_secret when calling authToken' ); } // verify the required parameter 'grant_type' is set - if ($grant_type === null) { + if ($grant_type === null || (is_array($grant_type) && count($grant_type) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $grant_type when calling authToken' ); diff --git a/lib/Api/MessagingApi.php b/lib/Api/MessagingApi.php index d018349..0d56822 100644 --- a/lib/Api/MessagingApi.php +++ b/lib/Api/MessagingApi.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -44,8 +44,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MessagingApi { @@ -59,6 +59,11 @@ class MessagingApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -257,7 +262,7 @@ function ($exception) { protected function getMMSStatusRequest($messageid) { // verify the required parameter 'messageid' is set - if ($messageid === null) { + if ($messageid === null || (is_array($messageid) && count($messageid) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $messageid when calling getMMSStatus' ); @@ -290,7 +295,7 @@ protected function getMMSStatusRequest($messageid) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -523,7 +528,7 @@ function ($exception) { protected function getSMSStatusRequest($message_id) { // verify the required parameter 'message_id' is set - if ($message_id === null) { + if ($message_id === null || (is_array($message_id) && count($message_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $message_id when calling getSMSStatus' ); @@ -556,8 +561,255 @@ protected function getSMSStatusRequest($message_id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation retrieveMMSResponses + * + * Retrieve MMS Responses + * + * + * @throws \Telstra_Messaging\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Telstra_Messaging\Model\MMSContent[] + */ + public function retrieveMMSResponses() + { + list($response) = $this->retrieveMMSResponsesWithHttpInfo(); + return $response; + } + + /** + * Operation retrieveMMSResponsesWithHttpInfo + * + * Retrieve MMS Responses + * + * + * @throws \Telstra_Messaging\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Telstra_Messaging\Model\MMSContent[], HTTP status code, HTTP response headers (array of strings) + */ + public function retrieveMMSResponsesWithHttpInfo() + { + $returnType = '\Telstra_Messaging\Model\MMSContent[]'; + $request = $this->retrieveMMSResponsesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Telstra_Messaging\Model\MMSContent[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation retrieveMMSResponsesAsync + * + * Retrieve MMS Responses + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function retrieveMMSResponsesAsync() + { + return $this->retrieveMMSResponsesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation retrieveMMSResponsesAsyncWithHttpInfo + * + * Retrieve MMS Responses + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function retrieveMMSResponsesAsyncWithHttpInfo() + { + $returnType = '\Telstra_Messaging\Model\MMSContent[]'; + $request = $this->retrieveMMSResponsesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'retrieveMMSResponses' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function retrieveMMSResponsesRequest() + { + + $resourcePath = '/messages/mms'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); } // for model (json/xml) @@ -803,7 +1055,7 @@ protected function retrieveSMSResponsesRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -866,15 +1118,17 @@ protected function retrieveSMSResponsesRequest() * * Send MMS * - * @param \Telstra_Messaging\Model\SendMmsRequest $body A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required) + * @param \Telstra_Messaging\Model\SendMmsRequest $send_mms_request A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Telstra_Messaging\Model\MessageSentResponse */ - public function sendMMS($body) + public function sendMMS($send_mms_request) { - list($response) = $this->sendMMSWithHttpInfo($body); + list($response) = $this->sendMMSWithHttpInfo($send_mms_request); return $response; } @@ -883,16 +1137,18 @@ public function sendMMS($body) * * Send MMS * - * @param \Telstra_Messaging\Model\SendMmsRequest $body A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required) + * @param \Telstra_Messaging\Model\SendMmsRequest $send_mms_request A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Telstra_Messaging\Model\MessageSentResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendMMSWithHttpInfo($body) + public function sendMMSWithHttpInfo($send_mms_request) { $returnType = '\Telstra_Messaging\Model\MessageSentResponse'; - $request = $this->sendMMSRequest($body); + $request = $this->sendMMSRequest($send_mms_request); try { $options = $this->createHttpClientOption(); @@ -948,6 +1204,14 @@ public function sendMMSWithHttpInfo($body) ); $e->setResponseObject($data); break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -958,14 +1222,16 @@ public function sendMMSWithHttpInfo($body) * * Send MMS * - * @param \Telstra_Messaging\Model\SendMmsRequest $body A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required) + * @param \Telstra_Messaging\Model\SendMmsRequest $send_mms_request A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMMSAsync($body) + public function sendMMSAsync($send_mms_request) { - return $this->sendMMSAsyncWithHttpInfo($body) + return $this->sendMMSAsyncWithHttpInfo($send_mms_request) ->then( function ($response) { return $response[0]; @@ -978,15 +1244,17 @@ function ($response) { * * Send MMS * - * @param \Telstra_Messaging\Model\SendMmsRequest $body A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required) + * @param \Telstra_Messaging\Model\SendMmsRequest $send_mms_request A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendMMSAsyncWithHttpInfo($body) + public function sendMMSAsyncWithHttpInfo($send_mms_request) { $returnType = '\Telstra_Messaging\Model\MessageSentResponse'; - $request = $this->sendMMSRequest($body); + $request = $this->sendMMSRequest($send_mms_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1028,17 +1296,19 @@ function ($exception) { /** * Create request for operation 'sendMMS' * - * @param \Telstra_Messaging\Model\SendMmsRequest $body A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required) + * @param \Telstra_Messaging\Model\SendMmsRequest $send_mms_request A JSON or XML payload containing the recipient's phone number and MMS message. +The recipient number should be in the format '04xxxxxxxx' where x is a digit. + (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendMMSRequest($body) + protected function sendMMSRequest($send_mms_request) { - // verify the required parameter 'body' is set - if ($body === null) { + // verify the required parameter 'send_mms_request' is set + if ($send_mms_request === null || (is_array($send_mms_request) && count($send_mms_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling sendMMS' + 'Missing the required parameter $send_mms_request when calling sendMMS' ); } @@ -1053,8 +1323,8 @@ protected function sendMMSRequest($body) // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($send_mms_request)) { + $_tempBody = $send_mms_request; } if ($multipart) { @@ -1127,15 +1397,17 @@ protected function sendMMSRequest($body) * * Send SMS * - * @param \Telstra_Messaging\Model\SendSMSRequest $payload A JSON or XML payload containing the recipient's phone number and text message. This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. (required) + * @param \Telstra_Messaging\Model\SendSMSRequest $send_sms_request A JSON or XML payload containing the recipient's phone number and text message. +This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. + (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Telstra_Messaging\Model\MessageSentResponse */ - public function sendSMS($payload) + public function sendSMS($send_sms_request) { - list($response) = $this->sendSMSWithHttpInfo($payload); + list($response) = $this->sendSMSWithHttpInfo($send_sms_request); return $response; } @@ -1144,16 +1416,18 @@ public function sendSMS($payload) * * Send SMS * - * @param \Telstra_Messaging\Model\SendSMSRequest $payload A JSON or XML payload containing the recipient's phone number and text message. This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. (required) + * @param \Telstra_Messaging\Model\SendSMSRequest $send_sms_request A JSON or XML payload containing the recipient's phone number and text message. +This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. + (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Telstra_Messaging\Model\MessageSentResponse, HTTP status code, HTTP response headers (array of strings) */ - public function sendSMSWithHttpInfo($payload) + public function sendSMSWithHttpInfo($send_sms_request) { $returnType = '\Telstra_Messaging\Model\MessageSentResponse'; - $request = $this->sendSMSRequest($payload); + $request = $this->sendSMSRequest($send_sms_request); try { $options = $this->createHttpClientOption(); @@ -1219,14 +1493,16 @@ public function sendSMSWithHttpInfo($payload) * * Send SMS * - * @param \Telstra_Messaging\Model\SendSMSRequest $payload A JSON or XML payload containing the recipient's phone number and text message. This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. (required) + * @param \Telstra_Messaging\Model\SendSMSRequest $send_sms_request A JSON or XML payload containing the recipient's phone number and text message. +This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. + (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendSMSAsync($payload) + public function sendSMSAsync($send_sms_request) { - return $this->sendSMSAsyncWithHttpInfo($payload) + return $this->sendSMSAsyncWithHttpInfo($send_sms_request) ->then( function ($response) { return $response[0]; @@ -1239,15 +1515,17 @@ function ($response) { * * Send SMS * - * @param \Telstra_Messaging\Model\SendSMSRequest $payload A JSON or XML payload containing the recipient's phone number and text message. This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. (required) + * @param \Telstra_Messaging\Model\SendSMSRequest $send_sms_request A JSON or XML payload containing the recipient's phone number and text message. +This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. + (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendSMSAsyncWithHttpInfo($payload) + public function sendSMSAsyncWithHttpInfo($send_sms_request) { $returnType = '\Telstra_Messaging\Model\MessageSentResponse'; - $request = $this->sendSMSRequest($payload); + $request = $this->sendSMSRequest($send_sms_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1289,17 +1567,19 @@ function ($exception) { /** * Create request for operation 'sendSMS' * - * @param \Telstra_Messaging\Model\SendSMSRequest $payload A JSON or XML payload containing the recipient's phone number and text message. This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. (required) + * @param \Telstra_Messaging\Model\SendSMSRequest $send_sms_request A JSON or XML payload containing the recipient's phone number and text message. +This number can be in international format if preceeded by a ‘+’ or in national format ('04xxxxxxxx') where x is a digit. + (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendSMSRequest($payload) + protected function sendSMSRequest($send_sms_request) { - // verify the required parameter 'payload' is set - if ($payload === null) { + // verify the required parameter 'send_sms_request' is set + if ($send_sms_request === null || (is_array($send_sms_request) && count($send_sms_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $payload when calling sendSMS' + 'Missing the required parameter $send_sms_request when calling sendSMS' ); } @@ -1314,8 +1594,8 @@ protected function sendSMSRequest($payload) // body params $_tempBody = null; - if (isset($payload)) { - $_tempBody = $payload; + if (isset($send_sms_request)) { + $_tempBody = $send_sms_request; } if ($multipart) { diff --git a/lib/Api/ProvisioningApi.php b/lib/Api/ProvisioningApi.php index c0cd1ea..a3c2199 100644 --- a/lib/Api/ProvisioningApi.php +++ b/lib/Api/ProvisioningApi.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -44,8 +44,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ProvisioningApi { @@ -59,6 +59,11 @@ class ProvisioningApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -87,15 +92,15 @@ public function getConfig() * * Create Subscription * - * @param \Telstra_Messaging\Model\ProvisionNumberRequest $body A JSON payload containing the required attributes (required) + * @param \Telstra_Messaging\Model\ProvisionNumberRequest $provision_number_request A JSON payload containing the required attributes (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Telstra_Messaging\Model\ProvisionNumberResponse */ - public function createSubscription($body) + public function createSubscription($provision_number_request) { - list($response) = $this->createSubscriptionWithHttpInfo($body); + list($response) = $this->createSubscriptionWithHttpInfo($provision_number_request); return $response; } @@ -104,16 +109,16 @@ public function createSubscription($body) * * Create Subscription * - * @param \Telstra_Messaging\Model\ProvisionNumberRequest $body A JSON payload containing the required attributes (required) + * @param \Telstra_Messaging\Model\ProvisionNumberRequest $provision_number_request A JSON payload containing the required attributes (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Telstra_Messaging\Model\ProvisionNumberResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createSubscriptionWithHttpInfo($body) + public function createSubscriptionWithHttpInfo($provision_number_request) { $returnType = '\Telstra_Messaging\Model\ProvisionNumberResponse'; - $request = $this->createSubscriptionRequest($body); + $request = $this->createSubscriptionRequest($provision_number_request); try { $options = $this->createHttpClientOption(); @@ -179,14 +184,14 @@ public function createSubscriptionWithHttpInfo($body) * * Create Subscription * - * @param \Telstra_Messaging\Model\ProvisionNumberRequest $body A JSON payload containing the required attributes (required) + * @param \Telstra_Messaging\Model\ProvisionNumberRequest $provision_number_request A JSON payload containing the required attributes (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSubscriptionAsync($body) + public function createSubscriptionAsync($provision_number_request) { - return $this->createSubscriptionAsyncWithHttpInfo($body) + return $this->createSubscriptionAsyncWithHttpInfo($provision_number_request) ->then( function ($response) { return $response[0]; @@ -199,15 +204,15 @@ function ($response) { * * Create Subscription * - * @param \Telstra_Messaging\Model\ProvisionNumberRequest $body A JSON payload containing the required attributes (required) + * @param \Telstra_Messaging\Model\ProvisionNumberRequest $provision_number_request A JSON payload containing the required attributes (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createSubscriptionAsyncWithHttpInfo($body) + public function createSubscriptionAsyncWithHttpInfo($provision_number_request) { $returnType = '\Telstra_Messaging\Model\ProvisionNumberResponse'; - $request = $this->createSubscriptionRequest($body); + $request = $this->createSubscriptionRequest($provision_number_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -249,17 +254,17 @@ function ($exception) { /** * Create request for operation 'createSubscription' * - * @param \Telstra_Messaging\Model\ProvisionNumberRequest $body A JSON payload containing the required attributes (required) + * @param \Telstra_Messaging\Model\ProvisionNumberRequest $provision_number_request A JSON payload containing the required attributes (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createSubscriptionRequest($body) + protected function createSubscriptionRequest($provision_number_request) { - // verify the required parameter 'body' is set - if ($body === null) { + // verify the required parameter 'provision_number_request' is set + if ($provision_number_request === null || (is_array($provision_number_request) && count($provision_number_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createSubscription' + 'Missing the required parameter $provision_number_request when calling createSubscription' ); } @@ -274,8 +279,8 @@ protected function createSubscriptionRequest($body) // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($provision_number_request)) { + $_tempBody = $provision_number_request; } if ($multipart) { @@ -348,15 +353,15 @@ protected function createSubscriptionRequest($body) * * Delete Subscription * - * @param \Telstra_Messaging\Model\DeleteNumberRequest $body EmptyArr (required) + * @param \Telstra_Messaging\Model\DeleteNumberRequest $delete_number_request EmptyArr (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteSubscription($body) + public function deleteSubscription($delete_number_request) { - $this->deleteSubscriptionWithHttpInfo($body); + $this->deleteSubscriptionWithHttpInfo($delete_number_request); } /** @@ -364,16 +369,16 @@ public function deleteSubscription($body) * * Delete Subscription * - * @param \Telstra_Messaging\Model\DeleteNumberRequest $body EmptyArr (required) + * @param \Telstra_Messaging\Model\DeleteNumberRequest $delete_number_request EmptyArr (required) * * @throws \Telstra_Messaging\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteSubscriptionWithHttpInfo($body) + public function deleteSubscriptionWithHttpInfo($delete_number_request) { $returnType = ''; - $request = $this->deleteSubscriptionRequest($body); + $request = $this->deleteSubscriptionRequest($delete_number_request); try { $options = $this->createHttpClientOption(); @@ -417,14 +422,14 @@ public function deleteSubscriptionWithHttpInfo($body) * * Delete Subscription * - * @param \Telstra_Messaging\Model\DeleteNumberRequest $body EmptyArr (required) + * @param \Telstra_Messaging\Model\DeleteNumberRequest $delete_number_request EmptyArr (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteSubscriptionAsync($body) + public function deleteSubscriptionAsync($delete_number_request) { - return $this->deleteSubscriptionAsyncWithHttpInfo($body) + return $this->deleteSubscriptionAsyncWithHttpInfo($delete_number_request) ->then( function ($response) { return $response[0]; @@ -437,15 +442,15 @@ function ($response) { * * Delete Subscription * - * @param \Telstra_Messaging\Model\DeleteNumberRequest $body EmptyArr (required) + * @param \Telstra_Messaging\Model\DeleteNumberRequest $delete_number_request EmptyArr (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteSubscriptionAsyncWithHttpInfo($body) + public function deleteSubscriptionAsyncWithHttpInfo($delete_number_request) { $returnType = ''; - $request = $this->deleteSubscriptionRequest($body); + $request = $this->deleteSubscriptionRequest($delete_number_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -473,17 +478,17 @@ function ($exception) { /** * Create request for operation 'deleteSubscription' * - * @param \Telstra_Messaging\Model\DeleteNumberRequest $body EmptyArr (required) + * @param \Telstra_Messaging\Model\DeleteNumberRequest $delete_number_request EmptyArr (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteSubscriptionRequest($body) + protected function deleteSubscriptionRequest($delete_number_request) { - // verify the required parameter 'body' is set - if ($body === null) { + // verify the required parameter 'delete_number_request' is set + if ($delete_number_request === null || (is_array($delete_number_request) && count($delete_number_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling deleteSubscription' + 'Missing the required parameter $delete_number_request when calling deleteSubscription' ); } @@ -498,17 +503,17 @@ protected function deleteSubscriptionRequest($body) // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($delete_number_request)) { + $_tempBody = $delete_number_request; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], ['application/json'] ); } @@ -756,7 +761,7 @@ protected function getSubscriptionRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } diff --git a/lib/ApiException.php b/lib/ApiException.php index 528e82a..1ece58a 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -35,8 +35,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ApiException extends Exception { diff --git a/lib/Configuration.php b/lib/Configuration.php index fabd195..6063b5d 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -34,8 +34,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class Configuration { @@ -84,11 +84,11 @@ class Configuration protected $host = 'https://tapi.telstra.com/v2'; /** - * User agent of the HTTP request, set to "PHP-Swagger" by default + * User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default * * @var string */ - protected $userAgent = 'Swagger-Codegen/1.0.4/php'; + protected $userAgent = 'OpenAPI-Generator/1.0.4.1/PHP'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: 2.2.6' . PHP_EOL; - $report .= ' SDK Package Version: 1.0.4' . PHP_EOL; + $report .= ' SDK Package Version: 1.0.4.1' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index d726866..d19cb57 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -35,8 +35,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class HeaderSelector { diff --git a/lib/Model/DeleteNumberRequest.php b/lib/Model/DeleteNumberRequest.php index b5108af..3fa0b5b 100644 --- a/lib/Model/DeleteNumberRequest.php +++ b/lib/Model/DeleteNumberRequest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class DeleteNumberRequest implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class DeleteNumberRequest implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'DeleteNumberRequest'; + protected static $openAPIModelName = 'DeleteNumberRequest'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'empty_arr' => 'int' ]; @@ -65,7 +65,7 @@ class DeleteNumberRequest implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'empty_arr' => 'int32' ]; @@ -74,9 +74,9 @@ class DeleteNumberRequest implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -84,9 +84,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -155,7 +155,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -200,15 +200,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets empty_arr * - * @return int + * @return int|null */ public function getEmptyArr() { @@ -218,7 +217,7 @@ public function getEmptyArr() /** * Sets empty_arr * - * @param int $empty_arr Empty Arr + * @param int|null $empty_arr Empty Arr * * @return $this */ diff --git a/lib/Model/GetSubscriptionResponse.php b/lib/Model/GetSubscriptionResponse.php index 86312d6..00eaa14 100644 --- a/lib/Model/GetSubscriptionResponse.php +++ b/lib/Model/GetSubscriptionResponse.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class GetSubscriptionResponse implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class GetSubscriptionResponse implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'GetSubscriptionResponse'; + protected static $openAPIModelName = 'GetSubscriptionResponse'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'active_days' => 'string', 'notify_url' => 'string', 'destination_address' => 'string' @@ -67,7 +67,7 @@ class GetSubscriptionResponse implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'active_days' => null, 'notify_url' => null, 'destination_address' => null @@ -78,9 +78,9 @@ class GetSubscriptionResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -88,9 +88,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -165,7 +165,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -212,15 +212,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets active_days * - * @return string + * @return string|null */ public function getActiveDays() { @@ -230,7 +229,7 @@ public function getActiveDays() /** * Sets active_days * - * @param string $active_days Number of active days + * @param string|null $active_days Number of active days * * @return $this */ @@ -244,7 +243,7 @@ public function setActiveDays($active_days) /** * Gets notify_url * - * @return string + * @return string|null */ public function getNotifyUrl() { @@ -254,7 +253,7 @@ public function getNotifyUrl() /** * Sets notify_url * - * @param string $notify_url Notify url configured + * @param string|null $notify_url Notify url configured * * @return $this */ @@ -268,7 +267,7 @@ public function setNotifyUrl($notify_url) /** * Gets destination_address * - * @return string + * @return string|null */ public function getDestinationAddress() { @@ -278,7 +277,7 @@ public function getDestinationAddress() /** * Sets destination_address * - * @param string $destination_address The mobile phone number that was allocated + * @param string|null $destination_address The mobile phone number that was allocated * * @return $this */ diff --git a/lib/Model/InboundPollResponse.php b/lib/Model/InboundPollResponse.php index 26c8efe..f232c18 100644 --- a/lib/Model/InboundPollResponse.php +++ b/lib/Model/InboundPollResponse.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -38,8 +38,8 @@ * @category Class * @description Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class InboundPollResponse implements ModelInterface, ArrayAccess { @@ -50,14 +50,14 @@ class InboundPollResponse implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'InboundPollResponse'; + protected static $openAPIModelName = 'InboundPollResponse'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'status' => 'string', 'destination_address' => 'string', 'sender_address' => 'string', @@ -71,7 +71,7 @@ class InboundPollResponse implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'status' => null, 'destination_address' => null, 'sender_address' => null, @@ -85,9 +85,9 @@ class InboundPollResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -95,9 +95,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -181,7 +181,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -231,15 +231,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets status * - * @return string + * @return string|null */ public function getStatus() { @@ -249,7 +248,7 @@ public function getStatus() /** * Sets status * - * @param string $status message status + * @param string|null $status message status * * @return $this */ @@ -263,7 +262,7 @@ public function setStatus($status) /** * Gets destination_address * - * @return string + * @return string|null */ public function getDestinationAddress() { @@ -273,7 +272,7 @@ public function getDestinationAddress() /** * Sets destination_address * - * @param string $destination_address The phone number (recipient) that the message was sent to(in E.164 format). + * @param string|null $destination_address The phone number (recipient) that the message was sent to (in E.164 format). * * @return $this */ @@ -287,7 +286,7 @@ public function setDestinationAddress($destination_address) /** * Gets sender_address * - * @return string + * @return string|null */ public function getSenderAddress() { @@ -297,7 +296,7 @@ public function getSenderAddress() /** * Sets sender_address * - * @param string $sender_address The phone number (sender) that the message was sent from (in E.164 format). + * @param string|null $sender_address The phone number (sender) that the message was sent from (in E.164 format). * * @return $this */ @@ -311,7 +310,7 @@ public function setSenderAddress($sender_address) /** * Gets message * - * @return string + * @return string|null */ public function getMessage() { @@ -321,7 +320,7 @@ public function getMessage() /** * Sets message * - * @param string $message Text of the message that was sent + * @param string|null $message Text of the message that was sent * * @return $this */ @@ -335,7 +334,7 @@ public function setMessage($message) /** * Gets message_id * - * @return string + * @return string|null */ public function getMessageId() { @@ -345,7 +344,7 @@ public function getMessageId() /** * Sets message_id * - * @param string $message_id Message Id + * @param string|null $message_id Message Id * * @return $this */ @@ -359,7 +358,7 @@ public function setMessageId($message_id) /** * Gets sent_timestamp * - * @return string + * @return string|null */ public function getSentTimestamp() { @@ -369,7 +368,7 @@ public function getSentTimestamp() /** * Sets sent_timestamp * - * @param string $sent_timestamp The date and time when the message was sent by recipient. + * @param string|null $sent_timestamp The date and time when the message was sent by recipient. * * @return $this */ diff --git a/lib/Model/MMSContent.php b/lib/Model/MMSContent.php index ad80f39..2d2027a 100644 --- a/lib/Model/MMSContent.php +++ b/lib/Model/MMSContent.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MMSContent implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class MMSContent implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'MMSContent'; + protected static $openAPIModelName = 'MMSContent'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'type' => 'string', 'filename' => 'string', 'payload' => 'string' @@ -67,7 +67,7 @@ class MMSContent implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'type' => null, 'filename' => null, 'payload' => null @@ -78,9 +78,9 @@ class MMSContent implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -88,9 +88,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -165,7 +165,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -221,17 +221,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['type'] === null) { - return false; - } - if ($this->container['filename'] === null) { - return false; - } - if ($this->container['payload'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -248,7 +238,7 @@ public function getType() /** * Sets type * - * @param string $type The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar + * @param string $type The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar\" * * @return $this */ diff --git a/lib/Model/Message.php b/lib/Model/Message.php index 2538550..1103c37 100644 --- a/lib/Model/Message.php +++ b/lib/Model/Message.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class Message implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class Message implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'Message'; + protected static $openAPIModelName = 'Message'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'to' => 'string', 'delivery_status' => 'string', 'message_id' => 'string', @@ -68,7 +68,7 @@ class Message implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'to' => null, 'delivery_status' => null, 'message_id' => null, @@ -80,9 +80,9 @@ class Message implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -90,9 +90,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -170,7 +170,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -227,17 +227,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['to'] === null) { - return false; - } - if ($this->container['delivery_status'] === null) { - return false; - } - if ($this->container['message_id'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -316,7 +306,7 @@ public function setMessageId($message_id) /** * Gets message_status_url * - * @return string + * @return string|null */ public function getMessageStatusUrl() { @@ -326,7 +316,7 @@ public function getMessageStatusUrl() /** * Sets message_status_url * - * @param string $message_status_url For an accepted message, ths will be the URL that can be used to check the messages status. Please refer to the Delivery Notification section. + * @param string|null $message_status_url For an accepted message, ths will be the URL that can be used to check the messages status. Please refer to the Delivery Notification section. * * @return $this */ diff --git a/lib/Model/MessageSentResponse.php b/lib/Model/MessageSentResponse.php index 129d008..85cd530 100644 --- a/lib/Model/MessageSentResponse.php +++ b/lib/Model/MessageSentResponse.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MessageSentResponse implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class MessageSentResponse implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'MessageSentResponse'; + protected static $openAPIModelName = 'MessageSentResponse'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'messages' => '\Telstra_Messaging\Model\Message[]', 'message_type' => 'string', 'number_segments' => 'int', @@ -69,7 +69,7 @@ class MessageSentResponse implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'messages' => null, 'message_type' => null, 'number_segments' => 'int32', @@ -82,9 +82,9 @@ class MessageSentResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -92,9 +92,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -175,7 +175,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -233,17 +233,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['messages'] === null) { - return false; - } - if ($this->container['message_type'] === null) { - return false; - } - if ($this->container['number_segments'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -322,7 +312,7 @@ public function setNumberSegments($number_segments) /** * Gets number_national_destinations * - * @return int + * @return int|null */ public function getNumberNationalDestinations() { @@ -332,7 +322,7 @@ public function getNumberNationalDestinations() /** * Sets number_national_destinations * - * @param int $number_national_destinations This returns the number of domestic Australian messages sent. + * @param int|null $number_national_destinations This returns the number of domestic Australian messages sent. * * @return $this */ @@ -346,7 +336,7 @@ public function setNumberNationalDestinations($number_national_destinations) /** * Gets number_international_destinations * - * @return int + * @return int|null */ public function getNumberInternationalDestinations() { @@ -356,7 +346,7 @@ public function getNumberInternationalDestinations() /** * Sets number_international_destinations * - * @param int $number_international_destinations This returns the number of international messages sent + * @param int|null $number_international_destinations This returns the number of international messages sent * * @return $this */ diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index c48d900..a6c4e30 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging\Model - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -33,7 +33,7 @@ * Interface abstracting model access. * * @package Telstra_Messaging\Model - * @author Swagger Codegen team + * @author OpenAPI Generator team */ interface ModelInterface { @@ -49,14 +49,14 @@ public function getModelName(); * * @return array */ - public static function swaggerTypes(); + public static function openAPITypes(); /** * Array of property to format mappings. Used for (de)serialization * * @return array */ - public static function swaggerFormats(); + public static function openAPIFormats(); /** * Array of attributes where the key is the local name, and the value is the original name diff --git a/lib/Model/OAuthResponse.php b/lib/Model/OAuthResponse.php index ae3b6c9..4523548 100644 --- a/lib/Model/OAuthResponse.php +++ b/lib/Model/OAuthResponse.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class OAuthResponse implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class OAuthResponse implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'OAuthResponse'; + protected static $openAPIModelName = 'OAuthResponse'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'access_token' => 'string', 'token_type' => 'string', 'expires_in' => 'string' @@ -67,7 +67,7 @@ class OAuthResponse implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'access_token' => null, 'token_type' => null, 'expires_in' => null @@ -78,9 +78,9 @@ class OAuthResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -88,9 +88,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -165,7 +165,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -212,15 +212,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets access_token * - * @return string + * @return string|null */ public function getAccessToken() { @@ -230,7 +229,7 @@ public function getAccessToken() /** * Sets access_token * - * @param string $access_token OAuth access token + * @param string|null $access_token OAuth access token * * @return $this */ @@ -244,7 +243,7 @@ public function setAccessToken($access_token) /** * Gets token_type * - * @return string + * @return string|null */ public function getTokenType() { @@ -254,7 +253,7 @@ public function getTokenType() /** * Sets token_type * - * @param string $token_type OAuth token type + * @param string|null $token_type OAuth token type * * @return $this */ @@ -268,7 +267,7 @@ public function setTokenType($token_type) /** * Gets expires_in * - * @return string + * @return string|null */ public function getExpiresIn() { @@ -278,7 +277,7 @@ public function getExpiresIn() /** * Sets expires_in * - * @param string $expires_in OAuth expity time + * @param string|null $expires_in OAuth expiry time * * @return $this */ diff --git a/lib/Model/OutboundPollResponse.php b/lib/Model/OutboundPollResponse.php index 41de522..cc5c0a4 100644 --- a/lib/Model/OutboundPollResponse.php +++ b/lib/Model/OutboundPollResponse.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class OutboundPollResponse implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class OutboundPollResponse implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'OutboundPollResponse'; + protected static $openAPIModelName = 'OutboundPollResponse'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'to' => 'string', 'sent_timestamp' => 'string', 'received_timestamp' => 'string', @@ -68,7 +68,7 @@ class OutboundPollResponse implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'to' => null, 'sent_timestamp' => null, 'received_timestamp' => null, @@ -80,9 +80,9 @@ class OutboundPollResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -90,9 +90,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -170,7 +170,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -218,15 +218,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets to * - * @return string + * @return string|null */ public function getTo() { @@ -236,7 +235,7 @@ public function getTo() /** * Sets to * - * @param string $to The phone number (recipient) the message was sent to (in E.164 format). + * @param string|null $to The phone number (recipient) the message was sent to (in E.164 format). * * @return $this */ @@ -250,7 +249,7 @@ public function setTo($to) /** * Gets sent_timestamp * - * @return string + * @return string|null */ public function getSentTimestamp() { @@ -260,7 +259,7 @@ public function getSentTimestamp() /** * Sets sent_timestamp * - * @param string $sent_timestamp The date and time when the message was sent. + * @param string|null $sent_timestamp The date and time when the message was sent. * * @return $this */ @@ -274,7 +273,7 @@ public function setSentTimestamp($sent_timestamp) /** * Gets received_timestamp * - * @return string + * @return string|null */ public function getReceivedTimestamp() { @@ -284,7 +283,7 @@ public function getReceivedTimestamp() /** * Sets received_timestamp * - * @param string $received_timestamp The date and time when the message was recieved by recipient. + * @param string|null $received_timestamp The date and time when the message was recieved by recipient. * * @return $this */ @@ -298,7 +297,7 @@ public function setReceivedTimestamp($received_timestamp) /** * Gets delivery_status * - * @return \Telstra_Messaging\Model\Status + * @return \Telstra_Messaging\Model\Status|null */ public function getDeliveryStatus() { @@ -308,7 +307,7 @@ public function getDeliveryStatus() /** * Sets delivery_status * - * @param \Telstra_Messaging\Model\Status $delivery_status delivery_status + * @param \Telstra_Messaging\Model\Status|null $delivery_status delivery_status * * @return $this */ diff --git a/lib/Model/ProvisionNumberRequest.php b/lib/Model/ProvisionNumberRequest.php index 910c67f..495278b 100644 --- a/lib/Model/ProvisionNumberRequest.php +++ b/lib/Model/ProvisionNumberRequest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ProvisionNumberRequest implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class ProvisionNumberRequest implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'ProvisionNumberRequest'; + protected static $openAPIModelName = 'ProvisionNumberRequest'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'active_days' => 'int', 'notify_url' => 'string', 'callback_data' => 'string' @@ -67,7 +67,7 @@ class ProvisionNumberRequest implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'active_days' => 'int32', 'notify_url' => null, 'callback_data' => null @@ -78,9 +78,9 @@ class ProvisionNumberRequest implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -88,9 +88,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -165,7 +165,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -212,15 +212,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets active_days * - * @return int + * @return int|null */ public function getActiveDays() { @@ -230,7 +229,7 @@ public function getActiveDays() /** * Sets active_days * - * @param int $active_days The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. + * @param int|null $active_days The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. * * @return $this */ @@ -244,7 +243,7 @@ public function setActiveDays($active_days) /** * Gets notify_url * - * @return string + * @return string|null */ public function getNotifyUrl() { @@ -254,7 +253,7 @@ public function getNotifyUrl() /** * Sets notify_url * - * @param string $notify_url A callback URL that will be POSTed to whenever a new message arrives at this destination address. If this is not provided then you can make use the Get Replies API to poll for messages. + * @param string|null $notify_url A notification URL that will be POSTed to whenever a new message (e.g. a reply to a message sent) arrives at this destination address. If this is not provided then you can use the Get /sms or /mms API to poll for reply messages. *Please note that the notification URLs and the Get /sms or /mms call are exclusive. If a notification URL has been set then the GET call will not provide any useful information.* * * @return $this */ @@ -268,7 +267,7 @@ public function setNotifyUrl($notify_url) /** * Gets callback_data * - * @return string + * @return string|null */ public function getCallbackData() { @@ -278,7 +277,7 @@ public function getCallbackData() /** * Sets callback_data * - * @param string $callback_data A JSON that will be sent as the body in the POST to the notifyURL. This can be any meaningful data relevant to your application. + * @param string|null $callback_data A JSON that will be sent as the body in the POST to the notifyURL. This can be any meaningful data relevant to your application. * * @return $this */ diff --git a/lib/Model/ProvisionNumberResponse.php b/lib/Model/ProvisionNumberResponse.php index 4b9c3df..dde11a2 100644 --- a/lib/Model/ProvisionNumberResponse.php +++ b/lib/Model/ProvisionNumberResponse.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ProvisionNumberResponse implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class ProvisionNumberResponse implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'ProvisionNumberResponse'; + protected static $openAPIModelName = 'ProvisionNumberResponse'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'destination_address' => 'string' ]; @@ -65,7 +65,7 @@ class ProvisionNumberResponse implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'destination_address' => null ]; @@ -74,9 +74,9 @@ class ProvisionNumberResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -84,9 +84,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -155,7 +155,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -200,15 +200,14 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } /** * Gets destination_address * - * @return string + * @return string|null */ public function getDestinationAddress() { @@ -218,7 +217,7 @@ public function getDestinationAddress() /** * Sets destination_address * - * @param string $destination_address The mobile phone number that was allocated + * @param string|null $destination_address The mobile phone number that was allocated * * @return $this */ diff --git a/lib/Model/SendMmsRequest.php b/lib/Model/SendMmsRequest.php index ba88a73..88c8b0f 100644 --- a/lib/Model/SendMmsRequest.php +++ b/lib/Model/SendMmsRequest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class SendMmsRequest implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class SendMmsRequest implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'SendMmsRequest'; + protected static $openAPIModelName = 'SendMmsRequest'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'from' => 'string', 'to' => 'string', 'subject' => 'string', @@ -70,7 +70,7 @@ class SendMmsRequest implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'from' => null, 'to' => null, 'subject' => null, @@ -84,9 +84,9 @@ class SendMmsRequest implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -94,9 +94,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -180,7 +180,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -245,23 +245,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['from'] === null) { - return false; - } - if ($this->container['to'] === null) { - return false; - } - if ($this->container['subject'] === null) { - return false; - } - if ($this->container['reply_request'] === null) { - return false; - } - if ($this->container['mms_content'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -302,7 +286,7 @@ public function getTo() /** * Sets to * - * @param string $to This is the destination address. + * @param string $to This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] * * @return $this */ @@ -364,7 +348,7 @@ public function setReplyRequest($reply_request) /** * Gets notify_url * - * @return string + * @return string|null */ public function getNotifyUrl() { @@ -374,7 +358,7 @@ public function getNotifyUrl() /** * Sets notify_url * - * @param string $notify_url Notify url + * @param string|null $notify_url Notify url * * @return $this */ @@ -398,7 +382,7 @@ public function getMmsContent() /** * Sets mms_content * - * @param \Telstra_Messaging\Model\MMSContent[] $mms_content An Array of content that will be sent in an MMS message. If this array is present it will cause the body element to be ignored, and the message will be sent as an MMS. + * @param \Telstra_Messaging\Model\MMSContent[] $mms_content An array of content that will be sent in an MMS message. If this array is present it will cause the `body` element to be ignored, and the message will be sent as an MMS. * * @return $this */ diff --git a/lib/Model/SendSMSRequest.php b/lib/Model/SendSMSRequest.php index bcde64e..49a9d83 100644 --- a/lib/Model/SendSMSRequest.php +++ b/lib/Model/SendSMSRequest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class SendSMSRequest implements ModelInterface, ArrayAccess { @@ -49,14 +49,14 @@ class SendSMSRequest implements ModelInterface, ArrayAccess * * @var string */ - protected static $swaggerModelName = 'SendSMSRequest'; + protected static $openAPIModelName = 'SendSMSRequest'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static $openAPITypes = [ 'to' => 'string', 'body' => 'string', 'from' => 'string', @@ -72,7 +72,7 @@ class SendSMSRequest implements ModelInterface, ArrayAccess * * @var string[] */ - protected static $swaggerFormats = [ + protected static $openAPIFormats = [ 'to' => null, 'body' => null, 'from' => null, @@ -88,9 +88,9 @@ class SendSMSRequest implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerTypes() + public static function openAPITypes() { - return self::$swaggerTypes; + return self::$openAPITypes; } /** @@ -98,9 +98,9 @@ public static function swaggerTypes() * * @return array */ - public static function swaggerFormats() + public static function openAPIFormats() { - return self::$swaggerFormats; + return self::$openAPIFormats; } /** @@ -190,7 +190,7 @@ public static function getters() */ public function getModelName() { - return self::$swaggerModelName; + return self::$openAPIModelName; } @@ -248,14 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['to'] === null) { - return false; - } - if ($this->container['body'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -272,7 +265,7 @@ public function getTo() /** * Sets to * - * @param string $to Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. Can be an array of strings if sending to multiple numbers: `\"to\": \"+61412345678, +61418765432\"` + * @param string $to Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. Can be an array of strings if sending to multiple numbers: `\"to\":[\"+61412345678\", \"+61418765432\"]` * * @return $this */ @@ -310,7 +303,7 @@ public function setBody($body) /** * Gets from * - * @return string + * @return string|null */ public function getFrom() { @@ -320,7 +313,7 @@ public function getFrom() /** * Sets from * - * @param string $from The Alphanumeric sender ID of up to 11 characters or phone number the SMS was sent from. If not present, the service will use the mobile number associated with the application (in E.164 format). This feature is only available on paid plans. + * @param string|null $from The Alphanumeric sender ID of up to 11 characters or phone number the SMS was sent from. If not present, the service will use the mobile number associated with the application (in E.164 format). This feature is only available on paid plans. * * @return $this */ @@ -334,7 +327,7 @@ public function setFrom($from) /** * Gets validity * - * @return int + * @return int|null */ public function getValidity() { @@ -344,7 +337,7 @@ public function getValidity() /** * Sets validity * - * @param int $validity How long the platform should attempt to deliver the message for. This period is specified in minutes from the message. Normally if the message cannot be delivered immediately, it will be stored and delivery will be periodically reattempted. The network will attempt to send the message for up to seven days. It is possible to define a period smaller than 7 days by including this parameter and specifying the number of minutes that delivery should be attempted. eg: including `\"validity\": 60` will specify that if a message can't be delivered within the first 60 minutes them the network should stop. + * @param int|null $validity How long the platform should attempt to deliver the message for. This period is specified in minutes from the message. Normally if the message cannot be delivered immediately, it will be stored and delivery will be periodically reattempted. The network will attempt to send the message for up to seven days. It is possible to define a period smaller than 7 days by including this parameter and specifying the number of minutes that delivery should be attempted. eg: including `\"validity\": 60` will specify that if a message can't be delivered within the first 60 minutes them the network should stop. * * @return $this */ @@ -358,7 +351,7 @@ public function setValidity($validity) /** * Gets scheduled_delivery * - * @return int + * @return int|null */ public function getScheduledDelivery() { @@ -368,7 +361,7 @@ public function getScheduledDelivery() /** * Sets scheduled_delivery * - * @param int $scheduled_delivery How long the platform should wait before attempting to send the message - specified in minutes. e.g.: If `\"scheduledDelivery\": 120` is included, then the network will not attempt to start message delivery for two hours after the message has been submitted + * @param int|null $scheduled_delivery How long the platform should wait before attempting to send the message - specified in minutes. e.g.: If `\"scheduledDelivery\": 120` is included, then the network will not attempt to start message delivery for two hours after the message has been submitted * * @return $this */ @@ -382,7 +375,7 @@ public function setScheduledDelivery($scheduled_delivery) /** * Gets notify_url * - * @return string + * @return string|null */ public function getNotifyUrl() { @@ -392,7 +385,7 @@ public function getNotifyUrl() /** * Sets notify_url * - * @param string $notify_url Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. It is possible for the network to make a call to a URL when the message has been delivered (or has expired), different URLs can be set per message. Please refer to the Delivery Notification section. + * @param string|null $notify_url Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. It is possible for the network to make a call to a URL when the message has been delivered (or has expired), different URLs can be set per message. Please refer to the Delivery Notification section. * * @return $this */ @@ -406,7 +399,7 @@ public function setNotifyUrl($notify_url) /** * Gets reply_request * - * @return bool + * @return bool|null */ public function getReplyRequest() { @@ -416,7 +409,7 @@ public function getReplyRequest() /** * Sets reply_request * - * @param bool $reply_request If set to true, the reply message functionality will be implemented and the to address will be ignored if present. If false or not present, then normal message handling is implemented. When set to true, network will use a temporary number to deliver this message. All messages sent by mobile to this temporary number will be stored against the same `messageId`. If a `notifyURL` is provided then user response will be delivered to the URL where `messageId` will be same as `messageId` in reponse to original API request. This field contains the message text, this can be up to 500 UTF-8 characters. As mobile devices rarely support the full range of UTF-8 characters, it is possible that some characters may not be translated correctly by the mobile device. + * @param bool|null $reply_request If set to true, the reply message functionality will be implemented and the to address will be ignored if present. If false or not present, then normal message handling is implemented. When set to true, network will use a temporary number to deliver this message. All messages sent by mobile to this temporary number will be stored against the same `messageId`. If a `notifyURL` is provided then user response will be delivered to the URL where `messageId` will be same as `messageId` in reponse to original API request. This field contains the message text, this can be up to 500 UTF-8 characters. As mobile devices rarely support the full range of UTF-8 characters, it is possible that some characters may not be translated correctly by the mobile device. * * @return $this */ @@ -430,7 +423,7 @@ public function setReplyRequest($reply_request) /** * Gets priority * - * @return bool + * @return bool|null */ public function getPriority() { @@ -440,7 +433,7 @@ public function getPriority() /** * Sets priority * - * @param bool $priority When messages are queued up for a number, then it is possible to set where a new message will be placed in the queue. If the priority is set to true then the new message will be placed ahead of all messages with a normal priority. If there are no messages queued for the number, then this parameter has no effect. + * @param bool|null $priority When messages are queued up for a number, then it is possible to set where a new message will be placed in the queue. If the priority is set to true then the new message will be placed ahead of all messages with a normal priority. If there are no messages queued for the number, then this parameter has no effect. * * @return $this */ diff --git a/lib/Model/Status.php b/lib/Model/Status.php index 0392ffa..7a4f1a6 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -35,8 +35,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class Status { diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 7492104..1d42bfd 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -34,8 +34,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ObjectSerializer { @@ -43,8 +43,8 @@ class ObjectSerializer * Serialize data * * @param mixed $data the data to serialize - * @param string $type the SwaggerType of the data - * @param string $format the format of the Swagger type of the data + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data * * @return string|object serialized form of $data */ @@ -61,19 +61,19 @@ public static function sanitizeForSerialization($data, $type = null, $format = n return $data; } elseif (is_object($data)) { $values = []; - $formats = $data::swaggerFormats(); - foreach ($data::swaggerTypes() as $property => $swaggerType) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); if ($value !== null - && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($swaggerType, 'getAllowableEnumValues') - && !in_array($value, $swaggerType::getAllowableEnumValues())) { - $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($openAPIType, 'getAllowableEnumValues') + && !in_array($value, $openAPIType::getAllowableEnumValues())) { + $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); } if ($value !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } return (object)$values; @@ -271,7 +271,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // determine file name if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } @@ -299,7 +299,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } } $instance = new $class(); - foreach ($instance::swaggerTypes() as $property => $type) { + foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { diff --git a/test/Api/AuthenticationApiTest.php b/test/Api/AuthenticationApiTest.php index d555b5b..d145efb 100644 --- a/test/Api/AuthenticationApiTest.php +++ b/test/Api/AuthenticationApiTest.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the endpoint. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class AuthenticationApiTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Api/MessagingApiTest.php b/test/Api/MessagingApiTest.php index 41e2e17..b245c00 100644 --- a/test/Api/MessagingApiTest.php +++ b/test/Api/MessagingApiTest.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the endpoint. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MessagingApiTest extends \PHPUnit_Framework_TestCase { @@ -91,6 +91,16 @@ public function testGetSMSStatus() { } + /** + * Test case for retrieveMMSResponses + * + * Retrieve MMS Responses. + * + */ + public function testRetrieveMMSResponses() + { + } + /** * Test case for retrieveSMSResponses * diff --git a/test/Api/ProvisioningApiTest.php b/test/Api/ProvisioningApiTest.php index 463fca4..50e3088 100644 --- a/test/Api/ProvisioningApiTest.php +++ b/test/Api/ProvisioningApiTest.php @@ -5,24 +5,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the endpoint. */ @@ -37,8 +37,8 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ProvisioningApiTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/DeleteNumberRequestTest.php b/test/Model/DeleteNumberRequestTest.php index 143f7c2..9131019 100644 --- a/test/Model/DeleteNumberRequestTest.php +++ b/test/Model/DeleteNumberRequestTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * DeleteNumberRequestTest Class Doc Comment * - * @category Class */ -// * @description DeleteNumberRequest -/** + * @category Class + * @description DeleteNumberRequest * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class DeleteNumberRequestTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/GetSubscriptionResponseTest.php b/test/Model/GetSubscriptionResponseTest.php index 2e40999..4fb576a 100644 --- a/test/Model/GetSubscriptionResponseTest.php +++ b/test/Model/GetSubscriptionResponseTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * GetSubscriptionResponseTest Class Doc Comment * - * @category Class */ -// * @description GetSubscriptionResponse -/** + * @category Class + * @description GetSubscriptionResponse * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class GetSubscriptionResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/InboundPollResponseTest.php b/test/Model/InboundPollResponseTest.php index e799517..d0d836a 100644 --- a/test/Model/InboundPollResponseTest.php +++ b/test/Model/InboundPollResponseTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * InboundPollResponseTest Class Doc Comment * - * @category Class */ -// * @description Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. -/** + * @category Class + * @description Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class InboundPollResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/MMSContentTest.php b/test/Model/MMSContentTest.php index a0107fa..e2c7217 100644 --- a/test/Model/MMSContentTest.php +++ b/test/Model/MMSContentTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * MMSContentTest Class Doc Comment * - * @category Class */ -// * @description MMSContent -/** + * @category Class + * @description MMSContent * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MMSContentTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/MessageSentResponseTest.php b/test/Model/MessageSentResponseTest.php index 0cb85e0..d3d20df 100644 --- a/test/Model/MessageSentResponseTest.php +++ b/test/Model/MessageSentResponseTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * MessageSentResponseTest Class Doc Comment * - * @category Class */ -// * @description MessageSentResponse -/** + * @category Class + * @description MessageSentResponse * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MessageSentResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/MessageTest.php b/test/Model/MessageTest.php index 7a090de..4b71f08 100644 --- a/test/Model/MessageTest.php +++ b/test/Model/MessageTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * MessageTest Class Doc Comment * - * @category Class */ -// * @description Message -/** + * @category Class + * @description Message * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class MessageTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/OAuthResponseTest.php b/test/Model/OAuthResponseTest.php index faa2915..0b628bb 100644 --- a/test/Model/OAuthResponseTest.php +++ b/test/Model/OAuthResponseTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * OAuthResponseTest Class Doc Comment * - * @category Class */ -// * @description OAuthResponse -/** + * @category Class + * @description OAuthResponse * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class OAuthResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/OutboundPollResponseTest.php b/test/Model/OutboundPollResponseTest.php index 7340e11..cf6489c 100644 --- a/test/Model/OutboundPollResponseTest.php +++ b/test/Model/OutboundPollResponseTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * OutboundPollResponseTest Class Doc Comment * - * @category Class */ -// * @description OutboundPollResponse -/** + * @category Class + * @description OutboundPollResponse * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class OutboundPollResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/ProvisionNumberRequestTest.php b/test/Model/ProvisionNumberRequestTest.php index 653a0c7..2f396de 100644 --- a/test/Model/ProvisionNumberRequestTest.php +++ b/test/Model/ProvisionNumberRequestTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * ProvisionNumberRequestTest Class Doc Comment * - * @category Class */ -// * @description ProvisionNumberRequest -/** + * @category Class + * @description ProvisionNumberRequest * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ProvisionNumberRequestTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/ProvisionNumberResponseTest.php b/test/Model/ProvisionNumberResponseTest.php index c7c5ad6..b29b062 100644 --- a/test/Model/ProvisionNumberResponseTest.php +++ b/test/Model/ProvisionNumberResponseTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * ProvisionNumberResponseTest Class Doc Comment * - * @category Class */ -// * @description ProvisionNumberResponse -/** + * @category Class + * @description ProvisionNumberResponse * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class ProvisionNumberResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/SendMmsRequestTest.php b/test/Model/SendMmsRequestTest.php index e486f33..87a01f3 100644 --- a/test/Model/SendMmsRequestTest.php +++ b/test/Model/SendMmsRequestTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * SendMmsRequestTest Class Doc Comment * - * @category Class */ -// * @description SendMmsRequest -/** + * @category Class + * @description SendMmsRequest * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class SendMmsRequestTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/SendSMSRequestTest.php b/test/Model/SendSMSRequestTest.php index 79d4066..6f26835 100644 --- a/test/Model/SendSMSRequestTest.php +++ b/test/Model/SendSMSRequestTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * SendSMSRequestTest Class Doc Comment * - * @category Class */ -// * @description SendSMSRequest -/** + * @category Class + * @description SendSMSRequest * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class SendSMSRequestTest extends \PHPUnit_Framework_TestCase { diff --git a/test/Model/StatusTest.php b/test/Model/StatusTest.php index 349490b..d82f423 100644 --- a/test/Model/StatusTest.php +++ b/test/Model/StatusTest.php @@ -6,24 +6,24 @@ * * @category Class * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ /** * Telstra Messaging API * - * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features

The Telstra Messaging API provides the features below.
Feature Description
Dedicated Number Provision a mobile number for your account to be used as from address in the API
Send Messages Sending SMS or MMS messages
Receive Messages Telstra will deliver messages sent to a dedicated number or to the notifyURL defined by you
Broadcast Messages Invoke a single API to send a message to a list of number provided in to
Delivery Status Query the delivery status of your messages
Callbacks Provide a notification URL and Telstra will notify your app when messages status changes
Alphanumeric Identifier Differentiate yourself by providing an alphanumeric string in from. This feature is only available on paid plans
Concatenation Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them
Reply Request Create a chat session by associating messageId and to number to track responses received from a mobile number. We will store this association for 8 days
Character set Accepts all Unicode characters as part of UTF-8
Bounce-back response See if your SMS hits an unreachable or unallocated number (Australia Only)
Queuing Messaging API will automatically queue and deliver each message at a compliant rate.
Emoji Encoding The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.
# Getting Access to the API

  1. Register at https://dev.telstra.com.
  2. After registration, login to https://dev.telstra.com and navigate to the "My apps" page.
  3. Create your application by clicking the "Add new app" button
  4. Select "API Free Trial" Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically.
  5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from https://dev.telstra.com.
  6. Note your Client key and Client secret as these will be needed to provision a number for your application and for authentication.

Now head over to Getting Started where you can find a postman collection as well as some links to sample apps and SDKs to get you started.

Happy Messaging! # Getting Started

Below are the steps to get started with the Telstra Messaging API.

  1. Generate OAuth2 Token using your Client key and Client secret.
  2. Create Subscription in order to receive a provisioned number.
  3. Send Message to a specific mobile number.

Run in Postman

\"Run

Sample Apps

- Perl Sample App - Happy Chat App - PHP Sample App

SDK repos

- Messaging API - PHP SDK - Messaging API - Python SDK - Messaging API - Ruby SDK - Messaging API - NodeJS SDK - Messaging API - .Net2 SDK - Messaging API - Java SDK # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination.
  1. When you provision a number there is an opportunity to specify a notifyURL, when the message has been delivered the API will make a call to this URL to advise of the message status. If this is not provided then you can make use the Get Replies API to poll for messages.
  2. If you do not specify a URL you can always call the GET /sms API get the latest replies to the message.
Please note that the notification URLs and the polling call are exclusive. If a notification URL has been set then the polling call will not provide any useful information.

Notification URL Format

When a message has reached its final state, the API will send a POST to the URL that has been previously specified.

Notification URL Format for SMS

{     to: '+61418123456'     sentTimestamp: '2017-03-17T10:05:22+10:00'     receivedTimestamp: '2017-03-17T10:05:23+10:00'     messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456     deliveryStatus: DELIVRD   } 
\\ The fields are:
Field Description
to The number the message was sent to.
receivedTimestamp Time the message was sent to the API.
sentTimestamp Time handling of the message ended.
deliveryStatus The final state of the message.
messageId The same reference that was returned when the original message was sent.
receivedTimestamp Time the message was sent to the API.
Upon receiving this call it is expected that your servers will give a 204 (No Content) response. Anything else will cause the API to reattempt the call 5 minutes later.

Notification URL Format for SMS Replies

{     \"status\": \"RECEIVED\"     \"destinationAddress\": \"+61418123456\"     \"senderAddress\": \"+61421987654\"     \"message\": \"Foo\"             \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\"   }                              
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
message The sontent of the SMS reply.
sentTimestamp Time handling of the message ended.

Notification URL Format for MMS Replies

{     \"status\": \"RECEIVED\",     \"destinationAddress\": \"+61418123456\",     \"senderAddress\": \"+61421987654\",     \"subject\": \"Foo\",     \"sentTimestamp\": \"2018-03-23T12:15:45+10:00\",     \"envelope\": \"string\",     \"MMSContent\":      [       {         \"type\": \"application/smil\",         \"filename\": \"smil.xml\",         \"payload\": \"string\"       },        {         \"type\": \"image/jpeg\",         \"filename\": \"sample.jpeg\",         \"payload\": \"string\"        }      ]    } 
\\ The fields are:
Field Description
status The final state of the message.
destinationAddress The number the message was sent to.
senderAddress The number the message was sent from.
subject The subject assigned to the message.
sentTimestamp Time handling of the message ended.
envelope Information about about terminal type and originating operator.
MMSContent An array of the actual content of the reply message.
type The content type of the message.
filename The filename for the message content.
payload The content of the message.
# Frequently Asked Questions **Q: Can I send a broadcast message using the Telstra Messging API?** A. Yes. Recipient numbers can be in teh form of an array of strings if a broadcast message needs to be sent.

Notes

View messaging in Swagger UI + * # Introduction Send and receive SMS and MMS messages globally using Telstra’s enterprise grade Messaging API. It also allows your application to track the delivery status of both sent and received messages. Get your dedicated Australian number, and start sending and receiving messages today. # Features The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on paid plans | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format. | ## Delivery Notification or Callbacks The API provides several methods for notifying when a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30-days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) * * OpenAPI spec version: 2.2.6 * - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 3.0.1 */ /** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Please update the test case below to test the model. */ @@ -32,12 +32,11 @@ /** * StatusTest Class Doc Comment * - * @category Class */ -// * @description Status -/** + * @category Class + * @description Status * @package Telstra_Messaging - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @author OpenAPI Generator team + * @link https://openapi-generator.tech */ class StatusTest extends \PHPUnit_Framework_TestCase {