Telstra_Messaging 1.0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +253 -0
- data/Rakefile +10 -0
- data/Telstra_Messaging.gemspec +45 -0
- data/docs/AuthenticationApi.md +58 -0
- data/docs/DeleteNumberRequest.md +8 -0
- data/docs/GetSubscriptionResponse.md +10 -0
- data/docs/InboundPollResponse.md +13 -0
- data/docs/MMSContent.md +10 -0
- data/docs/Message.md +11 -0
- data/docs/MessageSentResponse.md +11 -0
- data/docs/MessagingApi.md +310 -0
- data/docs/OAuthResponse.md +10 -0
- data/docs/OutboundPollResponse.md +11 -0
- data/docs/ProvisionNumberRequest.md +9 -0
- data/docs/ProvisionNumberResponse.md +10 -0
- data/docs/ProvisioningApi.md +156 -0
- data/docs/SendMmsRequest.md +13 -0
- data/docs/SendSMSRequest.md +15 -0
- data/docs/Status.md +7 -0
- data/lib/Telstra_Messaging.rb +55 -0
- data/lib/Telstra_Messaging/api/authentication_api.rb +92 -0
- data/lib/Telstra_Messaging/api/messaging_api.rb +331 -0
- data/lib/Telstra_Messaging/api/provisioning_api.rb +174 -0
- data/lib/Telstra_Messaging/api_client.rb +389 -0
- data/lib/Telstra_Messaging/api_error.rb +38 -0
- data/lib/Telstra_Messaging/configuration.rb +209 -0
- data/lib/Telstra_Messaging/models/delete_number_request.rb +186 -0
- data/lib/Telstra_Messaging/models/get_subscription_response.rb +204 -0
- data/lib/Telstra_Messaging/models/inbound_poll_response.rb +235 -0
- data/lib/Telstra_Messaging/models/message.rb +229 -0
- data/lib/Telstra_Messaging/models/message_sent_response.rb +233 -0
- data/lib/Telstra_Messaging/models/mms_content.rb +219 -0
- data/lib/Telstra_Messaging/models/o_auth_response.rb +204 -0
- data/lib/Telstra_Messaging/models/outbound_poll_response.rb +213 -0
- data/lib/Telstra_Messaging/models/provision_number_request.rb +194 -0
- data/lib/Telstra_Messaging/models/provision_number_response.rb +204 -0
- data/lib/Telstra_Messaging/models/send_mms_request.rb +261 -0
- data/lib/Telstra_Messaging/models/send_sms_request.rb +264 -0
- data/lib/Telstra_Messaging/models/status.rb +36 -0
- data/lib/Telstra_Messaging/version.rb +15 -0
- data/spec/api/authentication_api_spec.rb +49 -0
- data/spec/api/messaging_api_spec.rb +109 -0
- data/spec/api/provisioning_api_spec.rb +70 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/delete_number_request_spec.rb +41 -0
- data/spec/models/get_subscription_response_spec.rb +53 -0
- data/spec/models/inbound_poll_response_spec.rb +71 -0
- data/spec/models/message_sent_response_spec.rb +65 -0
- data/spec/models/message_spec.rb +59 -0
- data/spec/models/mms_content_spec.rb +53 -0
- data/spec/models/o_auth_response_spec.rb +53 -0
- data/spec/models/outbound_poll_response_spec.rb +59 -0
- data/spec/models/provision_number_request_spec.rb +53 -0
- data/spec/models/provision_number_response_spec.rb +41 -0
- data/spec/models/send_mms_request_spec.rb +71 -0
- data/spec/models/send_sms_request_spec.rb +83 -0
- data/spec/models/status_spec.rb +35 -0
- data/spec/spec_helper.rb +111 -0
- metadata +413 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
# Telstra_Messaging::MessageSentResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**messages** | [**Array<Message>**](Message.md) | An array of messages. |
|
7
|
+
**country** | **Array<Object>** | An array of the countries to which the destination MSISDNs belong. | [optional]
|
8
|
+
**message_type** | **String** | This returns whether the message sent was a SMS or MMS. |
|
9
|
+
**number_segments** | **Integer** | For SMS messages only, the value indicates the number of 160 character message segments sent. |
|
10
|
+
|
11
|
+
|
@@ -0,0 +1,310 @@
|
|
1
|
+
# Telstra_Messaging::MessagingApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://tapi.telstra.com/v2*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_mms_status**](MessagingApi.md#get_mms_status) | **GET** /messages/mms/{messageid}/status | Get MMS Status
|
8
|
+
[**get_sms_status**](MessagingApi.md#get_sms_status) | **GET** /messages/sms/{messageId}/status | Get SMS Status
|
9
|
+
[**retrieve_mms_responses**](MessagingApi.md#retrieve_mms_responses) | **GET** /messages/mms | Retrieve MMS Responses
|
10
|
+
[**retrieve_sms_responses**](MessagingApi.md#retrieve_sms_responses) | **GET** /messages/sms | Retrieve SMS Responses
|
11
|
+
[**send_mms**](MessagingApi.md#send_mms) | **POST** /messages/mms | Send MMS
|
12
|
+
[**send_sms**](MessagingApi.md#send_sms) | **POST** /messages/sms | Send SMS
|
13
|
+
|
14
|
+
|
15
|
+
# **get_mms_status**
|
16
|
+
> Array<OutboundPollResponse> get_mms_status(messageid)
|
17
|
+
|
18
|
+
Get MMS Status
|
19
|
+
|
20
|
+
Get MMS Status
|
21
|
+
|
22
|
+
### Example
|
23
|
+
```ruby
|
24
|
+
# load the gem
|
25
|
+
require 'Telstra_Messaging'
|
26
|
+
# setup authorization
|
27
|
+
Telstra_Messaging.configure do |config|
|
28
|
+
# Configure OAuth2 access token for authorization: auth
|
29
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = Telstra_Messaging::MessagingApi.new
|
33
|
+
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
|
34
|
+
|
35
|
+
begin
|
36
|
+
#Get MMS Status
|
37
|
+
result = api_instance.get_mms_status(messageid)
|
38
|
+
p result
|
39
|
+
rescue Telstra_Messaging::ApiError => e
|
40
|
+
puts "Exception when calling MessagingApi->get_mms_status: #{e}"
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
### Parameters
|
45
|
+
|
46
|
+
Name | Type | Description | Notes
|
47
|
+
------------- | ------------- | ------------- | -------------
|
48
|
+
**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 |
|
49
|
+
|
50
|
+
### Return type
|
51
|
+
|
52
|
+
[**Array<OutboundPollResponse>**](OutboundPollResponse.md)
|
53
|
+
|
54
|
+
### Authorization
|
55
|
+
|
56
|
+
[auth](../README.md#auth)
|
57
|
+
|
58
|
+
### HTTP request headers
|
59
|
+
|
60
|
+
- **Content-Type**: Not defined
|
61
|
+
- **Accept**: application/json
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
# **get_sms_status**
|
66
|
+
> Array<OutboundPollResponse> get_sms_status(message_id)
|
67
|
+
|
68
|
+
Get SMS Status
|
69
|
+
|
70
|
+
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.
|
71
|
+
|
72
|
+
### Example
|
73
|
+
```ruby
|
74
|
+
# load the gem
|
75
|
+
require 'Telstra_Messaging'
|
76
|
+
# setup authorization
|
77
|
+
Telstra_Messaging.configure do |config|
|
78
|
+
# Configure OAuth2 access token for authorization: auth
|
79
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
80
|
+
end
|
81
|
+
|
82
|
+
api_instance = Telstra_Messaging::MessagingApi.new
|
83
|
+
message_id = 'message_id_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
|
+
|
85
|
+
begin
|
86
|
+
#Get SMS Status
|
87
|
+
result = api_instance.get_sms_status(message_id)
|
88
|
+
p result
|
89
|
+
rescue Telstra_Messaging::ApiError => e
|
90
|
+
puts "Exception when calling MessagingApi->get_sms_status: #{e}"
|
91
|
+
end
|
92
|
+
```
|
93
|
+
|
94
|
+
### Parameters
|
95
|
+
|
96
|
+
Name | Type | Description | Notes
|
97
|
+
------------- | ------------- | ------------- | -------------
|
98
|
+
**message_id** | **String**| Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms. |
|
99
|
+
|
100
|
+
### Return type
|
101
|
+
|
102
|
+
[**Array<OutboundPollResponse>**](OutboundPollResponse.md)
|
103
|
+
|
104
|
+
### Authorization
|
105
|
+
|
106
|
+
[auth](../README.md#auth)
|
107
|
+
|
108
|
+
### HTTP request headers
|
109
|
+
|
110
|
+
- **Content-Type**: Not defined
|
111
|
+
- **Accept**: application/json
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
# **retrieve_mms_responses**
|
116
|
+
> Array<MMSContent> retrieve_mms_responses
|
117
|
+
|
118
|
+
Retrieve MMS Responses
|
119
|
+
|
120
|
+
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. |
|
121
|
+
|
122
|
+
### Example
|
123
|
+
```ruby
|
124
|
+
# load the gem
|
125
|
+
require 'Telstra_Messaging'
|
126
|
+
# setup authorization
|
127
|
+
Telstra_Messaging.configure do |config|
|
128
|
+
# Configure OAuth2 access token for authorization: auth
|
129
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
130
|
+
end
|
131
|
+
|
132
|
+
api_instance = Telstra_Messaging::MessagingApi.new
|
133
|
+
|
134
|
+
begin
|
135
|
+
#Retrieve MMS Responses
|
136
|
+
result = api_instance.retrieve_mms_responses
|
137
|
+
p result
|
138
|
+
rescue Telstra_Messaging::ApiError => e
|
139
|
+
puts "Exception when calling MessagingApi->retrieve_mms_responses: #{e}"
|
140
|
+
end
|
141
|
+
```
|
142
|
+
|
143
|
+
### Parameters
|
144
|
+
This endpoint does not need any parameter.
|
145
|
+
|
146
|
+
### Return type
|
147
|
+
|
148
|
+
[**Array<MMSContent>**](MMSContent.md)
|
149
|
+
|
150
|
+
### Authorization
|
151
|
+
|
152
|
+
[auth](../README.md#auth)
|
153
|
+
|
154
|
+
### HTTP request headers
|
155
|
+
|
156
|
+
- **Content-Type**: Not defined
|
157
|
+
- **Accept**: application/json
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
# **retrieve_sms_responses**
|
162
|
+
> InboundPollResponse retrieve_sms_responses
|
163
|
+
|
164
|
+
Retrieve SMS Responses
|
165
|
+
|
166
|
+
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. |
|
167
|
+
|
168
|
+
### Example
|
169
|
+
```ruby
|
170
|
+
# load the gem
|
171
|
+
require 'Telstra_Messaging'
|
172
|
+
# setup authorization
|
173
|
+
Telstra_Messaging.configure do |config|
|
174
|
+
# Configure OAuth2 access token for authorization: auth
|
175
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
176
|
+
end
|
177
|
+
|
178
|
+
api_instance = Telstra_Messaging::MessagingApi.new
|
179
|
+
|
180
|
+
begin
|
181
|
+
#Retrieve SMS Responses
|
182
|
+
result = api_instance.retrieve_sms_responses
|
183
|
+
p result
|
184
|
+
rescue Telstra_Messaging::ApiError => e
|
185
|
+
puts "Exception when calling MessagingApi->retrieve_sms_responses: #{e}"
|
186
|
+
end
|
187
|
+
```
|
188
|
+
|
189
|
+
### Parameters
|
190
|
+
This endpoint does not need any parameter.
|
191
|
+
|
192
|
+
### Return type
|
193
|
+
|
194
|
+
[**InboundPollResponse**](InboundPollResponse.md)
|
195
|
+
|
196
|
+
### Authorization
|
197
|
+
|
198
|
+
[auth](../README.md#auth)
|
199
|
+
|
200
|
+
### HTTP request headers
|
201
|
+
|
202
|
+
- **Content-Type**: Not defined
|
203
|
+
- **Accept**: application/json
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
# **send_mms**
|
208
|
+
> MessageSentResponse send_mms(send_mms_request)
|
209
|
+
|
210
|
+
Send MMS
|
211
|
+
|
212
|
+
Send MMS
|
213
|
+
|
214
|
+
### Example
|
215
|
+
```ruby
|
216
|
+
# load the gem
|
217
|
+
require 'Telstra_Messaging'
|
218
|
+
# setup authorization
|
219
|
+
Telstra_Messaging.configure do |config|
|
220
|
+
# Configure OAuth2 access token for authorization: auth
|
221
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
222
|
+
end
|
223
|
+
|
224
|
+
api_instance = Telstra_Messaging::MessagingApi.new
|
225
|
+
send_mms_request = Telstra_Messaging::SendMmsRequest.new # 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.
|
226
|
+
|
227
|
+
|
228
|
+
begin
|
229
|
+
#Send MMS
|
230
|
+
result = api_instance.send_mms(send_mms_request)
|
231
|
+
p result
|
232
|
+
rescue Telstra_Messaging::ApiError => e
|
233
|
+
puts "Exception when calling MessagingApi->send_mms: #{e}"
|
234
|
+
end
|
235
|
+
```
|
236
|
+
|
237
|
+
### Parameters
|
238
|
+
|
239
|
+
Name | Type | Description | Notes
|
240
|
+
------------- | ------------- | ------------- | -------------
|
241
|
+
**send_mms_request** | [**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.
|
242
|
+
|
|
243
|
+
|
244
|
+
### Return type
|
245
|
+
|
246
|
+
[**MessageSentResponse**](MessageSentResponse.md)
|
247
|
+
|
248
|
+
### Authorization
|
249
|
+
|
250
|
+
[auth](../README.md#auth)
|
251
|
+
|
252
|
+
### HTTP request headers
|
253
|
+
|
254
|
+
- **Content-Type**: application/json
|
255
|
+
- **Accept**: application/json
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
# **send_sms**
|
260
|
+
> MessageSentResponse send_sms(send_sms_request)
|
261
|
+
|
262
|
+
Send SMS
|
263
|
+
|
264
|
+
Send an SMS Message to a single or multiple mobile number/s.
|
265
|
+
|
266
|
+
### Example
|
267
|
+
```ruby
|
268
|
+
# load the gem
|
269
|
+
require 'Telstra_Messaging'
|
270
|
+
# setup authorization
|
271
|
+
Telstra_Messaging.configure do |config|
|
272
|
+
# Configure OAuth2 access token for authorization: auth
|
273
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
274
|
+
end
|
275
|
+
|
276
|
+
api_instance = Telstra_Messaging::MessagingApi.new
|
277
|
+
send_sms_request = Telstra_Messaging::SendSMSRequest.new # 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.
|
278
|
+
|
279
|
+
|
280
|
+
begin
|
281
|
+
#Send SMS
|
282
|
+
result = api_instance.send_sms(send_sms_request)
|
283
|
+
p result
|
284
|
+
rescue Telstra_Messaging::ApiError => e
|
285
|
+
puts "Exception when calling MessagingApi->send_sms: #{e}"
|
286
|
+
end
|
287
|
+
```
|
288
|
+
|
289
|
+
### Parameters
|
290
|
+
|
291
|
+
Name | Type | Description | Notes
|
292
|
+
------------- | ------------- | ------------- | -------------
|
293
|
+
**send_sms_request** | [**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.
|
294
|
+
|
|
295
|
+
|
296
|
+
### Return type
|
297
|
+
|
298
|
+
[**MessageSentResponse**](MessageSentResponse.md)
|
299
|
+
|
300
|
+
### Authorization
|
301
|
+
|
302
|
+
[auth](../README.md#auth)
|
303
|
+
|
304
|
+
### HTTP request headers
|
305
|
+
|
306
|
+
- **Content-Type**: application/json
|
307
|
+
- **Accept**: application/json
|
308
|
+
|
309
|
+
|
310
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Telstra_Messaging::OAuthResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**access_token** | **String** | OAuth access token | [optional]
|
7
|
+
**token_type** | **String** | OAuth token type | [optional]
|
8
|
+
**expires_in** | **String** | OAuth expiry time | [optional]
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Telstra_Messaging::OutboundPollResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**to** | **String** | The phone number (recipient) the message was sent to (in E.164 format). | [optional]
|
7
|
+
**sent_timestamp** | **String** | The date and time when the message was sent. | [optional]
|
8
|
+
**received_timestamp** | **String** | The date and time when the message was recieved by recipient. | [optional]
|
9
|
+
**delivery_status** | [**Status**](Status.md) | | [optional]
|
10
|
+
|
11
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Telstra_Messaging::ProvisionNumberRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**active_days** | **Integer** | The number of days before for which this number is provisioned. | [optional]
|
7
|
+
**notify_url** | **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]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Telstra_Messaging::ProvisionNumberResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**destination_address** | **String** | The mobile phone number that was allocated | [optional]
|
7
|
+
**description** | **String** | Metadata for provisioned numbers which are valid for more than 5 years | [optional]
|
8
|
+
**expiry_date** | **Float** | Free Trial apps will have a 30-Day Limit for their provisioned number. This is in Unix time format. | [optional]
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,156 @@
|
|
1
|
+
# Telstra_Messaging::ProvisioningApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://tapi.telstra.com/v2*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**create_subscription**](ProvisioningApi.md#create_subscription) | **POST** /messages/provisioning/subscriptions | Create Subscription
|
8
|
+
[**delete_subscription**](ProvisioningApi.md#delete_subscription) | **DELETE** /messages/provisioning/subscriptions | Delete Subscription
|
9
|
+
[**get_subscription**](ProvisioningApi.md#get_subscription) | **GET** /messages/provisioning/subscriptions | Get Subscription
|
10
|
+
|
11
|
+
|
12
|
+
# **create_subscription**
|
13
|
+
> ProvisionNumberResponse create_subscription(provision_number_request)
|
14
|
+
|
15
|
+
Create Subscription
|
16
|
+
|
17
|
+
Invoke the provisioning API to get a dedicated mobile number for an account or application. Note that Free Trial apps will have a 30-Day Limit for their provisioned number. If the Provisioning call is made several times within that 30-Day period, it will return the `expiryDate` in the Unix format and will not add any activeDays until after that `expiryDate`. For paid apps, a provisioned number can be allotted for a maximum of 5 years. If a Provisioning call is made which will result to activeDays > 1830, the response body will indicate that the provisioned number is already valid for more than 5 years.
|
18
|
+
|
19
|
+
### Example
|
20
|
+
```ruby
|
21
|
+
# load the gem
|
22
|
+
require 'Telstra_Messaging'
|
23
|
+
# setup authorization
|
24
|
+
Telstra_Messaging.configure do |config|
|
25
|
+
# Configure OAuth2 access token for authorization: auth
|
26
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
27
|
+
end
|
28
|
+
|
29
|
+
api_instance = Telstra_Messaging::ProvisioningApi.new
|
30
|
+
provision_number_request = Telstra_Messaging::ProvisionNumberRequest.new # ProvisionNumberRequest | A JSON payload containing the required attributes
|
31
|
+
|
32
|
+
begin
|
33
|
+
#Create Subscription
|
34
|
+
result = api_instance.create_subscription(provision_number_request)
|
35
|
+
p result
|
36
|
+
rescue Telstra_Messaging::ApiError => e
|
37
|
+
puts "Exception when calling ProvisioningApi->create_subscription: #{e}"
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
### Parameters
|
42
|
+
|
43
|
+
Name | Type | Description | Notes
|
44
|
+
------------- | ------------- | ------------- | -------------
|
45
|
+
**provision_number_request** | [**ProvisionNumberRequest**](ProvisionNumberRequest.md)| A JSON payload containing the required attributes |
|
46
|
+
|
47
|
+
### Return type
|
48
|
+
|
49
|
+
[**ProvisionNumberResponse**](ProvisionNumberResponse.md)
|
50
|
+
|
51
|
+
### Authorization
|
52
|
+
|
53
|
+
[auth](../README.md#auth)
|
54
|
+
|
55
|
+
### HTTP request headers
|
56
|
+
|
57
|
+
- **Content-Type**: application/json
|
58
|
+
- **Accept**: application/json
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
# **delete_subscription**
|
63
|
+
> delete_subscription(delete_number_request)
|
64
|
+
|
65
|
+
Delete Subscription
|
66
|
+
|
67
|
+
Delete a mobile number subscription from an account
|
68
|
+
|
69
|
+
### Example
|
70
|
+
```ruby
|
71
|
+
# load the gem
|
72
|
+
require 'Telstra_Messaging'
|
73
|
+
# setup authorization
|
74
|
+
Telstra_Messaging.configure do |config|
|
75
|
+
# Configure OAuth2 access token for authorization: auth
|
76
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
77
|
+
end
|
78
|
+
|
79
|
+
api_instance = Telstra_Messaging::ProvisioningApi.new
|
80
|
+
delete_number_request = Telstra_Messaging::DeleteNumberRequest.new # DeleteNumberRequest | EmptyArr
|
81
|
+
|
82
|
+
begin
|
83
|
+
#Delete Subscription
|
84
|
+
api_instance.delete_subscription(delete_number_request)
|
85
|
+
rescue Telstra_Messaging::ApiError => e
|
86
|
+
puts "Exception when calling ProvisioningApi->delete_subscription: #{e}"
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
90
|
+
### Parameters
|
91
|
+
|
92
|
+
Name | Type | Description | Notes
|
93
|
+
------------- | ------------- | ------------- | -------------
|
94
|
+
**delete_number_request** | [**DeleteNumberRequest**](DeleteNumberRequest.md)| EmptyArr |
|
95
|
+
|
96
|
+
### Return type
|
97
|
+
|
98
|
+
nil (empty response body)
|
99
|
+
|
100
|
+
### Authorization
|
101
|
+
|
102
|
+
[auth](../README.md#auth)
|
103
|
+
|
104
|
+
### HTTP request headers
|
105
|
+
|
106
|
+
- **Content-Type**: application/json
|
107
|
+
- **Accept**: Not defined
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
# **get_subscription**
|
112
|
+
> GetSubscriptionResponse get_subscription
|
113
|
+
|
114
|
+
Get Subscription
|
115
|
+
|
116
|
+
Get mobile number subscription for an account
|
117
|
+
|
118
|
+
### Example
|
119
|
+
```ruby
|
120
|
+
# load the gem
|
121
|
+
require 'Telstra_Messaging'
|
122
|
+
# setup authorization
|
123
|
+
Telstra_Messaging.configure do |config|
|
124
|
+
# Configure OAuth2 access token for authorization: auth
|
125
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
126
|
+
end
|
127
|
+
|
128
|
+
api_instance = Telstra_Messaging::ProvisioningApi.new
|
129
|
+
|
130
|
+
begin
|
131
|
+
#Get Subscription
|
132
|
+
result = api_instance.get_subscription
|
133
|
+
p result
|
134
|
+
rescue Telstra_Messaging::ApiError => e
|
135
|
+
puts "Exception when calling ProvisioningApi->get_subscription: #{e}"
|
136
|
+
end
|
137
|
+
```
|
138
|
+
|
139
|
+
### Parameters
|
140
|
+
This endpoint does not need any parameter.
|
141
|
+
|
142
|
+
### Return type
|
143
|
+
|
144
|
+
[**GetSubscriptionResponse**](GetSubscriptionResponse.md)
|
145
|
+
|
146
|
+
### Authorization
|
147
|
+
|
148
|
+
[auth](../README.md#auth)
|
149
|
+
|
150
|
+
### HTTP request headers
|
151
|
+
|
152
|
+
- **Content-Type**: Not defined
|
153
|
+
- **Accept**: application/json
|
154
|
+
|
155
|
+
|
156
|
+
|