Skip to content

Commit

Permalink
1.0.4 release using new 2.2.6 API spec - updated descriptions and doc…
Browse files Browse the repository at this point in the history
…umentation from the updated spec
  • Loading branch information
developersteve committed Apr 23, 2018
1 parent 4aa7290 commit fc9ce3f
Show file tree
Hide file tree
Showing 33 changed files with 196 additions and 191 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Telstra_Messaging

TelstraMessaging - JavaScript client for Telstra_Messaging
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.

- API version: 2.2.4
- Package version: 1.0.2
- API version: 2.2.6
- Package version: 1.0.4

## Installation

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*TelstraMessaging.AuthenticationApi* | [**authToken**](docs/AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate authentication token
*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* | [**retrieveSMSResponses**](docs/MessagingApi.md#retrieveSMSResponses) | **GET** /messages/sms | Retrieve SMS Responses
Expand All @@ -132,15 +131,11 @@ Class | Method | HTTP request | Description
## Documentation for Models

- [TelstraMessaging.DeleteNumberRequest](docs/DeleteNumberRequest.md)
- [TelstraMessaging.ErrorError](docs/ErrorError.md)
- [TelstraMessaging.ErrorErrorError](docs/ErrorErrorError.md)
- [TelstraMessaging.GetSubscriptionResponse](docs/GetSubscriptionResponse.md)
- [TelstraMessaging.InboundPollResponse](docs/InboundPollResponse.md)
- [TelstraMessaging.MMSContent](docs/MMSContent.md)
- [TelstraMessaging.Message](docs/Message.md)
- [TelstraMessaging.MessageSentResponse](docs/MessageSentResponse.md)
- [TelstraMessaging.MessageType](docs/MessageType.md)
- [TelstraMessaging.OAuthRequest](docs/OAuthRequest.md)
- [TelstraMessaging.OAuthResponse](docs/OAuthResponse.md)
- [TelstraMessaging.OutboundPollResponse](docs/OutboundPollResponse.md)
- [TelstraMessaging.ProvisionNumberRequest](docs/ProvisionNumberRequest.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/AuthenticationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ All URIs are relative to *https://tapi.telstra.com/v2*

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


<a name="authToken"></a>
# **authToken**
> OAuthResponse authToken(clientId, clientSecret, grantType)
Generate authentication token
Generate OAuth2 token

Generate authentication token
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;

### Example
```javascript
Expand Down
8 changes: 4 additions & 4 deletions docs/Message.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**to** | **String** | |
**deliveryStatus** | **String** | |
**messageId** | **String** | |
**messageStatusURL** | **String** | | [optional]
**to** | **String** | Just a copy of the number the message is sent to. |
**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. |
**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. |
**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]


10 changes: 5 additions & 5 deletions docs/MessageSentResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**messages** | [**[Message]**](Message.md) | |
**messageType** | **String** | |
**numberSegments** | **Number** | |
**numberNationalDestinations** | **Number** | | [optional]
**numberInternationalDestinations** | **Number** | | [optional]
**messages** | [**[Message]**](Message.md) | An array of messages. |
**messageType** | **String** | This returns whether the message sent was a SMS or MMS. |
**numberSegments** | **Number** | For SMS messages only, the value indicates the number of 160 character message segments sent. |
**numberNationalDestinations** | **Number** | This returns the number of domestic Australian messages sent. | [optional]
**numberInternationalDestinations** | **Number** | This returns the number of international messages sent | [optional]


14 changes: 7 additions & 7 deletions docs/MessagingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Name | Type | Description | Notes
Get SMS Status

Get Message Status
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.

### Example
```javascript
Expand All @@ -81,7 +81,7 @@ 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) {
Expand All @@ -98,7 +98,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

Expand All @@ -119,7 +119,7 @@ Name | Type | Description | Notes
Retrieve SMS Responses

Retrieve Messages
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.

### Example
```javascript
Expand Down Expand Up @@ -215,7 +215,7 @@ Name | Type | Description | Notes
Send SMS

Send Message
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;

### Example
```javascript
Expand All @@ -228,7 +228,7 @@ 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. The recipient number should be in the format '04xxxxxxxx' where x is a digit
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 callback = function(error, data, response) {
Expand All @@ -245,7 +245,7 @@ apiInstance.sendSMS(payload, callback);

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**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 |
**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. |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/OutboundPollResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**to** | **String** | The phone number (recipient) the message was sent to (in E.164 format). | [optional]
**receivedTimestamp** | **String** | The date and time when the message was recieved by recipient. | [optional]
**sentTimestamp** | **String** | The date and time when the message was sent. | [optional]
**receivedTimestamp** | **String** | The date and time when the message was recieved by recipient. | [optional]
**deliveryStatus** | [**Status**](Status.md) | | [optional]


5 changes: 3 additions & 2 deletions docs/ProvisionNumberRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**activeDays** | **Number** | Number of active days | [optional]
**notifyURL** | **String** | Notify url | [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 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]


2 changes: 1 addition & 1 deletion docs/ProvisioningApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Method | HTTP request | Description
Create Subscription

Provision a mobile number
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;

### Example
```javascript
Expand Down
3 changes: 2 additions & 1 deletion docs/SendMmsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**to** | **String** | This is the destination address. |
**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. |
**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. |
**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. |


15 changes: 8 additions & 7 deletions docs/SendSMSRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
## 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 if preceeded by a ‘+’, or in national format. |
**body** | **String** | The text body of the message. Messages longer than 160 characters will be counted as multiple messages. |
**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]
**validity** | **Number** | How long the platform should attempt to deliver the message for. This period is specified in minutes from the message | [optional]
**scheduledDelivery** | **Number** | How long the platform should wait before attempting to send the message - specified in minutes. | [optional]
**notifyURL** | **String** | Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. | [optional]
**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]
**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; |
**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 &#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]
**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]
**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]
**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]
**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]


Loading

0 comments on commit fc9ce3f

Please sign in to comment.