Skip to content

Commit 7bfc015

Browse files
1.0.4 release using new 2.2.6 API spec - updated descriptions and documentation from the updated spec
1 parent 8f9cd23 commit 7bfc015

File tree

96 files changed

+273
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+273
-200
lines changed

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Telstra_Messaging
2-
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.
32

43

5-
- API version: 2.2.4
6-
- Package version: 1.0.2
4+
- API version: 2.2.6
5+
- Package version: 1.0.4
76

87
## Requirements.
98

@@ -44,19 +43,18 @@ import time
4443
import Telstra_Messaging
4544
from Telstra_Messaging.rest import ApiException
4645
from pprint import pprint
47-
48-
# Configure OAuth2 access token for authorization: auth
49-
Telstra_Messaging.configuration.access_token = 'YOUR_ACCESS_TOKEN'
5046
# create an instance of the API class
51-
api_instance = Telstra_Messaging.MessagingApi()
52-
messageid = 'messageid_example' # str | Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms
47+
api_instance = Telstra_Messaging.AuthenticationApi()
48+
client_id = 'client_id_example' # str |
49+
client_secret = 'client_secret_example' # str |
50+
grant_type = 'client_credentials' # str | (default to client_credentials)
5351

5452
try:
55-
# Get MMS Status
56-
api_response = api_instance.get_mms_status(messageid)
53+
# Generate OAuth2 token
54+
api_response = api_instance.auth_token(client_id, client_secret, grant_type)
5755
pprint(api_response)
5856
except ApiException as e:
59-
print("Exception when calling MessagingApi->get_mms_status: %s\n" % e)
57+
print("Exception when calling AuthenticationApi->auth_token: %s\n" % e)
6058

