diff --git a/README.md b/README.md index 773d44e..db8cb06 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ TelstraMessaging - JavaScript client for Telstra_Messaging - API version: 2.2.6 -- Package version: 1.0.4 +- Package version: 1.0.4.1 ## Installation @@ -92,13 +92,9 @@ Please follow the [installation](#installation) instruction and execute the foll var TelstraMessaging = require('Telstra_Messaging'); var api = new TelstraMessaging.AuthenticationApi() - var clientId = "clientId_example"; // {String} - var clientSecret = "clientSecret_example"; // {String} - -var grantType = "client_credentials"; // {String} - +var grantType = "'client_credentials'"; // {String} var callback = function(error, data, response) { if (error) { @@ -120,6 +116,7 @@ Class | Method | HTTP request | Description *TelstraMessaging.AuthenticationApi* | [**authToken**](docs/AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate OAuth2 token *TelstraMessaging.MessagingApi* | [**getMMSStatus**](docs/MessagingApi.md#getMMSStatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status *TelstraMessaging.MessagingApi* | [**getSMSStatus**](docs/MessagingApi.md#getSMSStatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status +*TelstraMessaging.MessagingApi* | [**retrieveMMSResponses**](docs/MessagingApi.md#retrieveMMSResponses) | **GET** /messages/mms | Retrieve MMS Responses *TelstraMessaging.MessagingApi* | [**retrieveSMSResponses**](docs/MessagingApi.md#retrieveSMSResponses) | **GET** /messages/sms | Retrieve SMS Responses *TelstraMessaging.MessagingApi* | [**sendMMS**](docs/MessagingApi.md#sendMMS) | **POST** /messages/mms | Send MMS *TelstraMessaging.MessagingApi* | [**sendSMS**](docs/MessagingApi.md#sendSMS) | **POST** /messages/sms | Send SMS diff --git a/docs/AuthenticationApi.md b/docs/AuthenticationApi.md index 00bac8d..3ae5df8 100644 --- a/docs/AuthenticationApi.md +++ b/docs/AuthenticationApi.md @@ -13,21 +13,16 @@ 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 &quot;API Free Trial&quot; Product. The grant_type should be left as `client_credentials` and the scope as `NSMS`. The token will expire in one hour. <pre><code class=\"language-sh\"> #!/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&amp;client_id=$CLIENT_KEY&amp;client_secret=CLIENT_SECRET&amp;scope=NSMS' \\ 'https://tapi.telstra.com/v2/oauth/token' </code></pre> +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 ```javascript var TelstraMessaging = require('Telstra_Messaging'); var apiInstance = new TelstraMessaging.AuthenticationApi(); - var clientId = "clientId_example"; // String | - var clientSecret = "clientSecret_example"; // String | - -var grantType = "client_credentials"; // String | - - +var grantType = "'client_credentials'"; // String | var callback = function(error, data, response) { if (error) { console.error(error); @@ -44,7 +39,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **clientId** | **String**| | **clientSecret** | **String**| | - **grantType** | **String**| | [default to client_credentials] + **grantType** | **String**| | [default to 'client_credentials'] ### Return type diff --git a/docs/InboundPollResponse.md b/docs/InboundPollResponse.md index 5d10c8f..950e423 100644 --- a/docs/InboundPollResponse.md +++ b/docs/InboundPollResponse.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **String** | message status | [optional] -**destinationAddress** | **String** | The phone number (recipient) that the message was sent to(in E.164 format). | [optional] -**senderAddress** | **String** | The phone number (sender) that the message was sent from (in E.164 format). | [optional] +**destinationAddress** | **String** | The phone number (recipient) that the message was sent to (in E.164 format). | [optional] +**senderAddress** | **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] **messageId** | **String** | Message Id | [optional] **sentTimestamp** | **String** | The date and time when the message was sent by recipient. | [optional] diff --git a/docs/MMSContent.md b/docs/MMSContent.md index 54f3c55..2586b59 100644 --- a/docs/MMSContent.md +++ b/docs/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/MessagingApi.md b/docs/MessagingApi.md index 8840dc2..0834708 100644 --- a/docs/MessagingApi.md +++ b/docs/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 @@ -23,16 +24,12 @@ Get MMS Status ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.MessagingApi(); - -var 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 - - +var 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 var callback = function(error, data, response) { if (error) { console.error(error); @@ -47,7 +44,7 @@ apiInstance.getMMSStatus(messageid, callback); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **messageid** | **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** | **String**| Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms | ### Return type @@ -59,7 +56,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json @@ -68,22 +65,18 @@ Name | Type | Description | Notes Get SMS Status -If no notification URL has been specified, it is possible to poll for the message status. <pre><code class=\"language-sh\"> #!/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\" </code></pre> 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. <pre><code class=\"language-sh\">{ to: '+61418123456' sentTimestamp: '2017-03-17T10:05:22+10:00' receivedTimestamp: '2017-03-17T10:05:23+10:00' messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456 deliveryStatus: DELIVRD } </code></pre> The fields are: <table> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>to</code></td> <td>The number the message was sent to.</td> </tr> <tr> <td><code>receivedTimestamp</code></td> <td>Time the message was sent to the API.</td> </tr> <tr> <td><code>sentTimestamp</code></td> <td>Time handling of the message ended.</td> </tr> <tr> <td><code>deliveryStatus</code></td> <td>The final state of the message.</td> </tr> <tr> <td><code>messageId</code></td> <td>The same reference that was returned when the original message was sent.</td> </tr> <tr> <td><code>receivedTimestamp</code></td> <td>Time the message was sent to the API.</td> </tr> </tbody> </table> 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 ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.MessagingApi(); - -var 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/sms. - - +var 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/sms. var callback = function(error, data, response) { if (error) { console.error(error); @@ -98,7 +91,7 @@ apiInstance.getSMSStatus(messageId, callback); Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **messageId** | **String**| Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. | + **messageId** | **String**| Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. | ### Return type @@ -110,7 +103,50 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **retrieveMMSResponses** +> [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 <pre><code class=\"language-sh\">{ \"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\" } ] }</code></pre> 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 +```javascript +var TelstraMessaging = require('Telstra_Messaging'); +var defaultClient = TelstraMessaging.ApiClient.instance; +// Configure OAuth2 access token for authorization: auth +var auth = defaultClient.authentications['auth']; +auth.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new TelstraMessaging.MessagingApi(); +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.retrieveMMSResponses(callback); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**[MMSContent]**](MMSContent.md) + +### Authorization + +[auth](../README.md#auth) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json @@ -119,19 +155,17 @@ 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 <pre><code class=\"language-sh\">{ \"to\":\"+61472880123\", \"from\":\"+61412345678\", \"body\":\"Foo4\", \"sentTimestamp\":\"2018-04-20T14:24:35\", \"messageId\":\"DMASApiA0000000146\" }</code></pre> 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 ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.MessagingApi(); - var callback = function(error, data, response) { if (error) { console.error(error); @@ -155,12 +189,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json # **sendMMS** -> MessageSentResponse sendMMS(body) +> MessageSentResponse sendMMS(sendMmsRequest) Send MMS @@ -170,15 +204,13 @@ Send MMS ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.MessagingApi(); - -var body = new TelstraMessaging.SendMmsRequest(); // 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 - +var sendMmsRequest = new TelstraMessaging.SendMmsRequest(); // 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. var callback = function(error, data, response) { if (error) { @@ -187,14 +219,16 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.sendMMS(body, callback); +apiInstance.sendMMS(sendMmsRequest, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SendMmsRequest**](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 | + **sendMmsRequest** | [**SendMmsRequest**](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 @@ -211,25 +245,23 @@ Name | Type | Description | Notes # **sendSMS** -> MessageSentResponse sendSMS(payload) +> MessageSentResponse sendSMS(sendSMSRequest) Send SMS -Send an SMS Message to a single or multiple mobile number/s. <h3>Send message to a single number: </h3> <pre><code class=\"language-sh\"> #!/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\" </code></pre> \\ <h3>Send message to multiple numbers: </h3> <pre><code class=\"language-sh\"> #!/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 <pre><code class=\"language-sh\"> +Send an SMS Message to a single or multiple mobile number/s. ### Example ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.MessagingApi(); - -var payload = new TelstraMessaging.SendSMSRequest(); // 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. - +var sendSMSRequest = new TelstraMessaging.SendSMSRequest(); // 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. var callback = function(error, data, response) { if (error) { @@ -238,14 +270,16 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.sendSMS(payload, callback); +apiInstance.sendSMS(sendSMSRequest, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **payload** | [**SendSMSRequest**](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. | + **sendSMSRequest** | [**SendSMSRequest**](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/OAuthResponse.md b/docs/OAuthResponse.md index e4cc939..24cadec 100644 --- a/docs/OAuthResponse.md +++ b/docs/OAuthResponse.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **accessToken** | **String** | OAuth access token | [optional] **tokenType** | **String** | OAuth token type | [optional] -**expiresIn** | **String** | OAuth expity time | [optional] +**expiresIn** | **String** | OAuth expiry time | [optional] diff --git a/docs/ProvisionNumberRequest.md b/docs/ProvisionNumberRequest.md index 0cb1779..bf8cdc2 100644 --- a/docs/ProvisionNumberRequest.md +++ b/docs/ProvisionNumberRequest.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activeDays** | **Number** | The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. | [optional] -**notifyURL** | **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] -**callbackData** | **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] +**activeDays** | **Number** | The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. | [optional] +**notifyURL** | **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] +**callbackData** | **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] diff --git a/docs/ProvisioningApi.md b/docs/ProvisioningApi.md index 585431a..15d902b 100644 --- a/docs/ProvisioningApi.md +++ b/docs/ProvisioningApi.md @@ -11,26 +11,22 @@ Method | HTTP request | Description # **createSubscription** -> ProvisionNumberResponse createSubscription(body) +> ProvisionNumberResponse createSubscription(provisionNumberRequest) Create Subscription -Invoke the provisioning API to get a dedicated mobile number for an account or application. <pre><code class=\"language-sh\"> #!/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\" } }' </code></pre> +Invoke the provisioning API to get a dedicated mobile number for an account or application. ### Example ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.ProvisioningApi(); - -var body = new TelstraMessaging.ProvisionNumberRequest(); // ProvisionNumberRequest | A JSON payload containing the required attributes - - +var provisionNumberRequest = new TelstraMessaging.ProvisionNumberRequest(); // ProvisionNumberRequest | A JSON payload containing the required attributes var callback = function(error, data, response) { if (error) { console.error(error); @@ -38,14 +34,14 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -apiInstance.createSubscription(body, callback); +apiInstance.createSubscription(provisionNumberRequest, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ProvisionNumberRequest**](ProvisionNumberRequest.md)| A JSON payload containing the required attributes | + **provisionNumberRequest** | [**ProvisionNumberRequest**](ProvisionNumberRequest.md)| A JSON payload containing the required attributes | ### Return type @@ -62,26 +58,22 @@ Name | Type | Description | Notes # **deleteSubscription** -> deleteSubscription(body) +> deleteSubscription(deleteNumberRequest) Delete Subscription -Delete a mobile number subscription from an account +Delete a mobile number subscription from an account ### Example ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.ProvisioningApi(); - -var body = new TelstraMessaging.DeleteNumberRequest(); // DeleteNumberRequest | EmptyArr - - +var deleteNumberRequest = new TelstraMessaging.DeleteNumberRequest(); // DeleteNumberRequest | EmptyArr var callback = function(error, data, response) { if (error) { console.error(error); @@ -89,14 +81,14 @@ var callback = function(error, data, response) { console.log('API called successfully.'); } }; -apiInstance.deleteSubscription(body, callback); +apiInstance.deleteSubscription(deleteNumberRequest, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**DeleteNumberRequest**](DeleteNumberRequest.md)| EmptyArr | + **deleteNumberRequest** | [**DeleteNumberRequest**](DeleteNumberRequest.md)| EmptyArr | ### Return type @@ -109,7 +101,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined # **getSubscription** @@ -117,19 +109,17 @@ null (empty response body) Get Subscription -Get mobile number subscription for an account +Get mobile number subscription for an account ### Example ```javascript var TelstraMessaging = require('Telstra_Messaging'); var defaultClient = TelstraMessaging.ApiClient.instance; - // Configure OAuth2 access token for authorization: auth var auth = defaultClient.authentications['auth']; auth.accessToken = 'YOUR ACCESS TOKEN'; var apiInstance = new TelstraMessaging.ProvisioningApi(); - var callback = function(error, data, response) { if (error) { console.error(error); @@ -153,6 +143,6 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json diff --git a/docs/SendMmsRequest.md b/docs/SendMmsRequest.md index 90ac622..3bf311a 100644 --- a/docs/SendMmsRequest.md +++ b/docs/SendMmsRequest.md @@ -3,11 +3,11 @@ ## Properties 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. | +**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. 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. | **replyRequest** | **Boolean** | If set to true, the reply message functionality will be implemented and the to address will be ignored if present. | **notifyURL** | **String** | Notify url | [optional] -**mMSContent** | [**[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. | +**mMSContent** | [**[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. | diff --git a/docs/SendSMSRequest.md b/docs/SendSMSRequest.md index 6f17c3e..da56eef 100644 --- a/docs/SendSMSRequest.md +++ b/docs/SendSMSRequest.md @@ -3,8 +3,8 @@ ## 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\"` | -**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 | +**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** | **Number** | 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] **scheduledDelivery** | **Number** | 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 | [optional] diff --git a/package.json b/package.json index 6c5ae1e..6e4869e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "Telstra_Messaging", "version": "1.0.4", - "description": "_IntroductionSend_and_receive_SMS_and_MMS_messages_globally_using_Telstras_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__FeaturespThe_Telstra_Messaging_API_provides_the_features_below_table__thead____tr______thFeatureth______thDescriptionth____tr__thead__tbody____tr______tdcodeDedicated_Numbercodetd______tdProvision_a_mobile_number_for_your_account_to_be_used_as_from_address_in_the_APItd____tr____tr______tdcodeSend_Messagescodetd______tdSending_SMS_or_MMS_messagestd____tr____tr______tdcodeReceive_Messagescodetd______tdTelstra_will_deliver_messages_sent_to_a_dedicated_number_or_to_the_codenotifyURLcode_defined_by_youtd____tr____tr______tdcodeBroadcast_Messagescodetd______tdInvoke_a_single_API_to_send_a_message_to_a_list_of_number_provided_in_codetocodetd____tr____tr______tdcodeDelivery_Statuscodetd______tdQuery_the_delivery_status_of_your_messagestd____tr____tr______tdcodeCallbackscodetd______tdProvide_a_notification_URL_and_Telstra_will_notify_your_app_when_messages_status_changestd____tr____tr______tdcodeAlphanumeric_Identifiercodetd______tdDifferentiate_yourself_by_providing_an_alphanumeric_string_in_codefromcode__This_feature_is_only_available_on_paid_planstd____tr____tr______tdcodeConcatenationcodetd______tdSend_messages_up_to_1900_characters_long_and_Telstra_will_automaticaly_segment_and_reassemble_themtd____tr____tr______tdcodeReply_Requestcodetd______tdCreate_a_chat_session_by_associating_codemessageIdcode_and_codetocode_number_to_track_responses_received_from_a_mobile_number__We_will_store_this_association_for_8_daystd____tr____tr______tdcodeCharacter_setcodetd______tdAccepts_all_Unicode_characters_as_part_of_UTF_8td____tr____tr______tdcodeBounce_back_responsecodetd______tdSee_if_your_SMS_hits_an_unreachable_or_unallocated_number__Australia_Onlytd____tr____tr______tdcodeQueuingcodetd______tdMessaging_API_will_automatically_queue_and_deliver_each_message_at_a_compliant_rate_td____tr____tr______tdcodeEmoji_Encodingcodetd______tdThe_API_supports_the_encoding_of_the_full_range_of_emojis__Emojis_in_the_reply_messages_will_be_in_their_UTF_8_format_td____tr__tbodytable_Getting_Access_to_the_APIol__liRegister_at_a_hrefhttpsdev_telstra_comhttpsdev_telstra_coma___liAfter_registration_login_to_a_hrefhttpsdev_telstra_comhttpsdev_telstra_coma_______and_navigate_to_the_quotMy_appsquot_page____liCreate_your_application_by_clicking_the_quotAdd_new_appquot_button___liSelect_quotAPI_Free_Trialquot_Product_when_configuring_your_application__This_Product_includes_the_Telstra_Messaging_API_as_well_as_other_APIs__Your_application_will_be_approved_automatically___liThere_is_a_maximum_of_1000_free_messages_per_developer__Additional_messages_and_features_can_be_purchased_from_a_hrefhttpsdev_telstra_comhttpsdev_telstra_coma___liNote_your_codeClient_keycode_and_codeClient_secretcode_as_these_will_be_needed_to_provision_a_number_for_your_application_and_for_authentication_olpNow_head_over_to_bGetting_Startedb_where_you_can_find_a_postmancollection_as_well_as_some_links_to_sample_apps_and_SDKs_to_get_you_started_pHappy_Messaging_Getting_StartedpBelow_are_the_steps_to_get_started_with_the_Telstra_Messaging_API_p__ol____liGenerate_OAuth2_Token_using_your_codeClient_keycode_and_codeClient_secretcode_li____liCreate_Subscription_in_order_to_receive_a_provisioned_number_li____liSend_Message_to_a_specific_mobile_number_li__ol__h2Run_in_Postmanh2__pa__hrefhttpsapp_getpostman_comrun_collectionded00578f69a9deba256env5BMessaging20API20Environments5DW3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X2lkIiwidmFsdWUiOiIiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6ImFjY2Vzc190b2tlbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Imhvc3QiLCJ2YWx1ZSI6InRhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiQXV0aG9yaXphdGlvbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Im9hdXRoX2hvc3QiLCJ2YWx1ZSI6InNhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoibWVzc2FnZV9pZCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifV0__img_srchttpsrun_pstmn_iobutton_svg_altRun_in_Postman_ap__h2Sample_Appsh2____a_hrefhttpsgithub_comtelstraMessagingAPI_perl_sample_appPerl_Sample_Appa____a_hrefhttpsgithub_comtelstramessaging_sample_code_happy_chatHappy_Chat_Appa____a_hrefhttpsgithub_comdeveloperstevetelstra_messaging_phpPHP_Sample_Appa__h2SDK_reposh2____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_phpMessaging_API___PHP_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_pythonMessaging_API___Python_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_rubyMessaging_API___Ruby_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_nodeMessaging_API___NodeJS_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_dotnetMessaging_API____Net2_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_JavaMessaging_API___Java_SDKa_Delivery_NotificationThe_API_provides_several_methods_for_notifying_when_a_message_has_been_delivered_to_the_destination_ol__liWhen_you_provision_a_number_there_is_an_opportunity_to_specify_a_codenotifyURLcode_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_li__liIf_you_do_not_specify_a_URL_you_can_always_call_the_codeGET_smscode_API_get_the_latest_replies_to_the_message_liolIPlease_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_Ih2Notification_URL_Formath2When_a_message_has_reached_its_final_state_the_API_will_send_a_POST_to_the_URL_that_has_been_previously_specified__h3Notification_URL_Format_for_SMSh3precode_classlanguage_sh____to_61418123456____sentTimestamp_2017_03_17T1005221000____receivedTimestamp_2017_03_17T1005231000____messageId_cccb284200035236000000000ee9d074019e03011261418123456____deliveryStatus_DELIVRD__codepreThe_fields_are_table__thead____tr______thFieldth______thDescriptionth____tr__thead__tbody____tr______tdcodetocodetd______tdThe_number_the_message_was_sent_to_td____tr____tr______tdcodereceivedTimestampcodetd______tdTime_the_message_was_sent_to_the_API_td____tr____tr______tdcodesentTimestampcodetd______tdTime_handling_of_the_message_ended_td____tr____tr______tdcodedeliveryStatuscodetd______tdThe_final_state_of_the_message_td____tr____tr______tdcodemessageIdcodetd______tdThe_same_reference_that_was_returned_when_the_original_message_was_sent_td____tr____tr______tdcodereceivedTimestampcodetd______tdTime_the_message_was_sent_to_the_API_td____tr__tbodytableUpon_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_h3Notification_URL_Format_for_SMS_Repliesh3precode_classlanguage_sh____status_RECEIVED____destinationAddress_61418123456____senderAddress_61421987654____message_Foo____________sentTimestamp_2018_03_23T1210061000_______________________________codepreThe_fields_are_table__thead____tr______thFieldth______thDescriptionth____tr__thead__tbody____tr______tdcodestatuscodetd______tdThe_final_state_of_the_message_td____tr____tr______tdcodedestinationAddresscodetd______tdThe_number_the_message_was_sent_to_td____tr____tr______tdcodesenderAddresscodetd______tdThe_number_the_message_was_sent_from_td____tr____tr______tdcodemessagecodetd______tdThe_sontent_of_the_SMS_reply_td____tr____tr______tdcodesentTimestampcodetd______tdTime_handling_of_the_message_ended_td____tr__tbodytableh3Notification_URL_Format_for_MMS_Repliesh3precode_classlanguage_sh____status_RECEIVED____destinationAddress_61418123456____senderAddress_61421987654____subject_Foo____sentTimestamp_2018_03_23T1215451000____envelope_string____MMSContent____________________type_applicationsmil________filename_smil_xml________payload_string_____________________type_imagejpeg________filename_sample_jpeg________payload_string_______________codepreThe_fields_are_table__thead____tr______thFieldth______thDescriptionth____tr__thead__tbody____tr______tdcodestatuscodetd______tdThe_final_state_of_the_message_td____tr____tr______tdcodedestinationAddresscodetd______tdThe_number_the_message_was_sent_to_td____tr____tr______tdcodesenderAddresscodetd______tdThe_number_the_message_was_sent_from_td____tr____tr______tdcodesubjectcodetd______tdThe_subject_assigned_to_the_message_td____tr____tr______tdcodesentTimestampcodetd______tdTime_handling_of_the_message_ended_td____tr____tr______tdcodeenvelopecodetd______tdInformation_about_about_terminal_type_and_originating_operator_td____tr____tr______tdcodeMMSContentcodetd______tdAn_array_of_the_actual_content_of_the_reply_message_td____tr____tr______tdcodetypecodetd______tdThe_content_type_of_the_message_td____tr____tr______tdcodefilenamecodetd______tdThe_filename_for_the_message_content_td____tr____tr______tdcodepayloadcodetd______tdThe_content_of_the_message_td____tr__tbodytable_Frequently_Asked_QuestionsQ_Can_I_send_a_broadcast_message_using_the_Telstra_Messging_APIA__Yes__Recipient_numbers_can_be_in_teh_form_of_an_array_of_strings_if_a_broadcast_message_needs_to_be_sent_h2Notesh2a_hrefhttppetstore_swagger_iourlhttpsraw_githubusercontent_comtelstraMessagingAPI_v2masterdocsswaggermessaging_api_swagger_yaml_target_blankView_messaging_in_Swagger_UIa", - "license": "MIT", + "description": "_IntroductionSend_and_receive_SMS_and_MMS_messages_globally_using_Telstras_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__FeaturesThe_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_CallbacksThe_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_API1__Register_at__httpsdev_telstra_com_httpsdev_telstra_com_2__After_registration_login_to__httpsdev_telstra_com_httpsdev_telstra_com_and_navigate_to_the_My_apps_page_3__Create_your_application_by_clicking_the_Add_new_app_button4__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__httpsdev_telstra_com_httpsdev_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_QuestionsQ_Is_creating_a_subscription_via_the_Provisioning_call_a_required_stepA__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_thisA__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_responseprecode_classlanguage_sh__status400__codeDELIVERY_IMPOSSIBLE__messageInvalid_from_address_specifiedcodepreUse_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_APIA__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_6141234567861487654321bodyTest_MessageQ_Can_I_use_Alphanumeric_Identifier_from_my_paid_plan_via_credit_cardA__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_forA__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_sendA__This_will_depend_on_the_carrier_that_will_receive_the_MMS__For_Telstra_its_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_APIA__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_URLA__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_callA__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_StartedBelow_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_Postmanahrefhttpsapp_getpostman_comrun_collectionded00578f69a9deba256env5BMessaging20API20Environments5DW3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X2lkIiwidmFsdWUiOiIiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6ImFjY2Vzc190b2tlbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Imhvc3QiLCJ2YWx1ZSI6InRhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiQXV0aG9yaXphdGlvbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Im9hdXRoX2hvc3QiLCJ2YWx1ZSI6InNhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoibWVzc2FnZV9pZCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifV0imgsrchttpsrun_pstmn_iobutton_svg_altRun_in_Postmana_Sample_Apps_____Perl_Sample_App_httpsgithub_comtelstraMessagingAPI_perl_sample_app_____Happy_Chat_App_httpsgithub_comtelstramessaging_sample_code_happy_chat_____PHP_Sample_App_httpsgithub_comdeveloperstevetelstra_messaging_php_SDK_Repos_____Messaging_API___PHP_SDK_httpsgithub_comtelstraMessagingAPI_SDK_php_____Messaging_API___Python_SDK_httpsgithub_comtelstraMessagingAPI_SDK_python_____Messaging_API___Ruby_SDK_httpsgithub_comtelstraMessagingAPI_SDK_ruby_____Messaging_API___NodeJS_SDK_httpsgithub_comtelstraMessagingAPI_SDK_node_____Messaging_API____Net2_SDK_httpsgithub_comtelstraMessagingAPI_SDK_dotnet_____Messaging_API___Java_SDK_httpsgithub_comtelstraMessagingAPI_SDK_Java_Blog_PostsFor_more_information_on_the_Messaging_API_you_can_read_these_blog_posts___Callbacks_Part_1_httpsdev_telstra_comcontentunderstanding_messaging_api_callbacks_part_1____Callbacks_Part_2_httpsdev_telstra_comcontentunderstanding_messaging_api_callbacks_part_2", + "license": "Apache-2.0", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" @@ -11,11 +11,11 @@ "fs": false }, "dependencies": { - "superagent": "3.5.2" + "superagent": "^3.8.3" }, "devDependencies": { - "mocha": "~2.3.4", - "sinon": "1.17.3", - "expect.js": "~0.3.1" + "expect.js": "~0.3.1", + "mocha": "^5.2.0", + "sinon": "1.17.3" } } diff --git a/src/ApiClient.js b/src/ApiClient.js index 89aa3ee..3ca9b82 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -32,7 +32,7 @@ /** * @module ApiClient - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/api/AuthenticationApi.js b/src/api/AuthenticationApi.js index 027e43b..81cbe21 100644 --- a/src/api/AuthenticationApi.js +++ b/src/api/AuthenticationApi.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -33,7 +33,7 @@ /** * Authentication service. * @module api/AuthenticationApi - * @version 1.0.4 + * @version 1.0.4.1 */ /** @@ -57,7 +57,7 @@ /** * 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 &quot;API Free Trial&quot; Product. The grant_type should be left as `client_credentials` and the scope as `NSMS`. The token will expire in one hour. <pre><code class=\"language-sh\"> #!/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&amp;client_id=$CLIENT_KEY&amp;client_secret=CLIENT_SECRET&amp;scope=NSMS' \\ 'https://tapi.telstra.com/v2/oauth/token' </code></pre> + * 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. * @param {String} clientId * @param {String} clientSecret * @param {String} grantType diff --git a/src/api/MessagingApi.js b/src/api/MessagingApi.js index 5f32eb4..ec967cf 100644 --- a/src/api/MessagingApi.js +++ b/src/api/MessagingApi.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -16,24 +16,24 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/InboundPollResponse', 'model/MessageSentResponse', 'model/OutboundPollResponse', 'model/SendMmsRequest', 'model/SendSMSRequest'], factory); + define(['ApiClient', 'model/InboundPollResponse', 'model/MMSContent', 'model/MessageSentResponse', 'model/OutboundPollResponse', 'model/SendMmsRequest', 'model/SendSMSRequest'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/InboundPollResponse'), require('../model/MessageSentResponse'), require('../model/OutboundPollResponse'), require('../model/SendMmsRequest'), require('../model/SendSMSRequest')); + module.exports = factory(require('../ApiClient'), require('../model/InboundPollResponse'), require('../model/MMSContent'), require('../model/MessageSentResponse'), require('../model/OutboundPollResponse'), require('../model/SendMmsRequest'), require('../model/SendSMSRequest')); } else { // Browser globals (root is window) if (!root.TelstraMessaging) { root.TelstraMessaging = {}; } - root.TelstraMessaging.MessagingApi = factory(root.TelstraMessaging.ApiClient, root.TelstraMessaging.InboundPollResponse, root.TelstraMessaging.MessageSentResponse, root.TelstraMessaging.OutboundPollResponse, root.TelstraMessaging.SendMmsRequest, root.TelstraMessaging.SendSMSRequest); + root.TelstraMessaging.MessagingApi = factory(root.TelstraMessaging.ApiClient, root.TelstraMessaging.InboundPollResponse, root.TelstraMessaging.MMSContent, root.TelstraMessaging.MessageSentResponse, root.TelstraMessaging.OutboundPollResponse, root.TelstraMessaging.SendMmsRequest, root.TelstraMessaging.SendSMSRequest); } -}(this, function(ApiClient, InboundPollResponse, MessageSentResponse, OutboundPollResponse, SendMmsRequest, SendSMSRequest) { +}(this, function(ApiClient, InboundPollResponse, MMSContent, MessageSentResponse, OutboundPollResponse, SendMmsRequest, SendSMSRequest) { 'use strict'; /** * Messaging service. * @module api/MessagingApi - * @version 1.0.4 + * @version 1.0.4.1 */ /** @@ -58,7 +58,7 @@ /** * Get MMS Status * Get MMS Status - * @param {String} messageid Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms + * @param {String} messageid Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms * @param {module:api/MessagingApi~getMMSStatusCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ @@ -84,7 +84,7 @@ }; var authNames = ['auth']; - var contentTypes = ['application/json']; + var contentTypes = []; var accepts = ['application/json']; var returnType = [OutboundPollResponse]; @@ -105,8 +105,8 @@ /** * Get SMS Status - * If no notification URL has been specified, it is possible to poll for the message status. <pre><code class=\"language-sh\"> #!/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\" </code></pre> 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. - * @param {String} messageId Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. + * 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. <pre><code class=\"language-sh\">{ to: '+61418123456' sentTimestamp: '2017-03-17T10:05:22+10:00' receivedTimestamp: '2017-03-17T10:05:23+10:00' messageId: /cccb284200035236000000000ee9d074019e0301/1261418123456 deliveryStatus: DELIVRD } </code></pre> The fields are: <table> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>to</code></td> <td>The number the message was sent to.</td> </tr> <tr> <td><code>receivedTimestamp</code></td> <td>Time the message was sent to the API.</td> </tr> <tr> <td><code>sentTimestamp</code></td> <td>Time handling of the message ended.</td> </tr> <tr> <td><code>deliveryStatus</code></td> <td>The final state of the message.</td> </tr> <tr> <td><code>messageId</code></td> <td>The same reference that was returned when the original message was sent.</td> </tr> <tr> <td><code>receivedTimestamp</code></td> <td>Time the message was sent to the API.</td> </tr> </tbody> </table> 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. + * @param {String} messageId Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. * @param {module:api/MessagingApi~getSMSStatusCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ @@ -132,7 +132,7 @@ }; var authNames = ['auth']; - var contentTypes = ['application/json']; + var contentTypes = []; var accepts = ['application/json']; var returnType = [OutboundPollResponse]; @@ -143,6 +143,47 @@ ); } + /** + * Callback function to receive the result of the retrieveMMSResponses operation. + * @callback module:api/MessagingApi~retrieveMMSResponsesCallback + * @param {String} error Error message, if any. + * @param {Array.} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 <pre><code class=\"language-sh\">{ \"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\" } ] }</code></pre> 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. | + * @param {module:api/MessagingApi~retrieveMMSResponsesCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link Array.} + */ + this.retrieveMMSResponses = function(callback) { + var postBody = null; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = ['auth']; + var contentTypes = []; + var accepts = ['application/json']; + var returnType = [MMSContent]; + + return this.apiClient.callApi( + '/messages/mms', 'GET', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + /** * Callback function to receive the result of the retrieveSMSResponses operation. * @callback module:api/MessagingApi~retrieveSMSResponsesCallback @@ -153,7 +194,7 @@ /** * 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 <pre><code class=\"language-sh\">{ \"to\":\"+61472880123\", \"from\":\"+61412345678\", \"body\":\"Foo4\", \"sentTimestamp\":\"2018-04-20T14:24:35\", \"messageId\":\"DMASApiA0000000146\" }</code></pre> 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. | * @param {module:api/MessagingApi~retrieveSMSResponsesCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InboundPollResponse} */ @@ -173,7 +214,7 @@ }; var authNames = ['auth']; - var contentTypes = ['application/json']; + var contentTypes = []; var accepts = ['application/json']; var returnType = InboundPollResponse; @@ -195,16 +236,18 @@ /** * Send MMS * Send MMS - * @param {module: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 + * @param {module:model/SendMmsRequest} 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. + * @param {module:api/MessagingApi~sendMMSCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/MessageSentResponse} */ - this.sendMMS = function(body, callback) { - var postBody = body; + this.sendMMS = function(sendMmsRequest, callback) { + var postBody = sendMmsRequest; - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling sendMMS"); + // verify the required parameter 'sendMmsRequest' is set + if (sendMmsRequest === undefined || sendMmsRequest === null) { + throw new Error("Missing the required parameter 'sendMmsRequest' when calling sendMMS"); } @@ -241,17 +284,19 @@ /** * Send SMS - * Send an SMS Message to a single or multiple mobile number/s. <h3>Send message to a single number: </h3> <pre><code class=\"language-sh\"> #!/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\" </code></pre> \\ <h3>Send message to multiple numbers: </h3> <pre><code class=\"language-sh\"> #!/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 <pre><code class=\"language-sh\"> - * @param {module: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. + * Send an SMS Message to a single or multiple mobile number/s. + * @param {module:model/SendSMSRequest} 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. + * @param {module:api/MessagingApi~sendSMSCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/MessageSentResponse} */ - this.sendSMS = function(payload, callback) { - var postBody = payload; + this.sendSMS = function(sendSMSRequest, callback) { + var postBody = sendSMSRequest; - // verify the required parameter 'payload' is set - if (payload === undefined || payload === null) { - throw new Error("Missing the required parameter 'payload' when calling sendSMS"); + // verify the required parameter 'sendSMSRequest' is set + if (sendSMSRequest === undefined || sendSMSRequest === null) { + throw new Error("Missing the required parameter 'sendSMSRequest' when calling sendSMS"); } diff --git a/src/api/ProvisioningApi.js b/src/api/ProvisioningApi.js index 0013e76..ab52a13 100644 --- a/src/api/ProvisioningApi.js +++ b/src/api/ProvisioningApi.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -33,7 +33,7 @@ /** * Provisioning service. * @module api/ProvisioningApi - * @version 1.0.4 + * @version 1.0.4.1 */ /** @@ -57,17 +57,17 @@ /** * Create Subscription - * Invoke the provisioning API to get a dedicated mobile number for an account or application. <pre><code class=\"language-sh\"> #!/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\" } }' </code></pre> - * @param {module:model/ProvisionNumberRequest} body A JSON payload containing the required attributes + * Invoke the provisioning API to get a dedicated mobile number for an account or application. + * @param {module:model/ProvisionNumberRequest} provisionNumberRequest A JSON payload containing the required attributes * @param {module:api/ProvisioningApi~createSubscriptionCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/ProvisionNumberResponse} */ - this.createSubscription = function(body, callback) { - var postBody = body; + this.createSubscription = function(provisionNumberRequest, callback) { + var postBody = provisionNumberRequest; - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling createSubscription"); + // verify the required parameter 'provisionNumberRequest' is set + if (provisionNumberRequest === undefined || provisionNumberRequest === null) { + throw new Error("Missing the required parameter 'provisionNumberRequest' when calling createSubscription"); } @@ -104,16 +104,16 @@ /** * Delete Subscription - * Delete a mobile number subscription from an account - * @param {module:model/DeleteNumberRequest} body EmptyArr + * Delete a mobile number subscription from an account + * @param {module:model/DeleteNumberRequest} deleteNumberRequest EmptyArr * @param {module:api/ProvisioningApi~deleteSubscriptionCallback} callback The callback function, accepting three arguments: error, data, response */ - this.deleteSubscription = function(body, callback) { - var postBody = body; + this.deleteSubscription = function(deleteNumberRequest, callback) { + var postBody = deleteNumberRequest; - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling deleteSubscription"); + // verify the required parameter 'deleteNumberRequest' is set + if (deleteNumberRequest === undefined || deleteNumberRequest === null) { + throw new Error("Missing the required parameter 'deleteNumberRequest' when calling deleteSubscription"); } @@ -130,7 +130,7 @@ var authNames = ['auth']; var contentTypes = ['application/json']; - var accepts = ['application/json']; + var accepts = []; var returnType = null; return this.apiClient.callApi( @@ -150,7 +150,7 @@ /** * Get Subscription - * Get mobile number subscription for an account + * Get mobile number subscription for an account * @param {module:api/ProvisioningApi~getSubscriptionCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/GetSubscriptionResponse} */ @@ -170,7 +170,7 @@ }; var authNames = ['auth']; - var contentTypes = ['application/json']; + var contentTypes = []; var accepts = ['application/json']; var returnType = GetSubscriptionResponse; diff --git a/src/index.js b/src/index.js index 3b2d8e7..f7b0985 100644 --- a/src/index.js +++ b/src/index.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -25,7 +25,7 @@ 'use strict'; /** - * _IntroductionSend_and_receive_SMS_and_MMS_messages_globally_using_Telstras_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__FeaturespThe_Telstra_Messaging_API_provides_the_features_below_table__thead____tr______thFeatureth______thDescriptionth____tr__thead__tbody____tr______tdcodeDedicated_Numbercodetd______tdProvision_a_mobile_number_for_your_account_to_be_used_as_from_address_in_the_APItd____tr____tr______tdcodeSend_Messagescodetd______tdSending_SMS_or_MMS_messagestd____tr____tr______tdcodeReceive_Messagescodetd______tdTelstra_will_deliver_messages_sent_to_a_dedicated_number_or_to_the_codenotifyURLcode_defined_by_youtd____tr____tr______tdcodeBroadcast_Messagescodetd______tdInvoke_a_single_API_to_send_a_message_to_a_list_of_number_provided_in_codetocodetd____tr____tr______tdcodeDelivery_Statuscodetd______tdQuery_the_delivery_status_of_your_messagestd____tr____tr______tdcodeCallbackscodetd______tdProvide_a_notification_URL_and_Telstra_will_notify_your_app_when_messages_status_changestd____tr____tr______tdcodeAlphanumeric_Identifiercodetd______tdDifferentiate_yourself_by_providing_an_alphanumeric_string_in_codefromcode__This_feature_is_only_available_on_paid_planstd____tr____tr______tdcodeConcatenationcodetd______tdSend_messages_up_to_1900_characters_long_and_Telstra_will_automaticaly_segment_and_reassemble_themtd____tr____tr______tdcodeReply_Requestcodetd______tdCreate_a_chat_session_by_associating_codemessageIdcode_and_codetocode_number_to_track_responses_received_from_a_mobile_number__We_will_store_this_association_for_8_daystd____tr____tr______tdcodeCharacter_setcodetd______tdAccepts_all_Unicode_characters_as_part_of_UTF_8td____tr____tr______tdcodeBounce_back_responsecodetd______tdSee_if_your_SMS_hits_an_unreachable_or_unallocated_number__Australia_Onlytd____tr____tr______tdcodeQueuingcodetd______tdMessaging_API_will_automatically_queue_and_deliver_each_message_at_a_compliant_rate_td____tr____tr______tdcodeEmoji_Encodingcodetd______tdThe_API_supports_the_encoding_of_the_full_range_of_emojis__Emojis_in_the_reply_messages_will_be_in_their_UTF_8_format_td____tr__tbodytable_Getting_Access_to_the_APIol__liRegister_at_a_hrefhttpsdev_telstra_comhttpsdev_telstra_coma___liAfter_registration_login_to_a_hrefhttpsdev_telstra_comhttpsdev_telstra_coma_______and_navigate_to_the_quotMy_appsquot_page____liCreate_your_application_by_clicking_the_quotAdd_new_appquot_button___liSelect_quotAPI_Free_Trialquot_Product_when_configuring_your_application__This_Product_includes_the_Telstra_Messaging_API_as_well_as_other_APIs__Your_application_will_be_approved_automatically___liThere_is_a_maximum_of_1000_free_messages_per_developer__Additional_messages_and_features_can_be_purchased_from_a_hrefhttpsdev_telstra_comhttpsdev_telstra_coma___liNote_your_codeClient_keycode_and_codeClient_secretcode_as_these_will_be_needed_to_provision_a_number_for_your_application_and_for_authentication_olpNow_head_over_to_bGetting_Startedb_where_you_can_find_a_postmancollection_as_well_as_some_links_to_sample_apps_and_SDKs_to_get_you_started_pHappy_Messaging_Getting_StartedpBelow_are_the_steps_to_get_started_with_the_Telstra_Messaging_API_p__ol____liGenerate_OAuth2_Token_using_your_codeClient_keycode_and_codeClient_secretcode_li____liCreate_Subscription_in_order_to_receive_a_provisioned_number_li____liSend_Message_to_a_specific_mobile_number_li__ol__h2Run_in_Postmanh2__pa__hrefhttpsapp_getpostman_comrun_collectionded00578f69a9deba256env5BMessaging20API20Environments5DW3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X2lkIiwidmFsdWUiOiIiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6ImFjY2Vzc190b2tlbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Imhvc3QiLCJ2YWx1ZSI6InRhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiQXV0aG9yaXphdGlvbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Im9hdXRoX2hvc3QiLCJ2YWx1ZSI6InNhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoibWVzc2FnZV9pZCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifV0__img_srchttpsrun_pstmn_iobutton_svg_altRun_in_Postman_ap__h2Sample_Appsh2____a_hrefhttpsgithub_comtelstraMessagingAPI_perl_sample_appPerl_Sample_Appa____a_hrefhttpsgithub_comtelstramessaging_sample_code_happy_chatHappy_Chat_Appa____a_hrefhttpsgithub_comdeveloperstevetelstra_messaging_phpPHP_Sample_Appa__h2SDK_reposh2____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_phpMessaging_API___PHP_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_pythonMessaging_API___Python_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_rubyMessaging_API___Ruby_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_nodeMessaging_API___NodeJS_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_dotnetMessaging_API____Net2_SDKa____a_hrefhttpsgithub_comtelstraMessagingAPI_SDK_JavaMessaging_API___Java_SDKa_Delivery_NotificationThe_API_provides_several_methods_for_notifying_when_a_message_has_been_delivered_to_the_destination_ol__liWhen_you_provision_a_number_there_is_an_opportunity_to_specify_a_codenotifyURLcode_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_li__liIf_you_do_not_specify_a_URL_you_can_always_call_the_codeGET_smscode_API_get_the_latest_replies_to_the_message_liolIPlease_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_Ih2Notification_URL_Formath2When_a_message_has_reached_its_final_state_the_API_will_send_a_POST_to_the_URL_that_has_been_previously_specified__h3Notification_URL_Format_for_SMSh3precode_classlanguage_sh____to_61418123456____sentTimestamp_2017_03_17T1005221000____receivedTimestamp_2017_03_17T1005231000____messageId_cccb284200035236000000000ee9d074019e03011261418123456____deliveryStatus_DELIVRD__codepreThe_fields_are_table__thead____tr______thFieldth______thDescriptionth____tr__thead__tbody____tr______tdcodetocodetd______tdThe_number_the_message_was_sent_to_td____tr____tr______tdcodereceivedTimestampcodetd______tdTime_the_message_was_sent_to_the_API_td____tr____tr______tdcodesentTimestampcodetd______tdTime_handling_of_the_message_ended_td____tr____tr______tdcodedeliveryStatuscodetd______tdThe_final_state_of_the_message_td____tr____tr______tdcodemessageIdcodetd______tdThe_same_reference_that_was_returned_when_the_original_message_was_sent_td____tr____tr______tdcodereceivedTimestampcodetd______tdTime_the_message_was_sent_to_the_API_td____tr__tbodytableUpon_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_h3Notification_URL_Format_for_SMS_Repliesh3precode_classlanguage_sh____status_RECEIVED____destinationAddress_61418123456____senderAddress_61421987654____message_Foo____________sentTimestamp_2018_03_23T1210061000_______________________________codepreThe_fields_are_table__thead____tr______thFieldth______thDescriptionth____tr__thead__tbody____tr______tdcodestatuscodetd______tdThe_final_state_of_the_message_td____tr____tr______tdcodedestinationAddresscodetd______tdThe_number_the_message_was_sent_to_td____tr____tr______tdcodesenderAddresscodetd______tdThe_number_the_message_was_sent_from_td____tr____tr______tdcodemessagecodetd______tdThe_sontent_of_the_SMS_reply_td____tr____tr______tdcodesentTimestampcodetd______tdTime_handling_of_the_message_ended_td____tr__tbodytableh3Notification_URL_Format_for_MMS_Repliesh3precode_classlanguage_sh____status_RECEIVED____destinationAddress_61418123456____senderAddress_61421987654____subject_Foo____sentTimestamp_2018_03_23T1215451000____envelope_string____MMSContent____________________type_applicationsmil________filename_smil_xml________payload_string_____________________type_imagejpeg________filename_sample_jpeg________payload_string_______________codepreThe_fields_are_table__thead____tr______thFieldth______thDescriptionth____tr__thead__tbody____tr______tdcodestatuscodetd______tdThe_final_state_of_the_message_td____tr____tr______tdcodedestinationAddresscodetd______tdThe_number_the_message_was_sent_to_td____tr____tr______tdcodesenderAddresscodetd______tdThe_number_the_message_was_sent_from_td____tr____tr______tdcodesubjectcodetd______tdThe_subject_assigned_to_the_message_td____tr____tr______tdcodesentTimestampcodetd______tdTime_handling_of_the_message_ended_td____tr____tr______tdcodeenvelopecodetd______tdInformation_about_about_terminal_type_and_originating_operator_td____tr____tr______tdcodeMMSContentcodetd______tdAn_array_of_the_actual_content_of_the_reply_message_td____tr____tr______tdcodetypecodetd______tdThe_content_type_of_the_message_td____tr____tr______tdcodefilenamecodetd______tdThe_filename_for_the_message_content_td____tr____tr______tdcodepayloadcodetd______tdThe_content_of_the_message_td____tr__tbodytable_Frequently_Asked_QuestionsQ_Can_I_send_a_broadcast_message_using_the_Telstra_Messging_APIA__Yes__Recipient_numbers_can_be_in_teh_form_of_an_array_of_strings_if_a_broadcast_message_needs_to_be_sent_h2Notesh2a_hrefhttppetstore_swagger_iourlhttpsraw_githubusercontent_comtelstraMessagingAPI_v2masterdocsswaggermessaging_api_swagger_yaml_target_blankView_messaging_in_Swagger_UIa.
+ * _IntroductionSend_and_receive_SMS_and_MMS_messages_globally_using_Telstras_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__FeaturesThe_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_CallbacksThe_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_API1__Register_at__httpsdev_telstra_com_httpsdev_telstra_com_2__After_registration_login_to__httpsdev_telstra_com_httpsdev_telstra_com_and_navigate_to_the_My_apps_page_3__Create_your_application_by_clicking_the_Add_new_app_button4__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__httpsdev_telstra_com_httpsdev_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_QuestionsQ_Is_creating_a_subscription_via_the_Provisioning_call_a_required_stepA__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_thisA__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_responseprecode_classlanguage_sh__status400__codeDELIVERY_IMPOSSIBLE__messageInvalid_from_address_specifiedcodepreUse_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_APIA__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_6141234567861487654321bodyTest_MessageQ_Can_I_use_Alphanumeric_Identifier_from_my_paid_plan_via_credit_cardA__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_forA__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_sendA__This_will_depend_on_the_carrier_that_will_receive_the_MMS__For_Telstra_its_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_APIA__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_URLA__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_callA__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_StartedBelow_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_Postmanahrefhttpsapp_getpostman_comrun_collectionded00578f69a9deba256env5BMessaging20API20Environments5DW3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X2lkIiwidmFsdWUiOiIiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6ImFjY2Vzc190b2tlbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Imhvc3QiLCJ2YWx1ZSI6InRhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiQXV0aG9yaXphdGlvbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Im9hdXRoX2hvc3QiLCJ2YWx1ZSI6InNhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoibWVzc2FnZV9pZCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifV0imgsrchttpsrun_pstmn_iobutton_svg_altRun_in_Postmana_Sample_Apps_____Perl_Sample_App_httpsgithub_comtelstraMessagingAPI_perl_sample_app_____Happy_Chat_App_httpsgithub_comtelstramessaging_sample_code_happy_chat_____PHP_Sample_App_httpsgithub_comdeveloperstevetelstra_messaging_php_SDK_Repos_____Messaging_API___PHP_SDK_httpsgithub_comtelstraMessagingAPI_SDK_php_____Messaging_API___Python_SDK_httpsgithub_comtelstraMessagingAPI_SDK_python_____Messaging_API___Ruby_SDK_httpsgithub_comtelstraMessagingAPI_SDK_ruby_____Messaging_API___NodeJS_SDK_httpsgithub_comtelstraMessagingAPI_SDK_node_____Messaging_API____Net2_SDK_httpsgithub_comtelstraMessagingAPI_SDK_dotnet_____Messaging_API___Java_SDK_httpsgithub_comtelstraMessagingAPI_SDK_Java_Blog_PostsFor_more_information_on_the_Messaging_API_you_can_read_these_blog_posts___Callbacks_Part_1_httpsdev_telstra_comcontentunderstanding_messaging_api_callbacks_part_1____Callbacks_Part_2_httpsdev_telstra_comcontentunderstanding_messaging_api_callbacks_part_2.
* The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: @@ -53,7 +53,7 @@ * *

