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 8f9cd23 commit 7bfc015
Show file tree
Hide file tree
Showing 96 changed files with 273 additions and 200 deletions.
26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# 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

## Requirements.

Expand Down Expand Up @@ -44,19 +43,18 @@ import time
import Telstra_Messaging
from Telstra_Messaging.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: auth
Telstra_Messaging.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = Telstra_Messaging.MessagingApi()
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
api_instance = Telstra_Messaging.AuthenticationApi()
client_id = 'client_id_example' # str |
client_secret = 'client_secret_example' # str |
grant_type = 'client_credentials' # str | (default to client_credentials)

try:
# Get MMS Status
api_response = api_instance.get_mms_status(messageid)
# Generate OAuth2 token
api_response = api_instance.auth_token(client_id, client_secret, grant_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling MessagingApi->get_mms_status: %s\n" % e)
print("Exception when calling AuthenticationApi->auth_token: %s\n" % e)

```

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

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


## Documentation For Models

- [DeleteNumberRequest](docs/DeleteNumberRequest.md)
- [ErrorError](docs/ErrorError.md)
- [ErrorErrorError](docs/ErrorErrorError.md)
- [GetSubscriptionResponse](docs/GetSubscriptionResponse.md)
- [InboundPollResponse](docs/InboundPollResponse.md)
- [MMSContent](docs/MMSContent.md)
- [Message](docs/Message.md)
- [MessageSentResponse](docs/MessageSentResponse.md)
- [MessageType](docs/MessageType.md)
- [OAuthRequest](docs/OAuthRequest.md)
- [OAuthResponse](docs/OAuthResponse.md)
- [OutboundPollResponse](docs/OutboundPollResponse.md)
- [ProvisionNumberRequest](docs/ProvisionNumberRequest.md)
Expand Down
10 changes: 3 additions & 7 deletions Telstra_Messaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"""
Telstra Messaging API
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
# 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
OpenAPI spec version: 2.2.4
OpenAPI spec version: 2.2.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand All @@ -16,24 +16,20 @@
from __future__ import absolute_import

# import apis into sdk package
from Telstra_Messaging.api.authentication_api import AuthenticationApi
from Telstra_Messaging.api.messaging_api import MessagingApi
from Telstra_Messaging.api.provisioning_api import ProvisioningApi
from Telstra_Messaging.api.authentication_api import AuthenticationApi

# import ApiClient
from Telstra_Messaging.api_client import ApiClient
from Telstra_Messaging.configuration import Configuration
# import models into sdk package
from Telstra_Messaging.models.delete_number_request import DeleteNumberRequest
from Telstra_Messaging.models.error_error import ErrorError
from Telstra_Messaging.models.error_error_error import ErrorErrorError
from Telstra_Messaging.models.get_subscription_response import GetSubscriptionResponse
from Telstra_Messaging.models.inbound_poll_response import InboundPollResponse
from Telstra_Messaging.models.mms_content import MMSContent
from Telstra_Messaging.models.message import Message
from Telstra_Messaging.models.message_sent_response import MessageSentResponse
from Telstra_Messaging.models.message_type import MessageType
from Telstra_Messaging.models.o_auth_request import OAuthRequest
from Telstra_Messaging.models.o_auth_response import OAuthResponse
from Telstra_Messaging.models.outbound_poll_response import OutboundPollResponse
from Telstra_Messaging.models.provision_number_request import ProvisionNumberRequest
Expand Down
Binary file added Telstra_Messaging/__init__.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Telstra_Messaging/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# flake8: noqa

# import apis into api package
from Telstra_Messaging.api.authentication_api import AuthenticationApi
from Telstra_Messaging.api.messaging_api import MessagingApi
from Telstra_Messaging.api.provisioning_api import ProvisioningApi
from Telstra_Messaging.api.authentication_api import AuthenticationApi
Binary file added Telstra_Messaging/api/__init__.pyc
Binary file not shown.
Binary file added Telstra_Messaging/api/auth_api.pyc
Binary file not shown.
Loading

0 comments on commit 7bfc015

Please sign in to comment.