Skip to content

Commit fc9ce3f

Browse files
1.0.4 release using new 2.2.6 API spec - updated descriptions and documentation from the updated spec
1 parent 4aa7290 commit fc9ce3f

33 files changed

+196
-191
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Telstra_Messaging
22

33
TelstraMessaging - JavaScript client for Telstra_Messaging
4-
The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages.
54

6-
- API version: 2.2.4
7-
- Package version: 1.0.2
5+
- API version: 2.2.6
6+
- Package version: 1.0.4
87

98
## Installation
109

@@ -118,7 +117,7 @@ All URIs are relative to *https://tapi.telstra.com/v2*
118117

119118
Class | Method | HTTP request | Description
120119
------------ | ------------- | ------------- | -------------
121-
*TelstraMessaging.AuthenticationApi* | [**authToken**](docs/AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate authentication token
120+
*TelstraMessaging.AuthenticationApi* | [**authToken**](docs/AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate OAuth2 token
122121
*TelstraMessaging.MessagingApi* | [**getMMSStatus**](docs/MessagingApi.md#getMMSStatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status
123122
*TelstraMessaging.MessagingApi* | [**getSMSStatus**](docs/MessagingApi.md#getSMSStatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status
124123
*TelstraMessaging.MessagingApi* | [**retrieveSMSResponses**](docs/MessagingApi.md#retrieveSMSResponses) | **GET** /messages/sms | Retrieve SMS Responses
@@ -132,15 +131,11 @@ Class | Method | HTTP request | Description
132131
## Documentation for Models
133132

134133
- [TelstraMessaging.DeleteNumberRequest](docs/DeleteNumberRequest.md)
135-
- [TelstraMessaging.ErrorError](docs/ErrorError.md)
136-
- [TelstraMessaging.ErrorErrorError](docs/ErrorErrorError.md)
137134
- [TelstraMessaging.GetSubscriptionResponse](docs/GetSubscriptionResponse.md)
138135
- [TelstraMessaging.InboundPollResponse](docs/InboundPollResponse.md)
139136
- [TelstraMessaging.MMSContent](docs/MMSContent.md)
140137
- [TelstraMessaging.Message](docs/Message.md)
141138
- [TelstraMessaging.MessageSentResponse](docs/MessageSentResponse.md)
142-
- [TelstraMessaging.MessageType](docs/MessageType.md)
143-
- [TelstraMessaging.OAuthRequest](docs/OAuthRequest.md)
144139
- [TelstraMessaging.OAuthResponse](docs/OAuthResponse.md)
145140
- [TelstraMessaging.OutboundPollResponse](docs/OutboundPollResponse.md)
146141
- [TelstraMessaging.ProvisionNumberRequest](docs/ProvisionNumberRequest.md)

docs/AuthenticationApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ All URIs are relative to *https://tapi.telstra.com/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**authToken**](AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate authentication token
7+
[**authToken**](AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate OAuth2 token
88

99

1010
<a name="authToken"></a>
1111
# **authToken**
1212
> OAuthResponse authToken(clientId, clientSecret, grantType)
1313
14-
Generate authentication token
14+
Generate OAuth2 token
1515

16-
Generate authentication token
16+
To generate an OAuth2 Authentication token, pass through your &#x60;Client key&#x60; and &#x60;Client secret&#x60; that you received when you registered for the &amp;quot;API Free Trial&amp;quot; Product. The grant_type should be left as &#x60;client_credentials&#x60; and the scope as &#x60;NSMS&#x60;. The token will expire in one hour. &lt;pre&gt;&lt;code class&#x3D;\&quot;language-sh\&quot;&gt; #!/bin/bash # Obtain these keys from the Telstra Developer Portal CLIENT_KEY&#x3D;\&quot;your client key\&quot; CLIENT_SECRET&#x3D;\&quot;your client secret\&quot; curl -X POST -H &#39;Content-Type: application/x-www-form-urlencoded&#39; \\ -d &#39;grant_type&#x3D;client_credentials&amp;amp;client_id&#x3D;$CLIENT_KEY&amp;amp;client_secret&#x3D;CLIENT_SECRET&amp;amp;scope&#x3D;NSMS&#39; \\ &#39;https://tapi.telstra.com/v2/oauth/token&#39; &lt;/code&gt;&lt;/pre&gt;
1717

1818
### Example
1919
```javascript

docs/Message.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**to** | **String** | |
7-
**deliveryStatus** | **String** | |
8-
**messageId** | **String** | |
9-
**messageStatusURL** | **String** | | [optional]
6+
**to** | **String** | Just a copy of the number the message is sent to. |
7+
**deliveryStatus** | **String** | Gives an indication if the message has been accepted for delivery. The description field contains information on why a message may have been rejected. |
8+
**messageId** | **String** | For an accepted message, ths will be a unique reference that can be used to check the messages status. Please refer to the Delivery Notification section. Note that &#x60;messageId&#x60; will be different for each number that the message was sent to. |
9+
**messageStatusURL** | **String** | For an accepted message, ths will be the URL that can be used to check the messages status. Please refer to the Delivery Notification section. | [optional]
1010

1111

docs/MessageSentResponse.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**messages** | [**[Message]**](Message.md) | |
7-
**messageType** | **String** | |
8-
**numberSegments** | **Number** | |
9-
**numberNationalDestinations** | **Number** | | [optional]
10-
**numberInternationalDestinations** | **Number** | | [optional]
6+
**messages** | [**[Message]**](Message.md) | An array of messages. |
7+
**messageType** | **String** | This returns whether the message sent was a SMS or MMS. |
8+
**numberSegments** | **Number** | For SMS messages only, the value indicates the number of 160 character message segments sent. |
9+
**numberNationalDestinations** | **Number** | This returns the number of domestic Australian messages sent. | [optional]
10+
**numberInternationalDestinations** | **Number** | This returns the number of international messages sent | [optional]
1111

1212

docs/MessagingApi.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Name | Type | Description | Notes
6868
6969
Get SMS Status
7070

71-
Get Message Status
71+
If no notification URL has been specified, it is possible to poll for the message status. &lt;pre&gt;&lt;code class&#x3D;\&quot;language-sh\&quot;&gt; #!/bin/bash #!/bin/bash # Example of how to poll for a message status AccessToken&#x3D;\&quot;Consumer Access Token\&quot; MessageId&#x3D;\&quot;Previous supplied Message Id, URL encoded\&quot; curl -X get -H \&quot;Authorization: Bearer $AccessToken\&quot; \\ -H \&quot;Content-Type: application/json\&quot; \\ \&quot;https://tapi.telstra.com/v2/messages/sms/$MessageId\&quot; &lt;/code&gt;&lt;/pre&gt; Note that the &#x60;MessageId&#x60; that appears in the URL must be URL encoded, just copying the &#x60;MessageId&#x60; as it was supplied when submitting the message may not work.
7272

7373
### Example
7474
```javascript
@@ -81,7 +81,7 @@ auth.accessToken = 'YOUR ACCESS TOKEN';
8181

8282
var apiInstance = new TelstraMessaging.MessagingApi();
8383

84-
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
84+
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.
8585

8686

8787
var callback = function(error, data, response) {
@@ -98,7 +98,7 @@ apiInstance.getSMSStatus(messageId, callback);
9898

9999
Name | Type | Description | Notes
100100
------------- | ------------- | ------------- | -------------
101-
**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 |
101+
**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. |
102102

103103
### Return type
104104

@@ -119,7 +119,7 @@ Name | Type | Description | Notes
119119
120120
Retrieve SMS Responses
121121

122-
Retrieve Messages
122+
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 &#x60;notifyURL&#x60;, response messages will be logged there instead.
123123

124124
### Example
125125
```javascript
@@ -215,7 +215,7 @@ Name | Type | Description | Notes
215215
216216
Send SMS
217217

218-
Send Message
218+
Send an SMS Message to a single or multiple mobile number/s. &lt;h3&gt;Send message to a single number: &lt;/h3&gt; &lt;pre&gt;&lt;code class&#x3D;\&quot;language-sh\&quot;&gt; #!/bin/bash # Use the Messaging API-v2 to send an SMS # Note: only to: and body: are required AccessToken&#x3D;\&quot;Access Token\&quot; Dest&#x3D;\&quot;Destination number\&quot; curl -X POST -H \&quot;Authorization: Bearer $AccessToken\&quot; -H \&quot;Content-Type: application/json\&quot; -d \&quot;{ \\\&quot;to\\\&quot;:\\\&quot;$Dest\\\&quot;, \\\&quot;body\\\&quot;:\\\&quot;Test Message\\\&quot;, \\\&quot;from\\\&quot;: \\\&quot;+61412345678\\\&quot;, \\\&quot;validity\\\&quot;: 5, \\\&quot;scheduledDelivery\\\&quot;: 1, \\\&quot;notifyURL\\\&quot;: \\\&quot;\\\&quot;, \\\&quot;replyRequest\\\&quot;: false \\\&quot;priority\\\&quot;: true }\&quot; \&quot;https://tapi.telstra.com/v2/messages/sms\&quot; &lt;/code&gt;&lt;/pre&gt; \\ &lt;h3&gt;Send message to multiple numbers: &lt;/h3&gt; &lt;pre&gt;&lt;code class&#x3D;\&quot;language-sh\&quot;&gt; #!/bin/bash # Use the Messaging API to send an SMS AccessToken&#x3D;\&quot;Access Token\&quot; Dest&#x3D;\&quot;Destination number\&quot; curl -X post -H \&quot;Authorization: Bearer $AccessToken\&quot; \\ -H \&quot;Content-Type: application/json\&quot; \\ -d &#39;{ \&quot;to\&quot;:\&quot;$dest1, $dest2, $dest3\&quot;, \&quot;body\&quot;:\&quot;Test Message\&quot; }&#39; \\ https://tapi.telstra.com/v2/messages/sms &lt;pre&gt;&lt;code class&#x3D;\&quot;language-sh\&quot;&gt;
219219

220220
### Example
221221
```javascript
@@ -228,7 +228,7 @@ auth.accessToken = 'YOUR ACCESS TOKEN';
228228

229229
var apiInstance = new TelstraMessaging.MessagingApi();
230230

231-
var payload = new TelstraMessaging.SendSMSRequest(); // SendSMSRequest | A JSON or XML payload containing the recipient's phone number and text message. The recipient number should be in the format '04xxxxxxxx' where x is a digit
231+
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.
232232

233233

234234
var callback = function(error, data, response) {
@@ -245,7 +245,7 @@ apiInstance.sendSMS(payload, callback);
245245

246246
Name | Type | Description | Notes
247247
------------- | ------------- | ------------- | -------------
248-
**payload** | [**SendSMSRequest**](SendSMSRequest.md)| A JSON or XML payload containing the recipient&#39;s phone number and text message. The recipient number should be in the format &#39;04xxxxxxxx&#39; where x is a digit |
248+
**payload** | [**SendSMSRequest**](SendSMSRequest.md)| A JSON or XML payload containing the recipient&#39;s phone number and text message. This number can be in international format if preceeded by a ‘+’ or in national format (&#39;04xxxxxxxx&#39;) where x is a digit. |
249249

250250
### Return type
251251

docs/OutboundPollResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**to** | **String** | The phone number (recipient) the message was sent to (in E.164 format). | [optional]
7-
**receivedTimestamp** | **String** | The date and time when the message was recieved by recipient. | [optional]
87
**sentTimestamp** | **String** | The date and time when the message was sent. | [optional]
8+
**receivedTimestamp** | **String** | The date and time when the message was recieved by recipient. | [optional]
99
**deliveryStatus** | [**Status**](Status.md) | | [optional]
1010

1111

docs/ProvisionNumberRequest.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**activeDays** | **Number** | Number of active days | [optional]
7-
**notifyURL** | **String** | Notify url | [optional]
6+
**activeDays** | **Number** | The number of days before for which this number is provisioned. Usually this will be same as the plan you buy. | [optional]
7+
**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]
8+
**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]
89

910

docs/ProvisioningApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Method | HTTP request | Description
1515
1616
Create Subscription
1717

18-
Provision a mobile number
18+
Invoke the provisioning API to get a dedicated mobile number for an account or application. &lt;pre&gt;&lt;code class&#x3D;\&quot;language-sh\&quot;&gt; #!/bin/bash curl -X POST \\ https://tapi.telstra.com/v2/messages/provisioning/subscriptions \\ -H &#39;authorization: Bearer $ACCESS_TOKEN&#39; \\ -H &#39;cache-control: no-cache&#39; \\ -H &#39;content-type: application/json&#39; \\ -d &#39;{ \&quot;activeDays\&quot;:30, \&quot;notifyURL\&quot;:\&quot;http://example.com/callback\&quot;, \&quot;callbackData\&quot;: { \&quot;anything\&quot;:\&quot;some data\&quot; } }&#39; &lt;/code&gt;&lt;/pre&gt;
1919

2020
### Example
2121
```javascript

docs/SendMmsRequest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
**to** | **String** | This is the destination address. |
88
**subject** | **String** | The subject that will be used in an MMS message. |
99
**replyRequest** | **Boolean** | If set to true, the reply message functionality will be implemented and the to address will be ignored if present. |
10-
**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. |
10+
**notifyURL** | **String** | Notify url | [optional]
11+
**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. |
1112

1213

docs/SendSMSRequest.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**to** | **String** | Phone number (in E.164 format) to send the SMS to. This number can be in international format if preceeded by a ‘+’, or in national format. |
7-
**body** | **String** | The text body of the message. Messages longer than 160 characters will be counted as multiple messages. |
8-
**from** | **String** | Phone number (in E.164 format) the SMS was sent from. If not present, the serverice will use the mobile number associated with the application, or it be an Alphanumeric address of up to 11 characters. | [optional]
9-
**validity** | **Number** | How long the platform should attempt to deliver the message for. This period is specified in minutes from the message | [optional]
10-
**scheduledDelivery** | **Number** | How long the platform should wait before attempting to send the message - specified in minutes. | [optional]
11-
**notifyURL** | **String** | Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. | [optional]
12-
**replyRequest** | **Boolean** | If set to true, the reply message functionality will be implemented and the to address will be ignored if present. If false or not present, then normal message handling is implemented. | [optional]
6+
**to** | **String** | Phone number (in E.164 format) to send the SMS to. This number can be in international format &#x60;\&quot;to\&quot;: \&quot;+61412345678\&quot;&#x60; or in national format. Can be an array of strings if sending to multiple numbers: &#x60;\&quot;to\&quot;: \&quot;+61412345678, +61418765432\&quot;&#x60; |
7+
**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 |
8+
**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]
9+
**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 &#x60;\&quot;validity\&quot;: 60&#x60; will specify that if a message can&#39;t be delivered within the first 60 minutes them the network should stop. | [optional]
10+
**scheduledDelivery** | **Number** | How long the platform should wait before attempting to send the message - specified in minutes. e.g.: If &#x60;\&quot;scheduledDelivery\&quot;: 120&#x60; is included, then the network will not attempt to start message delivery for two hours after the message has been submitted | [optional]
11+
**notifyURL** | **String** | Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. It is possible for the network to make a call to a URL when the message has been delivered (or has expired), different URLs can be set per message. Please refer to the Delivery Notification section. | [optional]
12+
**replyRequest** | **Boolean** | If set to true, the reply message functionality will be implemented and the to address will be ignored if present. If false or not present, then normal message handling is implemented. When set to true, network will use a temporary number to deliver this message. All messages sent by mobile to this temporary number will be stored against the same &#x60;messageId&#x60;. If a &#x60;notifyURL&#x60; is provided then user response will be delivered to the URL where &#x60;messageId&#x60; will be same as &#x60;messageId&#x60; in reponse to original API request. This field contains the message text, this can be up to 500 UTF-8 characters. As mobile devices rarely support the full range of UTF-8 characters, it is possible that some characters may not be translated correctly by the mobile device. | [optional]
13+
**priority** | **Boolean** | When messages are queued up for a number, then it is possible to set where a new message will be placed in the queue. If the priority is set to true then the new message will be placed ahead of all messages with a normal priority. If there are no messages queued for the number, then this parameter has no effect. | [optional]
1314

1415

0 commit comments

Comments
 (0)