* @module index - * @version 1.0.4 + * @version 1.0.4.1 */ var exports = { /** diff --git a/src/model/DeleteNumberRequest.js b/src/model/DeleteNumberRequest.js index 6067b26..8126c04 100644 --- a/src/model/DeleteNumberRequest.js +++ b/src/model/DeleteNumberRequest.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The DeleteNumberRequest model module. * @module model/DeleteNumberRequest - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/model/GetSubscriptionResponse.js b/src/model/GetSubscriptionResponse.js index 83b399d..4e5927c 100644 --- a/src/model/GetSubscriptionResponse.js +++ b/src/model/GetSubscriptionResponse.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The GetSubscriptionResponse model module. * @module model/GetSubscriptionResponse - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/model/InboundPollResponse.js b/src/model/InboundPollResponse.js index 5b6a46f..c179339 100644 --- a/src/model/InboundPollResponse.js +++ b/src/model/InboundPollResponse.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,12 +36,12 @@ /** * The InboundPollResponse model module. * @module model/InboundPollResponse - * @version 1.0.4 + * @version 1.0.4.1 */ /** * Constructs a new InboundPollResponse. - * Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. + * Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. * @alias module:model/InboundPollResponse * @class */ @@ -95,12 +95,12 @@ */ exports.prototype['status'] = undefined; /** - * The phone number (recipient) that the message was sent to(in E.164 format). + * The phone number (recipient) that the message was sent to (in E.164 format). * @member {String} destinationAddress */ exports.prototype['destinationAddress'] = undefined; /** - * The phone number (sender) that the message was sent from (in E.164 format). + * The phone number (sender) that the message was sent from (in E.164 format). * @member {String} senderAddress */ exports.prototype['senderAddress'] = undefined; diff --git a/src/model/MMSContent.js b/src/model/MMSContent.js index 036c597..378ef22 100644 --- a/src/model/MMSContent.js +++ b/src/model/MMSContent.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,14 +36,14 @@ /** * The MMSContent model module. * @module model/MMSContent - * @version 1.0.4 + * @version 1.0.4.1 */ /** * Constructs a new MMSContent. * @alias module:model/MMSContent * @class - * @param 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 + * @param 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\" * @param filename {String} The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. * @param payload {String} */ @@ -80,7 +80,7 @@ } /** - * 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 + * 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\" * @member {String} type */ exports.prototype['type'] = undefined; diff --git a/src/model/Message.js b/src/model/Message.js index 6af8393..e6219ee 100644 --- a/src/model/Message.js +++ b/src/model/Message.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The Message model module. * @module model/Message - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/model/MessageSentResponse.js b/src/model/MessageSentResponse.js index e948ffe..5be4475 100644 --- a/src/model/MessageSentResponse.js +++ b/src/model/MessageSentResponse.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The MessageSentResponse model module. * @module model/MessageSentResponse - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/model/OAuthResponse.js b/src/model/OAuthResponse.js index 54c698c..4d1a1db 100644 --- a/src/model/OAuthResponse.js +++ b/src/model/OAuthResponse.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The OAuthResponse model module. * @module model/OAuthResponse - * @version 1.0.4 + * @version 1.0.4.1 */ /** @@ -87,7 +87,7 @@ */ exports.prototype['token_type'] = undefined; /** - * OAuth expity time + * OAuth expiry time * @member {String} expires_in */ exports.prototype['expires_in'] = undefined; diff --git a/src/model/OutboundPollResponse.js b/src/model/OutboundPollResponse.js index cb8fc0a..56cf5cd 100644 --- a/src/model/OutboundPollResponse.js +++ b/src/model/OutboundPollResponse.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The OutboundPollResponse model module. * @module model/OutboundPollResponse - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/model/ProvisionNumberRequest.js b/src/model/ProvisionNumberRequest.js index 537663e..886d4a4 100644 --- a/src/model/ProvisionNumberRequest.js +++ b/src/model/ProvisionNumberRequest.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The ProvisionNumberRequest model module. * @module model/ProvisionNumberRequest - * @version 1.0.4 + * @version 1.0.4.1 */ /** @@ -77,17 +77,17 @@ } /** - * The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. + * The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. * @member {Number} activeDays */ exports.prototype['activeDays'] = undefined; /** - * 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. + * 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.* * @member {String} notifyURL */ exports.prototype['notifyURL'] = undefined; /** - * 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. + * 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. * @member {String} callbackData */ exports.prototype['callbackData'] = undefined; diff --git a/src/model/ProvisionNumberResponse.js b/src/model/ProvisionNumberResponse.js index ac24ccd..638c630 100644 --- a/src/model/ProvisionNumberResponse.js +++ b/src/model/ProvisionNumberResponse.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,7 +36,7 @@ /** * The ProvisionNumberResponse model module. * @module model/ProvisionNumberResponse - * @version 1.0.4 + * @version 1.0.4.1 */ /** diff --git a/src/model/SendMmsRequest.js b/src/model/SendMmsRequest.js index a09b223..a6d1806 100644 --- a/src/model/SendMmsRequest.js +++ b/src/model/SendMmsRequest.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,18 +36,18 @@ /** * The SendMmsRequest model module. * @module model/SendMmsRequest - * @version 1.0.4 + * @version 1.0.4.1 */ /** * Constructs a new SendMmsRequest. * @alias module:model/SendMmsRequest * @class - * @param 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. - * @param to {String} This is the destination address. + * @param 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. + * @param to {String} This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] * @param subject {String} The subject that will be used in an MMS message. * @param replyRequest {Boolean} If set to true, the reply message functionality will be implemented and the to address will be ignored if present. - * @param mMSContent {Array.} 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 mMSContent {Array.} 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. */ var exports = function(from, to, subject, replyRequest, mMSContent) { var _this = this; @@ -94,12 +94,12 @@ } /** - * 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. + * 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. * @member {String} from */ exports.prototype['from'] = undefined; /** - * This is the destination address. + * This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] * @member {String} to */ exports.prototype['to'] = undefined; @@ -119,7 +119,7 @@ */ exports.prototype['notifyURL'] = undefined; /** - * 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. + * 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. * @member {Array.} MMSContent */ exports.prototype['MMSContent'] = undefined; diff --git a/src/model/SendSMSRequest.js b/src/model/SendSMSRequest.js index c456c58..c5c8c2a 100644 --- a/src/model/SendSMSRequest.js +++ b/src/model/SendSMSRequest.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. * @@ -36,15 +36,15 @@ /** * The SendSMSRequest model module. * @module model/SendSMSRequest - * @version 1.0.4 + * @version 1.0.4.1 */ /** * Constructs a new SendSMSRequest. * @alias module:model/SendSMSRequest * @class - * @param 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\"` - * @param 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 + * @param 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\"]` + * @param 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 */ var exports = function(to, body) { var _this = this; @@ -99,12 +99,12 @@ } /** - * 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\"` + * 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\"]` * @member {String} to */ exports.prototype['to'] = undefined; /** - * 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 + * 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 * @member {String} body */ exports.prototype['body'] = undefined; diff --git a/src/model/Status.js b/src/model/Status.js index 6380e86..c48d3ab 100644 --- a/src/model/Status.js +++ b/src/model/Status.js @@ -1,13 +1,13 @@ /** * 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 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * - * Swagger Codegen version: 2.3.1 + * OpenAPI Generator version: 3.0.1 * * Do not edit the class manually. *