6159
```
6260

@@ -66,6 +64,7 @@ All URIs are relative to *https://tapi.telstra.com/v2*
6664

6765
Class | Method | HTTP request | Description
6866
------------ | ------------- | ------------- | -------------
67+
*AuthenticationApi* | [**auth_token**](docs/AuthenticationApi.md#auth_token) | **POST** /oauth/token | Generate OAuth2 token
6968
*MessagingApi* | [**get_mms_status**](docs/MessagingApi.md#get_mms_status) | **GET** /messages/mms/{messageid}/status | Get MMS Status
7069
*MessagingApi* | [**get_sms_status**](docs/MessagingApi.md#get_sms_status) | **GET** /messages/sms/{messageId}/status | Get SMS Status
7170
*MessagingApi* | [**retrieve_sms_responses**](docs/MessagingApi.md#retrieve_sms_responses) | **GET** /messages/sms | Retrieve SMS Responses
@@ -74,21 +73,16 @@ Class | Method | HTTP request | Description
7473
*ProvisioningApi* | [**create_subscription**](docs/ProvisioningApi.md#create_subscription) | **POST** /messages/provisioning/subscriptions | Create Subscription
7574
*ProvisioningApi* | [**delete_subscription**](docs/ProvisioningApi.md#delete_subscription) | **DELETE** /messages/provisioning/subscriptions | Delete Subscription
7675
*ProvisioningApi* | [**get_subscription**](docs/ProvisioningApi.md#get_subscription) | **GET** /messages/provisioning/subscriptions | Get Subscription
77-
*AuthenticationApi* | [**auth_token**](docs/AuthenticationApi.md#auth_token) | **POST** /oauth/token | Generate authentication token
7876

7977

8078
## Documentation For Models
8179

8280
- [DeleteNumberRequest](docs/DeleteNumberRequest.md)
83-
- [ErrorError](docs/ErrorError.md)
84-
- [ErrorErrorError](docs/ErrorErrorError.md)
8581
- [GetSubscriptionResponse](docs/GetSubscriptionResponse.md)
8682
- [InboundPollResponse](docs/InboundPollResponse.md)
8783
- [MMSContent](docs/MMSContent.md)
8884
- [Message](docs/Message.md)
8985
- [MessageSentResponse](docs/MessageSentResponse.md)
90-
- [MessageType](docs/MessageType.md)
91-
- [OAuthRequest](docs/OAuthRequest.md)
9286
- [OAuthResponse](docs/OAuthResponse.md)
9387
- [OutboundPollResponse](docs/OutboundPollResponse.md)
9488
- [ProvisionNumberRequest](docs/ProvisionNumberRequest.md)

Telstra_Messaging/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"""
66
Telstra Messaging API
77
8-
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. # noqa: E501
8+
# 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 <p>The Telstra Messaging API provides the features below. <table> <thead> <tr> <th>Feature</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>Dedicated Number</code></td> <td>Provision a mobile number for your account to be used as from address in the API</td> </tr> <tr> <td><code>Send Messages</code></td> <td>Sending SMS or MMS messages</td> </tr> <tr> <td><code>Receive Messages</code></td> <td>Telstra will deliver messages sent to a dedicated number or to the <code>notifyURL</code> defined by you</td> </tr> <tr> <td><code>Broadcast Messages</code></td> <td>Invoke a single API to send a message to a list of number provided in <code>to</code></td> </tr> <tr> <td><code>Delivery Status</code></td> <td>Query the delivery status of your messages</td> </tr> <tr> <td><code>Callbacks</code></td> <td>Provide a notification URL and Telstra will notify your app when messages status changes</td> </tr> <tr> <td><code>Alphanumeric Identifier</code></td> <td>Differentiate yourself by providing an alphanumeric string in <code>from</code>. This feature is only available on paid plans</td> </tr> <tr> <td><code>Concatenation</code></td> <td>Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them</td> </tr> <tr> <td><code>Reply Request</code></td> <td>Create a chat session by associating <code>messageId</code> and <code>to</code> number to track responses received from a mobile number. We will store this association for 8 days</td> </tr> <tr> <td><code>Character set</code></td> <td>Accepts all Unicode characters as part of UTF-8</td> </tr> <tr> <td><code>Bounce-back response</code></td> <td>See if your SMS hits an unreachable or unallocated number (Australia Only)</td> </tr> <tr> <td><code>Queuing</code></td> <td>Messaging API will automatically queue and deliver each message at a compliant rate.</td> </tr> <tr> <td><code>Emoji Encoding</code></td> <td>The API supports the encoding of the full range of emojis. Emojis in the reply messages will be in their UTF-8 format.</td> </tr> </tbody> </table> # Getting Access to the API <ol> <li>Register at <a href=\"https://dev.telstra.com\">https://dev.telstra.com</a>. <li>After registration, login to <a href=\"https://dev.telstra.com\">https://dev.telstra.com</a> and navigate to the &quot;My apps&quot; page. <li>Create your application by clicking the &quot;Add new app&quot; button <li>Select &quot;API Free Trial&quot; Product when configuring your application. This Product includes the Telstra Messaging API as well as other APIs. Your application will be approved automatically. <li>There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from <a href=\"https://dev.telstra.com\">https://dev.telstra.com</a>. <li>Note your <code>Client key</code> and <code>Client secret</code> as these will be needed to provision a number for your application and for authentication. </ol> <p>Now head over to <b>Getting Started</b> where you can find a postman collection as well as some links to sample apps and SDKs to get you started. <p>Happy Messaging! # Getting Started <p>Below are the steps to get started with the Telstra Messaging API.</p> <ol> <li>Generate OAuth2 Token using your <code>Client key</code> and <code>Client secret</code>.</li> <li>Create Subscription in order to receive a provisioned number.</li> <li>Send Message to a specific mobile number.</li> </ol> <h2>Run in Postman</h2> <p><a href=\"https://app.getpostman.com/run-collection/ded00578f69a9deba256#?env%5BMessaging%20API%20Environments%5D=W3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X2lkIiwidmFsdWUiOiIiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6ImFjY2Vzc190b2tlbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Imhvc3QiLCJ2YWx1ZSI6InRhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiQXV0aG9yaXphdGlvbiIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Im9hdXRoX2hvc3QiLCJ2YWx1ZSI6InNhcGkudGVsc3RyYS5jb20iLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoibWVzc2FnZV9pZCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifV0=\"> <img src=\"https://run.pstmn.io/button.svg\" alt=\"Run in Postman\" /></a></p> <h2>Sample Apps</h2> - <a href=\"https://github.com/telstra/MessagingAPI-perl-sample-app\">Perl Sample App</a> - <a href=\"https://github.com/telstra/messaging-sample-code-happy-chat\">Happy Chat App</a> - <a href=\"https://github.com/developersteve/telstra-messaging-php\">PHP Sample App</a> <h2>SDK repos</h2> - <a href=\"https://github.com/telstra/MessagingAPI-SDK-php\">Messaging API - PHP SDK</a> - <a href=\"https://github.com/telstra/MessagingAPI-SDK-python\">Messaging API - Python SDK</a> - <a href=\"https://github.com/telstra/MessagingAPI-SDK-ruby\">Messaging API - Ruby SDK</a> - <a href=\"https://github.com/telstra/MessagingAPI-SDK-node\">Messaging API - NodeJS SDK</a> - <a href=\"https://github.com/telstra/MessagingAPI-SDK-dotnet\">Messaging API - .Net2 SDK</a> - <a href=\"https://github.com/telstra/MessagingAPI-SDK-Java\">Messaging API - Java SDK</a> # Delivery Notification The API provides several methods for notifying when a message has been delivered to the destination. <ol> <li>When you provision a number there is an opportunity to specify a <code>notifyURL</code>, 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> <li>If you do not specify a URL you can always call the <code>GET /sms</code> API get the latest replies to the message.</li> </ol> <I>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.</I> <h2>Notification URL Format</h2> When a message has reached its final state, the API will send a POST to the URL that has been previously specified. <h3>Notification URL Format for SMS</h3> <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. <h3>Notification URL Format for SMS Replies</h3> <pre><code class=\"language-sh\">{ \"status\": \"RECEIVED\" \"destinationAddress\": \"+61418123456\" \"senderAddress\": \"+61421987654\" \"message\": \"Foo\" \"sentTimestamp\": \"2018-03-23T12:10:06+10:00\" } </code></pre> \\ The fields are: <table> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>status</code></td> <td>The final state of the message.</td> </tr> <tr> <td><code>destinationAddress</code></td> <td>The number the message was sent to.</td> </tr> <tr> <td><code>senderAddress</code></td> <td>The number the message was sent from.</td> </tr> <tr> <td><code>message</code></td> <td>The sontent of the SMS reply.</td> </tr> <tr> <td><code>sentTimestamp</code></td> <td>Time handling of the message ended.</td> </tr> </tbody> </table> <h3>Notification URL Format for MMS Replies</h3> <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\": \"application/smil\", \"filename\": \"smil.xml\", \"payload\": \"string\" }, { \"type\": \"image/jpeg\", \"filename\": \"sample.jpeg\", \"payload\": \"string\" } ] } </code></pre> \\ The fields are: <table> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>status</code></td> <td>The final state of the message.</td> </tr> <tr> <td><code>destinationAddress</code></td> <td>The number the message was sent to.</td> </tr> <tr> <td><code>senderAddress</code></td> <td>The number the message was sent from.</td> </tr> <tr> <td><code>subject</code></td> <td>The subject assigned to the message.</td> </tr> <tr> <td><code>sentTimestamp</code></td> <td>Time handling of the message ended.</td> </tr> <tr> <td><code>envelope</code></td> <td>Information about about terminal type and originating operator.</td> </tr> <tr> <td><code>MMSContent</code></td> <td>An array of the actual content of the reply message.</td> </tr> <tr> <td><code>type</code></td> <td>The content type of the message.</td> </tr> <tr> <td><code>filename</code></td> <td>The filename for the message content.</td> </tr> <tr> <td><code>payload</code></td> <td>The content of the message.</td> </tr> </tbody> </table> # 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. <h2>Notes</h2> <a href=\"http://petstore.swagger.io/?url=https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/swagger/messaging-api-swagger.yaml\" target=\"_blank\">View messaging in Swagger UI</a> # noqa: E501
99
10-
OpenAPI spec version: 2.2.4
10+
OpenAPI spec version: 2.2.6
1111
1212
Generated by: https://github.com/swagger-api/swagger-codegen.git
1313
"""
@@ -16,24 +16,20 @@
1616
from __future__ import absolute_import
1717

1818
# import apis into sdk package
19+
from Telstra_Messaging.api.authentication_api import AuthenticationApi
1920
from Telstra_Messaging.api.messaging_api import MessagingApi
2021
from Telstra_Messaging.api.provisioning_api import ProvisioningApi
21-
from Telstra_Messaging.api.authentication_api import AuthenticationApi
2222

2323
# import ApiClient
2424
from Telstra_Messaging.api_client import ApiClient
2525
from Telstra_Messaging.configuration import Configuration
2626
# import models into sdk package
2727
from Telstra_Messaging.models.delete_number_request import DeleteNumberRequest
28-
from Telstra_Messaging.models.error_error import ErrorError
29-
from Telstra_Messaging.models.error_error_error import ErrorErrorError
3028
from Telstra_Messaging.models.get_subscription_response import GetSubscriptionResponse
3129
from Telstra_Messaging.models.inbound_poll_response import InboundPollResponse
3230
from Telstra_Messaging.models.mms_content import MMSContent
3331
from Telstra_Messaging.models.message import Message
3432
from Telstra_Messaging.models.message_sent_response import MessageSentResponse
35-
from Telstra_Messaging.models.message_type import MessageType
36-
from Telstra_Messaging.models.o_auth_request import OAuthRequest
3733
from Telstra_Messaging.models.o_auth_response import OAuthResponse
3834
from Telstra_Messaging.models.outbound_poll_response import OutboundPollResponse
3935
from Telstra_Messaging.models.provision_number_request import ProvisionNumberRequest

Telstra_Messaging/__init__.pyc

2.63 KB
Binary file not shown.

Telstra_Messaging/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# flake8: noqa
44

55
# import apis into api package
6+
from Telstra_Messaging.api.authentication_api import AuthenticationApi
67
from Telstra_Messaging.api.messaging_api import MessagingApi
78
from Telstra_Messaging.api.provisioning_api import ProvisioningApi
8-
from Telstra_Messaging.api.authentication_api import AuthenticationApi

Telstra_Messaging/api/__init__.pyc

511 Bytes
Binary file not shown.

Telstra_Messaging/api/auth_api.pyc

4.82 KB
Binary file not shown.

0 commit comments

Comments
 (0)