From f44d809a8bd3809c10fe6790d54c87d087bb740e Mon Sep 17 00:00:00 2001 From: Yaser Adel Mehraban Date: Tue, 28 Jan 2020 09:05:26 +1100 Subject: [PATCH 1/2] Updated the SDK to v1.0.8 --- .gitignore | 21 ++ .travis.yml | 19 +- DockerFile | 7 + README.md | 67 ++-- build.gradle | 6 +- build.sbt | 6 +- docker-compose.yaml | 11 + gradle.properties | 3 +- gradle/wrapper/gradle-wrapper.jar | Bin 55190 -> 58702 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 51 +-- gradlew.bat | 18 +- pom.xml | 77 ++++- .../messaging/BackwardCompatibilityIT.java | 30 ++ src/main/java/com/telstra/ApiCallback.java | 2 +- src/main/java/com/telstra/ApiClient.java | 160 ++++++++- src/main/java/com/telstra/ApiException.java | 2 +- src/main/java/com/telstra/ApiResponse.java | 2 +- src/main/java/com/telstra/Configuration.java | 2 +- .../com/telstra/GzipRequestInterceptor.java | 2 +- src/main/java/com/telstra/JSON.java | 4 +- src/main/java/com/telstra/Pair.java | 2 +- .../java/com/telstra/ProgressRequestBody.java | 2 +- .../com/telstra/ProgressResponseBody.java | 2 +- src/main/java/com/telstra/StringUtil.java | 2 +- .../java/com/telstra/auth/ApiKeyAuth.java | 6 +- .../java/com/telstra/auth/Authentication.java | 5 +- .../java/com/telstra/auth/HttpBasicAuth.java | 4 +- .../java/com/telstra/auth/HttpBearerAuth.java | 60 ++++ src/main/java/com/telstra/auth/OAuth.java | 4 +- src/main/java/com/telstra/auth/OAuthFlow.java | 2 +- .../com/telstra/auth/OAuthOkHttpClient.java | 68 ++++ .../java/com/telstra/auth/RetryingOAuth.java | 174 ++++++++++ .../telstra/messaging/AuthenticationApi.java | 7 +- .../messaging/DeleteNumberRequest.java | 99 ------ .../com/telstra/messaging/GetMmsResponse.java | 305 ------------------ .../messaging/GetSubscriptionResponse.java | 157 --------- .../messaging/HealthCheckResponse.java | 100 ------ .../messaging/InboundPollResponse.java | 245 -------------- .../com/telstra/messaging/MMSContent.java | 154 --------- .../java/com/telstra/messaging/Message.java | 183 ----------- .../com/telstra/messaging/MessageMulti.java | 157 --------- .../messaging/MessageSentResponseMms.java | 228 ------------- .../messaging/MessageSentResponseSms.java | 199 ------------ .../com/telstra/messaging/MessagingApi.java | 47 +-- .../com/telstra/messaging/OAuthResponse.java | 157 --------- .../messaging/OutboundPollResponse.java | 187 ----------- .../messaging/ProvisionNumberRequest.java | 128 -------- .../messaging/ProvisionNumberResponse.java | 129 -------- .../telstra/messaging/ProvisioningApi.java | 19 +- .../com/telstra/messaging/SendMmsRequest.java | 250 -------------- .../messaging/SendSmsMultiRequest.java | 139 -------- .../java/com/telstra/messaging/Status.java | 85 ----- .../telstra/models/DeleteNumberRequest.java | 99 ++++++ .../com/telstra/models/GetMmsResponse.java | 305 ++++++++++++++++++ .../models/GetSubscriptionResponse.java | 157 +++++++++ .../telstra/models/HealthCheckResponse.java | 100 ++++++ .../telstra/models/InboundPollResponse.java | 245 ++++++++++++++ .../java/com/telstra/models/MMSContent.java | 154 +++++++++ src/main/java/com/telstra/models/Message.java | 183 +++++++++++ .../java/com/telstra/models/MessageMulti.java | 157 +++++++++ .../models/MessageSentResponseMms.java | 228 +++++++++++++ .../models/MessageSentResponseSms.java | 199 ++++++++++++ .../com/telstra/models/OAuthResponse.java | 157 +++++++++ .../telstra/models/OutboundPollResponse.java | 187 +++++++++++ .../models/ProvisionNumberRequest.java | 128 ++++++++ .../models/ProvisionNumberResponse.java | 129 ++++++++ .../com/telstra/models/SendMmsRequest.java | 250 ++++++++++++++ .../{messaging => models}/SendSMSRequest.java | 4 +- .../telstra/models/SendSmsMultiRequest.java | 139 ++++++++ src/main/java/com/telstra/models/Status.java | 85 +++++ .../messaging/AuthenticationApiTest.java | 4 +- .../telstra/messaging/MessagingApiTest.java | 20 +- .../messaging/ProvisioningApiTest.java | 10 +- .../models/DeleteNumberRequestTest.java | 51 +++ .../telstra/models/GetMmsResponseTest.java | 110 +++++++ .../models/GetSubscriptionResponseTest.java | 67 ++++ .../models/HealthCheckResponseTest.java | 51 +++ .../models/InboundPollResponseTest.java | 91 ++++++ .../com/telstra/models/MMSContentTest.java | 67 ++++ .../com/telstra/models/MessageMultiTest.java | 67 ++++ .../models/MessageSentResponseMmsTest.java | 86 +++++ .../models/MessageSentResponseSmsTest.java | 78 +++++ .../java/com/telstra/models/MessageTest.java | 75 +++++ .../com/telstra/models/OAuthResponseTest.java | 67 ++++ .../models/OutboundPollResponseTest.java | 76 +++++ .../models/ProvisionNumberRequestTest.java | 59 ++++ .../models/ProvisionNumberResponseTest.java | 60 ++++ .../telstra/models/SendMmsRequestTest.java | 94 ++++++ .../telstra/models/SendSMSRequestTest.java | 107 ++++++ .../models/SendSmsMultiRequestTest.java | 62 ++++ .../java/com/telstra/models/StatusTest.java | 34 ++ 92 files changed, 4968 insertions(+), 3072 deletions(-) create mode 100644 .gitignore create mode 100644 DockerFile create mode 100644 docker-compose.yaml create mode 100644 src/it/java/com/telstra/messaging/BackwardCompatibilityIT.java create mode 100644 src/main/java/com/telstra/auth/HttpBearerAuth.java create mode 100644 src/main/java/com/telstra/auth/OAuthOkHttpClient.java create mode 100644 src/main/java/com/telstra/auth/RetryingOAuth.java delete mode 100755 src/main/java/com/telstra/messaging/DeleteNumberRequest.java delete mode 100644 src/main/java/com/telstra/messaging/GetMmsResponse.java delete mode 100755 src/main/java/com/telstra/messaging/GetSubscriptionResponse.java delete mode 100644 src/main/java/com/telstra/messaging/HealthCheckResponse.java delete mode 100755 src/main/java/com/telstra/messaging/InboundPollResponse.java delete mode 100755 src/main/java/com/telstra/messaging/MMSContent.java delete mode 100755 src/main/java/com/telstra/messaging/Message.java delete mode 100644 src/main/java/com/telstra/messaging/MessageMulti.java delete mode 100644 src/main/java/com/telstra/messaging/MessageSentResponseMms.java delete mode 100644 src/main/java/com/telstra/messaging/MessageSentResponseSms.java delete mode 100755 src/main/java/com/telstra/messaging/OAuthResponse.java delete mode 100755 src/main/java/com/telstra/messaging/OutboundPollResponse.java delete mode 100755 src/main/java/com/telstra/messaging/ProvisionNumberRequest.java delete mode 100755 src/main/java/com/telstra/messaging/ProvisionNumberResponse.java delete mode 100755 src/main/java/com/telstra/messaging/SendMmsRequest.java delete mode 100644 src/main/java/com/telstra/messaging/SendSmsMultiRequest.java delete mode 100755 src/main/java/com/telstra/messaging/Status.java create mode 100644 src/main/java/com/telstra/models/DeleteNumberRequest.java create mode 100644 src/main/java/com/telstra/models/GetMmsResponse.java create mode 100644 src/main/java/com/telstra/models/GetSubscriptionResponse.java create mode 100644 src/main/java/com/telstra/models/HealthCheckResponse.java create mode 100644 src/main/java/com/telstra/models/InboundPollResponse.java create mode 100644 src/main/java/com/telstra/models/MMSContent.java create mode 100644 src/main/java/com/telstra/models/Message.java create mode 100644 src/main/java/com/telstra/models/MessageMulti.java create mode 100644 src/main/java/com/telstra/models/MessageSentResponseMms.java create mode 100644 src/main/java/com/telstra/models/MessageSentResponseSms.java create mode 100644 src/main/java/com/telstra/models/OAuthResponse.java create mode 100644 src/main/java/com/telstra/models/OutboundPollResponse.java create mode 100644 src/main/java/com/telstra/models/ProvisionNumberRequest.java create mode 100644 src/main/java/com/telstra/models/ProvisionNumberResponse.java create mode 100644 src/main/java/com/telstra/models/SendMmsRequest.java rename src/main/java/com/telstra/{messaging => models}/SendSMSRequest.java (58%) mode change 100755 => 100644 create mode 100644 src/main/java/com/telstra/models/SendSmsMultiRequest.java create mode 100644 src/main/java/com/telstra/models/Status.java create mode 100644 src/test/java/com/telstra/models/DeleteNumberRequestTest.java create mode 100644 src/test/java/com/telstra/models/GetMmsResponseTest.java create mode 100644 src/test/java/com/telstra/models/GetSubscriptionResponseTest.java create mode 100644 src/test/java/com/telstra/models/HealthCheckResponseTest.java create mode 100644 src/test/java/com/telstra/models/InboundPollResponseTest.java create mode 100644 src/test/java/com/telstra/models/MMSContentTest.java create mode 100644 src/test/java/com/telstra/models/MessageMultiTest.java create mode 100644 src/test/java/com/telstra/models/MessageSentResponseMmsTest.java create mode 100644 src/test/java/com/telstra/models/MessageSentResponseSmsTest.java create mode 100644 src/test/java/com/telstra/models/MessageTest.java create mode 100644 src/test/java/com/telstra/models/OAuthResponseTest.java create mode 100644 src/test/java/com/telstra/models/OutboundPollResponseTest.java create mode 100644 src/test/java/com/telstra/models/ProvisionNumberRequestTest.java create mode 100644 src/test/java/com/telstra/models/ProvisionNumberResponseTest.java create mode 100644 src/test/java/com/telstra/models/SendMmsRequestTest.java create mode 100644 src/test/java/com/telstra/models/SendSMSRequestTest.java create mode 100644 src/test/java/com/telstra/models/SendSmsMultiRequestTest.java create mode 100644 src/test/java/com/telstra/models/StatusTest.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a530464 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/.travis.yml b/.travis.yml index 80a7f2f..e3bdf2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,22 @@ # -# Generated by: https://openapi-generator.tech +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ # language: java jdk: - - oraclejdk8 - - oraclejdk7 + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 before_install: # ensure gradlew has proper permission - chmod a+x ./gradlew script: # test using maven - - mvn test - # uncomment below to test using gradle - # - gradle test - # uncomment below to test using sbt + #- mvn test + # test using gradle + - gradle test + # test using sbt # - sbt test diff --git a/DockerFile b/DockerFile new file mode 100644 index 0000000..7b3a234 --- /dev/null +++ b/DockerFile @@ -0,0 +1,7 @@ +FROM maven:3.6.3-jdk-11 + +WORKDIR /app + +COPY . . + +RUN mvn test diff --git a/README.md b/README.md index 996c386..1353ef9 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ Telstra Messaging API - API version: 2.2.9 +The API specification for Telstra Messaging API + + *Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* @@ -36,7 +39,7 @@ Add this dependency to your project's POM: Telstra TelstraMessaging - 1.0.0 + 1.0.8 compile ``` @@ -46,7 +49,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "Telstra:TelstraMessaging:1.0.0" +compile "Telstra:TelstraMessaging:1.0.8" ``` ### Others @@ -59,7 +62,7 @@ mvn clean package Then manually install the following JARs: -* `target/TelstraMessaging-1.0.0.jar` +* `target/TelstraMessaging-1.0.8.jar` * `target/lib/*.jar` ## Getting Started @@ -72,57 +75,24 @@ Please follow the [installation](#installation) instruction and execute the foll import com.telstra.ApiClient; import com.telstra.ApiException; import com.telstra.Configuration; -import com.telstra.auth.*; -import com.telstra.messaging.*; +import com.telstra.models.*; +import com.telstra.messaging.AuthenticationApi; public class Example { public static void main(String[] args) { - // Configure API base path ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://tapi.telstra.com/v2"); - // Configure OAuth2 access token for authorization - OAuth auth = (OAuth) defaultClient.getAuthentication("auth"); - AuthenticationApi authenticationApi = new AuthenticationApi(defaultClient); - String clientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; - String clientSecret = "xxxxxxxxxxxxxxxx"; - String grantType = "client_credentials"; - String scope = "NSMS"; - try { - OAuthResponse oAuthResponse = authenticationApi.authToken(clientId, clientSecret, grantType, scope); - auth.setAccessToken(oAuthResponse.getAccessToken()); - } catch (ApiException e) { - System.err.println("Exception when calling AuthenticationApi#authToken"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - // Configure phone number subscription - ProvisioningApi provisioningApiInstance = new ProvisioningApi(defaultClient); - try { - ProvisionNumberRequest provisionNumberRequest = new ProvisionNumberRequest(); - ProvisionNumberResponse result = provisioningApiInstance.createSubscription(provisionNumberRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ProvisioningApi#createSubscription"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - // Send SMS - MessagingApi msgingApiInstance = new MessagingApi(defaultClient); + AuthenticationApi apiInstance = new AuthenticationApi(defaultClient); + String clientId = "clientId_example"; // String | + String clientSecret = "clientSecret_example"; // String | + String grantType = "\"client_credentials\""; // String | + String scope = "scope_example"; // String | NSMS try { - SendSMSRequest sendSmsRequest = new SendSMSRequest(); - sendSmsRequest.to("+61xxxxxxxxx"); - sendSmsRequest.body("Hello from Java!"); - MessageSentResponseSms result = msgingApiInstance.sendSMS(sendSmsRequest); + OAuthResponse result = apiInstance.authToken(clientId, clientSecret, grantType, scope); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MessagingApi#sendSMS"); + System.err.println("Exception when calling AuthenticationApi#authToken"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -183,8 +153,8 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: application -- **Authorization URL**: -- **Scopes**: +- **Authorization URL**: +- **Scopes**: - NSMS: NSMS @@ -193,3 +163,6 @@ Authentication schemes defined for the API: It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author + + + diff --git a/build.gradle b/build.gradle index 64360ef..f427ab0 100755 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'java' group = 'Telstra' -version = '1.0.0' +version = '1.0.8' buildscript { repositories { @@ -104,8 +104,10 @@ dependencies { compile 'com.squareup.okhttp3:logging-interceptor:3.14.2' compile 'com.google.code.gson:gson:2.8.5' compile 'io.gsonfire:gson-fire:1.8.3' + compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9' compile 'org.threeten:threetenbp:1.4.0' - testCompile 'junit:junit:4.12' + testCompile 'junit:junit:4.13' } javadoc { diff --git a/build.sbt b/build.sbt index 591f2c6..206b0e1 100755 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "Telstra", name := "TelstraMessaging", - version := "1.0.0", + version := "1.0.8", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), @@ -13,10 +13,12 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "3.14.2", "com.squareup.okhttp3" % "logging-interceptor" % "3.14.2", "com.google.code.gson" % "gson" % "2.8.5", + "org.apache.commons" % "commons-lang3" % "3.9", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.0" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "javax.annotation" % "jsr250-api" % "1.0" % "compile", - "junit" % "junit" % "4.12" % "test", + "junit" % "junit" % "4.13" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..44446f8 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3' +services: + telstradev: + environment: + - CLIENT_ID + - CLIENT_SECRET + - PHONE_NO + - FROM_ALIAS + build: + context: . + dockerfile: DockerFile \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 05644f0..584f635 100755 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1 @@ -# Uncomment to build for Android -#target = android \ No newline at end of file +# # Uncomment to build for Android diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 87b738cbd051603d91cc39de6cb000dd98fe6b02..cc4fdc293d0e50b0ad9b65c16e7ddd1db2f6025b 100755 GIT binary patch delta 19358 zcmY(pV{o8d(5{ZQC{`wryj-XMelu)c1G&>snpi*Ij)j z*Zi0s|4~Z|ijYLUP}~Lz0)q1c1cWi+FDYh%JSaLq#>`-1Yvke*tvq4B@C%)Pq1BDK zIQT)#EAf|sl$A{%#~%o_xL*u(%5DKGvKPc@<2VxgFdyi696#%Je!Nf()}g^b>$x(! z5V=e*wLMSI7;FO|o)KLj_pJ?oIzX>>yJO{ukbK!7Fte=+HeCX=D}FQV5FD4Gw&K_n zY(<3u{AM$zj3&h>$KjLHMN4LUa^Cj2Z~-?-%;SU>^;GBsBTn}3O55XXDsz;y5~OAY zSYB7KBRi_r3vTl~W-U3cRKF;~ak&Gk)P0Es$0d*FWU|Vp$;Jy$CG;$sPCeGHsaTiP z4NncIlCZfeRlg)qq1#_qD9S})ZFMOQN=@s4bF>6gFQMf!=ODhvTc$x$+mM?&s#*c7 zQ>Fxy1o%XLzBNFh__2<_7^(y8l9rP}@w?!`?pl~Uvv+MEh(9ffVf~Y`zY}qiwC-7QwQAAK1HlX*=@dA`<_1BGwq_?)Qy1m~v*o zz0;*gj^vo-!38?YFsICVrg8@}*HphDWO7AoonvvLB<3LhQ^osqQ@FtUxh^WHe9(GG zcYvoVY<;B{!5dUbf2hwvQRW9YEC>iRGzbWY5Qr5hT?G*Y2ngAKPxSxqpYefp6*LX( zZvvOqTDm{XG~t1D!crh;j7{pb>d{oQ5cHsSjcW{J#Fh5$r{)E-*4I^Ce9r+bUocPP zD=bY5DelEU!u|tqhm@3YXYb@{!}jB|9_P2f=O?p&!HbkQ2pWt200az{NNOSzxe4y| z_>E8!6RDB9IDCq!?ywKb(O&>#q%#T`(^R)l&8d?}SYEL@#8Iyw3RRhfq?OnNpOf5o zC0yT^ObE_MX=OaJ;3p!3k<_ps=+DsnU^7UwakjQB=0@kV6r8{kR}~L=))&+NHQYJ?031gnbd?2_%unt)+V$ z--Rvd7U-(rby)aBaMZhoV{Y;y z5Ik;Jx=P6x%>ab)vVz<|Uf8P$6OanjWpv*_1&ob>-{TBT9^>c5ssuLUKd4djcUXPp zt7xIyqyw|GG)xZyHGtJ!vnImfg;kcgHknMa-n?bK0!4P#((vu$nYzQ=QTW!9 zxJG4wzX|=MT->&3y_03haK<^0T7qg$oNCBz^7tYzDWH5H?_PCrqkQizNv1>TYQz6` z+-&NIVko21p}xK3*fN|8_l~2-)+HKsBdKPkU-6TF{$RNP_QveWbd9b~a}VN*2fqDZ z^NL}|V)LpkNu&4eOlM(Yw)~ygIb&&tN9B5F5xq74O?-1{TxqEnGb22d&a&>iIn15f z8ot?c0^lB_QggM-1$-vIq1Ow(XuR{kZenQqO#&=`b|w^( zavOMRG)HWj^jZG(!jw4qJ+oB$&G=9)67vR#BntUIb>ym?6uK}9ZH6H}H#v|aAIIa8 z2Rbtj_T@5jgS*sZl16x?I+^oDYcFBm$Op6cLWBPX{}FYUZ%f75D$WsoxGY=Rv&erv z@$yBh+i>)}hI}d`RePv1@hAK|Kfzla{MvxrQ^QZi`NY#Ji2dyOh5JbGdz7%f2*c_R z3brCwmTDQ*lJ(zTB`{CSU^K!p2^&A#ohTtKsQH|aAz|Z*ib0UjutE92pTI|;xyDR4 zy15iif0*uFd#HqbgCy8M-Xc(wn{aS}gMh3+{Wnkl?*s*)V4y_J%#GY^T@%i+34tQD zO%*&f^zThu4!8+OWl5^UX8&e(aOraO#=we;H@yfwxe`}5H$-$_<|dk39v_}Z~F`ExbUbm91h#Mmq{Gn6rt0UBqD|M*gRK& z!WlbhFF%0!M+$rtt0;brE~bEp#Mb@9Y5j~$j3nc$uaVHpX(x+0_L+1)iWwnv=sqt2 z{!_B<$bQj8x5krLQG5$+fMe467lZ-bntoHgm-vg=E+jmi#7l|YKg4MkT|o9qXs7O{ zPce4Ch<DLkQ90Y0vFIFki_EwJ5y``6gEzCw<>uD-l~e{`K59u0#)|utxTPrJ#U?GAKow z1w>?jz&zA)&V}0YFP1%bDo`*U!;*^EXEsPhjP4M18=^f7Gq$v83Bec{m~xnyo2@%y zO|Skthc5O>mZxT5U7v?jz`2166KvfjTntaGS<}r@n$StbscaJ=0L#%L$lNw^FLa#F zQ|)eSE#AzPRK5qi(GfX?zR|cRgriZ1%O4SLWKN;-4WZN62n+&F0&tqle?HRsk$_ok zINsaX*ePwc8Ne|BTI5#xa2j5Yw{ma1K!suf-)X+xR`e4hNsZnxhXiAu`0qwg^ zzpz8^TtYKkqja3m23*FRLyb~*t1#`Q;;&(p*zq=vac}D=L#Ao(CmTggr@-G+pkb2GbsvQOmYv6CH#E;Fqn?IDj1Jg~`lM=yI?L(naC zL@Aa#;Al(hh`&_dosq4=W*z*v`^0~I0gHZ#|JzN%H>>bk0N_b1y5VWG%3hK=|9N7| zVDEfJ$zx<%Q3KxfE@Xa#U*e^fRWIMby2iI$|CAnAbU84=UYP%2H+DWH-{)Tx`>ACW zv1Eiz_V1+rJGr*I;G&zdkZ3lH$O%@E+MRk&)-vM)@)kWlV)Li>D6VpczFT$d6HlXO zWys=#-x5{L5B(5G^{b+B#EX?r03Smb&y| zZQOHjpOJpZD{aYM_ByLQLXoo&qPH`0k$(CMW-@?QNsmdl`Yq4%A2%QJ9lszn)t+hr zF49x$!=o3vY9y+EP)%p5;>NvItCbjQF@{PM{coZw+g4P2b`;~3J zBSZ6#Rg3WlN%c?>f_0aFMXjUAK>exU|85wCtQ?{~L=X@(LJ$z*|F@u^f&U3|Ra!8f zx*Bd@vF2V11tmi!I!`O%tT84M%ecHT1QX$C6Xz>;lFOPb_4`~3^9gKEmf~q%COTUF zzcw)~VM7{2enBHk`qy%y$I7BJxiZu1od{z|pQg`ux#kr$f(2%nO9QKI7fES66gaCl!_7a3+*T7d1 z!1c%dp#7rvFS)s<=tk=Wb_A1xuW80T5I$1s_kFBi9N0f%al30mH5PAvuuslo22i8^ z%27?*V;-{k!|1=+Y9EoKz>FSQX1)ZU01oy?GMZW)gu9HrX!@_Wm^G7G8nw`mYbH~# zU+SaMD!56DfLdrJ2bt+OuF5j5a}YHrB-77x*|xF7+W3y_(=Hg^1Sgijj3@2_caGgF89hk~{S66!W!r-Sle^8}CkoOmxR9QM!AxKGXWdF#R~XfL0V?SY zrLu|1_@AcDvIor(%{4+PE&{Cir-Q}`fD^Zo{mI#AnKW566&dZPg4TEK%~m6>B>d=DvxVvY`B|f9HtOQFR2!rmUTX!+ zPG$*MYb_T!uQsWX%aiL!^u|FI0;oM02^*#hAP&V0_uN>3_S|A{to7DZNMrM(i_ZTO zD=bT@X>pq}@`1g?H|l zYTafd(T1`;>mZd^zql8NI{ttOO_#2-tE_T^dp4BvxSO=jk3)133sYH+ft5OH~VhZlZ z_@6<9Rq;)D@06@?Bu3ejqlj1Si{Nox!`6rC%!*R+_yX$w>AzV{%?|51_{;RQWo5!v zYQld*nMbA^q>0=%ZqZe0i=!AXqbN$N0MZ_Dzlpg?F@4hS^z2v#ei4f{sUp3(s}rf~ zmWA-vJ#DRFwemue{TLSUo@pM+ig9;K)yrkL$#H@}vx~D`+kW?~FJ&_O>de2d_UEJI z?1gCw=-$Lh#hiU!d#-J;>TGI>$cl}il-&6{?G)e2y+dX$GUVxkNn@mzZZsXJs0Il6Zp%pH`pxjxlj?qiX4W3Ku~?2tag+NKKWjN_L(;Vwh;7p_YROFR0OT@+ia}MA zc*+e%>`{)nTqFH#)v&%aRyZ=^X0nc_gW27dWZq00IY!~3NCbjgc*~w>*+^Wwi(Zrj z%?WHQ`|$UPFf&HdD{>)`sdz`lH$nt0H_#Il1VrOB*-wrR{lsgfc4=Hb%$fAmQB4hg zN$sjUUy7hx>hu@c)wXD>$p-N8YdtGDGX?Jc zB|;}f;}@HdrV?YbL8fFQ(oh2F<-6@a_Yw+%e(r*rnM$(+^qnI);CwGUBb(%D8s>a| z4l~Db+%%gZIW@vPWYDx9Ywzj>H9Xd$e=HGi+LV$~rO}8?b`3p_(${mRlwl!qu-CVw z5sOEx2|c#@b#M#JxO`Af>+Y|$07Ag!F`U08#un@^jT|5=wE(+J)`t-IkvT=Wj*I%w ze$v%;GB|_7-2D^)GA4?X`RHPig=yH_O$| zQ*hlwxteS*EzvT_?Xjx6-1st#XI<`luVUlo%BhvT%noNd-608is+MzanEdac?boLE zZnxU2vw?)dvD!pAi^fDv)@uij8moc*?UT$lY3F6}qu%O2*K(OIj!9akE>#&_jXApR znV!Leva@$)AUk|AOZ5xNk#c9alVKI=z$bYJZ)Z;DSST3J+kAaixyu9HMwY~O31>hRQz zH%w$mT2;TDvpd~6m8p8P(@(otxf7Y)1Do+@W9fr$pjqzq*kWomd@|4xt9q@R^ke*( zjCA=ao#8t~MN=?g-bl~b zX1Y)uFPG8Sq2`^u#8H-3KP^KeSOdHKXlWCG(bucCs4KAvUn!I(eyO%dt;4sL%+vJ^ z$PXJ+CYz)z+Z{e*xb|q>k2|9R@F}GvM0&AXn%n6jzY!5A(~~MDj(jI4Hs#u$9sO#O z@unT9UsYp?Miead9$%z7LwL8x+fov-j~!@f?%8^4fS{9vQr9=_YLe7}JNa*Tb@*w+ z!=D(O@+N9*2Qx-)B`s~_2U+5Ohz%A1tKiPQCSuYsJmD>T`-=y9n|>MdlCmxPHNw&@ zC6%rMjsv(f?qH}E4Gn&TW18h-$9tdJJJuECPV%s5))hAFPB&b+f4Da4>IU^5i)_nh z7Ir3=u(sKyetXoKy0E(5ds3BiY!(uB_ZCLYf0s4yxf@^RFj@F%D_ksp+dt_6x_98~ z&X!28)dTRa&L@@~G3LtlK8Scc=d?9=*8Hl#B?RP9*tus~o;S|+{ERORfQ!d9G8-uX$rB2SKLX9l)2D?=nVOj(J3-w^P;v`@ zHFD1tgvBhHh1eaTWX0<>VO*=whJF@FHptT%}P&v>3| zy-@HEI8h0nWfqunGS1;gYqMN3BA=13e`Fh6&9`9D_27LSlRuYgEsI{l;PK5*<;B{} zejAr>JEN!HK?jw#TYbVe!*d+hs&Q>h=h%I;1qrUdHkjag=rc5x88~nmEI*y!8i~8g z4@r!^(q+?@zLhAa?$R-;^Q62kh!EJp_5mq_6c&g&xD5YR@iC=#do?ypd7FBtlU?R^tp&Hh3g z5-ljcm?JEyZA&1iH0B=+Qn1`c3dTmo=PCgcBo_d)nniSq~X$MQw;sUOcJdD}j^Rqr{6ZD*-mNrMUi7c9W z0v4=#@j*HUs#%0y-LI|GnHQ>;W3MPv#lD7v0wg!eo3 z*3ZEunfiNPwq`PkcS>o{L|ee5i0Od;yJ@Kv}*X<7XFF*YnxKmI&&| zm|#cALK4L3#B*L-7N^6P#&H)8q1VSQEr@zJ1Z;MmF>7|2@KD3SjV<>^)ebie4Otu5 zjM@#r2Ql-!58>CTh&o;2iK2foBJ<%{7U-k8C_SvL`!|wN<<_}VxQ|wC(sisx`PO=a z*62E6z~K34Oahp1nEaAicB~8C) zScJ!(-rf18vu7;+*7=B-AVXQ{;QPVHCyfB$k5oQts5t~psC>&Lj^QiWXNGa^BsQei zdNvYv7#jO>s{}!mkVBLbnWK0s!26kiXh&U#`(}pt+8Muw6SJKgW+FgjNZJwK`v#nrcgkWwAa+> z%sbW{=Roan$-e{99%)7qVGg^%-ajUuk6XxTiM?1*7OQoQvoTnU8Oj(wotFo&Y>1LB z+0YsrNbC{eCC!e##fbOloDJlX=lz!d6x$_yM0UO)p*u^pwB$tNR&&F4Pw$+3eh%3q zw^Hk3|LsqUsydT)PSRH#+)~7!UaJ&-WhoAkS^01>FIuEeL6I7;Uu$WJvvohG~szC*Q3S;hUQQpN%7zi_Z-T{yJRjeM2yHxu%=sSr6k>-TYjtA|j=ScjME zP&A#26RY}6He#@EJY;J*cdJVV$o@e3!*MUmVt@9D`;;#+fEKrGNLsW@b@Fdkv_yD- z^OpXt=S7hvjKbvx2ew|`Wi`13rq%baR_^ZlOHAOk^$TIQLbeLnVaYteJbSeEERX)ilQbp?v?BR-Xae2L`ZkF%Z5xp6R|Oz26+_J6)$2{@}1mjO!R<=0uK3EAL$Td9$U zM3i!a%yI*zzhRpr^4Ll`Xe$538;ycLR_Ub}pkj+w#ys8SxW5vgV2TE-l# z%HSBx5@;^uPT7-4!r(PNR7I1obm99fce(|KyzO;6y(t1^6 zCMrny8*{18K8WaB?Nj$xt!CTklmClzi9A*-UV(@v{5xb?znQ9WbR^qe_rTCePHVbaG{Ku}jw9lvw}n-S{`xPB5<`!1@@>qnNW*%#OuouZ zu4Im5f(t4mY5q;gX-|~xUBj5 z2YpPB+yzUn#Z!U<9rGR_clJr{uI_rYiWR>+ z)YRy)$NOq%Xprg7oWcqG#wFpF;6dF8turg%lQbZ=5tC$kG&X#J&rz<-VaVmyGh4_E zcb^7BKvkq{wLaP1ohh4CxYwPh*fxp*YO53x>#cB{qZjI|clP_z$$ZupyR(isF!$$CmECug6wr=smyJz17Wq z1}ESa(^bfJt8vrP>4dGqz)kngrOq{o{N%Ez3yI&0_M#ImfKP_S8R=81ieaT8p@^x) z1GX)Xc-SGXG{*^Fw2Jj$wj+rAkYpfkW}uZ@UNVC<>&=pyF7(LNCLUiRbr+zt=xmYO z#;3{fybSR>8b{Wl8oMvboV@g}HgiOpX&R8!cL5(LR6S|+1ob%~!K5L7#IC`B*Y{!0 zUdj<;EM!pYj2>vRQ~b*kn={tf$Y545N+-0=58ku2!VsiB3mw=P>BabXrx)r8vI z2Uc^UyA{Erj!;2_^=eo=(;|w&5Ux6R$!YWNIU#<3mOOAF z{>sNA>!D5(MEa2~43qN5727QF{--NG=|4g;6fr?PzeHWg7*>49ECGKZszf)anwT)0 zk^99xaCy{Au*XQ!K1VVFZZL|T*QZf&Zs|(uc@`dL^xf{^Ujt0I619l}lkv$%al-`4 zazp-hr6N$tv%Xe~vRJT~N&fe4i_Cy@5@UB|Z_{dHx$#GG+cyIy`M;RXgL3B&FyR&M zKgo34bP~Jp$@dOoxzx2RK{{b|<=EA{NcQT8F*S2^8wIXeiyfS~=CwRQ>^PNEJIw@0 zhSsL&=kLjg`%e|mg)l}A5fa`=hji~XI9unJPv|_AF4I6;_?nyIj69^)+16<9lH;~j z=5A#S@5~;4({-Vm#VwiNlu3D8g~E{my{`{Or4M`(>=mpVHG28DgvIiX040(?M07wo zeDh}Hsr>=>>1eJ>Ie#F-=`crqr{c3pWdQeNlamL7qw_3=HY9VH@k{6d1cc=OUNn#xkO56EUvv+Q z@2~n1x&+X9MPV$<3~gH%#$B4=0byZgJJg@V!Qh2i7l;|e4Xo!EbOGLqc2yEx=Ski< znqoyOw!(A6@4sxi9Ol%kB>2yXo>atsJD78>ZqiXR=gfRfdwg!acR#<&O@AKeg@IP~ z3mzH$ptFzP==_V9k%7(`69r%vlH zjHgi)mt=BmVrnL4tiBnp&Cxgf<0wv*oeF<&Z$Voylf`VB6!GS>tB|EsTsK<1mE2G_ z3B|;zTQXH{ApNbsoen5Sf9x8w^NXC7H=TRW!vshxq~)dGN+O}8IvGRrh{c8Whq)G^PZCvSr;!g`9OSBsYi8o*NSj9Rl6E1HawRG z;fIYQB2MTpEqi6_J={}6B)Tt<-G-)1Td{RnCnr=|7K^+~p#oxM`Nhp#tr1soO^8-= zMld<9W(qaBWR~2kuZ3i??x_EMbu^cOECEU zFhi_6B?QW?R2sr@&J0AuHXCOIsy9-v1i+7tYZMvccL3nY=pwE<+MLGeRfb^yv3hU= z`acRA%{~jy?jJd7H%t^5zA+gy_iI=;Vh{%XDHy&G21z&U5C$XM5Zk?+qOg8Pi3x?rin zrRubHgXMA)W%3y<=VR8=xz;23@@z1{?dpGJA-}M2lnLdY5yF|ENmL(6W!)*6ocm5qB#ZBmCPxyUQhBrWVB+k{%8 zpkkwB)%^>iE>iwz_LYr2&f?K}xzlSp9geuJG#F7>Io<+t*UO2zP|-h#nSly@(u{mj zVOs-rTdk{EzQsvy_eWmyi(Mk`a=L|^C2)%Ep?TX1w+!ZJ!I-+*OVC})6cKDRR3fJ{ zQEZpqVRgwJX4@&5mEo>Q#lhbB-~BtJclT#7)id?>v*trRo%Dq7pK2fXhR9S40Yc$7 z)!mBnvF#ZQ(fqj3Mb#AdMC*)g*N#k3&RWoD7iPm;*H;ELf-dj)Z^Ch(`KjQ4-axb2 zGx9MlMMC0^JA2%wa_Yi=Dhh*UX9zoj7NTQ8Xg(cOX%|9I;GiIS9Mg2F9E=R=UBaUiJei|k? zqc>h8g`=0n061nWiKyOE*@C9I1FD+kq=+qHD#mey8=MY+!9|r7wWC2GfN*lAAw6?Xz1{y=BC3nbBYl`-<#F({^vG)K^rgjAG3_XlJW2;52VLj)rohnkkz z&_`EL)Q0ZWHP2*a@|$N z|ILO+);R*RO&WZ+AAHRVvq=fFT>`Tii`q>@I>|3p>W6!23}cUZ4md@wgd)}v=H=0KG+jiUjujTm5zPWQhW0-%^Y?pO6C;l;t1e z-37<0NAz(aq~`q|;_N`h-7w$T_naOUs(b&mra0RO-V$Ox?|^7s3@qfMGWH6^I};*Q zAAnf>K+k`EvL{t21^zQFUcsKEpruayAmNU-CEdA&`*$Gdl97{;eITpC$k{&OpuVD^ zm4rw+1Yvko>yqXfu8Igq>~RB~xq==`q|IygP)rq=$V1nNQ}joST8Kh-ugDGa6U37m zn?bh>IIEt1eG&a{wF06B?#dVJKT94G1O)Vd^l2mpXh6!|#ns5xR>acG#O8lIi=@O& zg#|_I;hY9HT3Uh~QL%3Dw0eZXeG#;LY|`*K@CRdam@R^FBlPx|#;i9YuYnK>)MyHQ z?_DA@-x;gb;nV=LRiEkg?BizvhZ(EykI!4UURXjL$pW$g;n4nkcqG&I!UDPxvmZE> zCz^m6leNIM%g}_l9uvGB!QJzQGww3n2uAE_zktU^F=MkB@(pg)s2Hv8)l#MO39o*% z`spnVFQtPCR=od@<<(o9&<5@N+bb60nBa;mAfpq@&Y@K zr_#}zmTWw+s5}aXX(9*PER`!G` ziW3P10fzfbaW6)lH`q%~*Gsg<0~kF?ch9WLoAl_ug$D&<=9j2w_#H&GXixP?nYhbE zDUF!{f=qOC@~}Y`9|Xxk2#o;n`{;S+;e?kYDs5AV2>fKtuiiN|3MW(vl!$L+9Ad3K%i` zxj(otW`7KLp)fQmJSYtE4>d0`#<5Yl+bO*G(yC@LCo4V0^+30(2skw*sa~oz?SJJ< zJ{p2+uxm>tZ8IOpn!qjSl9KY&wnP+YmUoIhu2Xg6cXy3?AN5iv11Gy zFi?oYAXm*sT0eIn#j33T!;fZ12{zUprRSqG=YvoDXjqzcdS;)SY6@IX;b8xxF_Ka$ zq2|U^5aF0w*dX^tl?dzY)Q>^Abw#0|bx;B6h7E^0$-KRv^@A;2;?;{{=1zrsCix%t z{A7~(76{Mi$h&8EzZpwcufp-2Fb-cIFcMk#ot~p`FeIQ)!g@&ZqD)+Qqe94de=9Z5 zICCVezx$s|IUZY*1gr6GCEz}^L1U#Z;}TJ;LyB+h+o>+TOx>x!t4)-1w$FpJvQt9d zsgz#xe(EM5x4VELAVSFbdTP4-(HO`{t9xCd*8dxV^F=cyMcnF$dgGwPZKKi=7@e`W z!?f!6D^H61lf!XGMI=!aE5$l9L+_g$ix9`1Jw-t&+E686pVTb}ZmscRE65(Hm+_hj z`aqmRJH?6qRh&cO8^LxAv-=7Q$m}}2k0Gx$yztf=W>EPAQ!u&Vj0plvZUyC+P!SGd=ww~N8a?Av%h^|5;*Z~tmhGm=hT=B${NRJ zar?ckD)O2dPsFW~*u#^$Lp5#K@E34Xhq+PI8RVuX80gbiJF!W`Il@AKd(jez3RbIH z%fu~pBKbiPokz30+V0kF{n!x=Yo)39s>N`TAtNmREDs|pTox?mEd3jD@84|{5|}<` z-V`2Ql|mM{x)>2>OW~vDo0=6y%6!Nb|N76_Ny)Cqgj!bd1CNKfu590N=iko}^jIH@ z@><8(wv~dkJHkZpMC4!q5mu49lfbg(1(7=Cy71O~0hes6Go}9s6Jccw+D?A-oriRi zZPc7-X=>ihhDInpLrQs}aw?Oxg#yJ07Z-CW#ax!gmpZiK4Uu(9AU}!nQ70q|W7W%Q zR1$8fpuyU%n|P7rx|ZBAzh$((wSPNAhe<03dY}^rOo8rX%B&nvd1y_4M-b)l4RPv(yA_j$?jfFVDsS zyV$_NAk=7QANI_yVlqBl+zc*D`YzQps7)SI&D``xPuqkEX8{W+>`tJ!XIKrYZ$h&- zTckV4(LrivZAbuzU%0%1N@qs0B?Mj;jKjq&uLeJJDTI7~ZfMi^1vn z>1j;0uMea*XBG&#WYrlMcK-R)kh)cPaf*BlHxeLEhmc|o;OV3b`yBZXq3rF;h8FX! ztH?5`RxjE*jFC7fQ*88L9@uF}zSzR(3^R-{#ECtUIF>0rO z_5MEfH01*<5%kfba8cP(EVGcxUUaB)`Op#=qRgZ?!LSCP388yUc~sL(CucON?V#2} zdrRpcj2%Kq=kYcOQ1AYV;gppP5XyT~8r$%0@C3bt&2!9BAXl(mKd>nCEy8kdJx91E z9{eR@)5U$(V3Gss8qujMh0V!I`hJ`y68FU$*V6zdy7T$9urT#^EU9XuXej(y|MZeI zuORghu?{a(vnS7cIuN9~m3IkX4ImnqN3_>iov{`g!A3HV=(3|ZG^fpW$1pHy-`FSG z6N(jbrWX%97mKEczGr-smN@j%apos4;*6UmcYSw?3mrGe^(c$5r%=SV8HRha6o`?i;K@I@e@)p<-k2*Q zm%eam$JUMF%6m&-(xhkRU1&a&zKZ8bA4;WrN(4(ExcKwtAzbsMxAW|1+!RZsQ|^{l zUQ)}|wOpg6u@=Z_>?jw%w>4g&K17l{?ihfOnxqt>GG79NnmYtve(O<2p?7#A_kwZG z+bKn26_H@ysk>Lm#giw&yZm!E5DLQ11k*1*zoHzDZ$XE^(7M|*i0g$-b?ehx^cn7 zoU#vW+3~6Kq7#@Uoiu)I8&_>y+eKjKUntD$+=nHBa( z7-U<7w5f%=g5|IP6qxj>^l)(`c_+H}5^$X;Y|Qjap_4fVpVbpOseBi0XF^B>=}$EH zp}c0|<)8^XQz=E(pV}-CV0z2$V~2g>q?iG}Wl2%66jq8>*p%o}wYDIYvXTIZ`~BBB zRR#oUJ8G3D$F-ElF`Bx`JJ=O)ES)0#9+)J6f%&C%T;V1GRkRY`PMqQ@m+QeX8NF~je^gRhEz0}ZrM}Jq}2?8%UsWwd&LP^_) z&#GToJ+WYmbze%S{9i5OM1Qcp2Z)L%*J~tIUP-0gzA=bmPtOC?y2@MP(r`Fkq@%v; zUiQ$E1d0_@zY=TytHqZW_I!ZSrp53hUQPzQKswXwf@qt%MrT_3J;CZB#TU$i zguKBQf3ZVe2y}}P6Yzc|FZgSQd!=gn6mM_WfMV0sL!$H`Q>3S;MctLqmuWAgc*k*S z?r<4~E_>;Nz*3K-G(6OQ12$3-yc2gZ?K)hi`|exBo0utJtdsN0>d~7)^&?ltpv3ll zJVeW(f}qKH8lyl%#xIfH{iCyfHjos+g+=raOop8Ew&WVv z9X32eVes7O)eqXS*^e(v`pYmkpPQy^W7Hd(*+Ps1a}`+TJjB}Q;n!Hr4V7AV$lt=> z29XrAa=X`2HfGz*MDG(mbx`5qD&z&cJwPbk?lw7-Jg3zq;!9KMqgXND2AtV7PJ^Ap zl@T>Wf6|{*0er9TVkA=-o9jK3nK%y6)mgV zBTu?aCb#hWtt4UIaneFUEX2)8o1`Ts`x&`DrZA%ypj~XMe@=kK6g*qU0ZxmmSt*+H z{O4Hmd5zgq(X!&t&YUFS+oCcaoO~+;kP9b??tno|kzAWL%xE#C<4`*@33M*qF3ned zh8Xl+R;O8)nZibEVl)T@c|zI))|lwdsLp@y-tL9>1YsAPl@>H!1{4JXQjluPMJxR# zu!(*efK9xYM)4Ift8P@#)Hvslgjf2z4Mn)v5oh30fPPV9<50zppUXldIRb&__MqvZR}t7v?L`d#8JHi zVOJde)23%Gl=vsZq%^DBr5mj$SEu*c0CQb@35Gc% z!_nUm*)9in{bwx;V(I|1UZ5YgC1cTb{wLwqG!zu)n^Z_vqTY(wS9>O?$Z46p^7C9T z(4YUi5FPWH)WK*>0Jrhq+Ad3D!DysAi8`be7XcIw#T?i8$bxA*K5GbvLVI8}S$(!B zMRT@jIo-L`fwPe-lwJr*oVnnulu%D;X%J+MC~IN+4JdAKSf1IHe@Bq>INv-1?Y*(D zVeh)wz&Y%XE&r0%(!vC1UdzFPL=OidfV)I^MA(rbw33`Hy;$h(G&ytPa&z99A;01j zSMnh5_2Ks$XzPm=$0xG7vymO~Wg(GJ!`$pWPdlM1nic$}KPBVlpC$XsP8gdTeuwjc zW8=x#G&pDRtCHSv23$3bMX7=cJ(o?9uvw9A7KLiwb4Xkj)En2?)V3?#=f}-!01Jw* zT9=C3-Q#(Eh=8pcUOT4dywEUhFa3Pt5uy{yq4-p!jCW`1aq8{JFI_R2VDu_C{0h(N z*DoBFuArC-1S%G`GWU#F4-Y{iMII`H$-Vl?`l!%+yWkZ$w$yacXk=Yais%x0wvc`% z)!>*C%+!J01S)x((L%XIkR^2*B_5t9AbKO*+OMML z{C^6$@^~oMFFw7NF_z5DmN9mPk?o>I*G_i1vQBnpxUkIj(RpfD6o3#o#db+-{)M|UR zXV*!s$nJfNQ0HJ~P@_XdVLtO}>>-`gnJKq)Ll~;OH_pDh{owq>*{+r4M}dVR_~plt z#JlVr@eAYe6$sy;9~Ck$t(}P{%bB|IB0Nr+WsCVyaI1Z7HXP{71`WU;Bvk9*rZrXm z(+W(zs2>)|Dpvngk>n`cacNQdc1P*MS%e(2nOKLpeX1qZtpbSV9(NTO4oHo+7G!?7 zKNUrO^dK`m(3nA+p}FN-plKDLZz6^iBTD%B?S6INnU0BiwGn}}nugg(!@A&M+5`v^TxJ;cpKMz?kF^7Gj`dd4Ti_B_;gvv`tZ2f}n&Ag9)_BhM#Z8rQD zTt*{fcPe%`#C__8#usiz!aCmn$|QSWXyv=*n?ly{Ynr&}AcaI4&Y z1B|Njo)Fav18Nh)&pGtAl9?3cGmYz`yMNO_k9WCDR=EUg#X-L*bZK{^yF--Cs;bJYo}9Y z2FLC9Ne_wnR{7R-(hUmaHKZLWbOWO+MoJcwaBlAKk4hh@6ux=mW5Z7+wfaR2LsGQe z1>qIGq*Y;?yOUn#twQT&lpwX_>f4F8UY7_CTIe5Rrm2#c7w6DK#y;O>n{dU~S4fTX zyDmgY_MNvsQ2*rM{8=p&lh?S`Y**4$UHpKAjp_?l1E@~@^^82irZRJ1GTrmpR*mnxAu zy3QG?zFgCD?xo4D(QDO}k>2L4x*?*nP0?H#vf-nL^vO)duIt;WpT%b=Q0X9t%8zu&HIghPx=c?9wJFL zah82D37cCfPPDRTyy!UXWql#Rx@5jII&$eDVrsC(u2k<$j#Kj8^tzX!N~{z7g4r^6 zw67qE8J|A|T2D4GBi*Pi1?x|IN%KiHZ3<#C>B#m`YV}1cx65>G%Ab+(qzC5HvifJH z7U*3fu6wA?yosStSy8-%@;@3+SYOPxHTF_4vmdh>66Xa@ztWHP%jy%ER@|Y=Q91J# zzeNyB|K!|%a$iK{kWb~(wCK5)>F(}S8&}Uebh2l#qCyB>rMy&RSt;}ahxAgW-z4Z* zqo=tv=%$E9YiQ|PA9Ft^d1z4DvR+$J`rshps^C?R{$+$<>tdRy%MKC6NaCT8h1c)u z^c!dlUcrecc1_*^BbPO~3GdN4Z*mrG`4-eB$4MA4w`;iM^w#P#z~_3 z2#I{saJv&pa4z5o$7=|29iy%c^8q9u{~&^DB*`Z+g^}u`kXp!B|$Yo@VO0*{k~QMzxLiDdh9K|O+_C5?<+T8yjc{x?M?ZX&Bjvt z7;ai2foZ!2Wa7kTC9U|`7g^Abf&Ot}i}arhfPS0ZV6`0wvD`LAdXSS38>%}?g7W7$ zh(KhsbI(m7@4!un1P&ci*sbV=e_npu6dsa5Ou(Lvn9|q?=dVPMl_3AW;0E~}I*>mZ z40jxc02%B&p#^N2I7li2hT`D%Qw5ksgC-^h>Wl(mXR%<7X#^2|1xB4tP-8S(;!ffR zj7}WHcM)dgfnb*=^l<~~0ZJDRqQ%2d2^dBTfH9c8p2${G?>2*GlGre<`zVx=!iEAp zM<7<(7wI(#pxlE70mfwA344PS{K gi|X0BE&rYTd7Zfqxa|GnRTZ+!>V{XEk%Q#I#Q z%}n?7)EIb54R|dLC~Wzv`3g7$2*@88Ab=LK>LhMH#NkA zFcA!j4B|kck7!y_uWgj>`TqI7$>PZ$39VAajN3^8wZUSfrp=;Rn-Ly|%dg z8TA>(Z}pTuDu@zTLA#XB@^-%dbm8}SaAomZ0KySgfHHh9Fc4IB%u{Aa45F*GaEG~? zGObSyP$x?RO;lhA*kf5fYHAiudD7Pz4FO?MN4Y;FKX4rztqWxj>mg&@ zMwYUU@2S!2<7p7O6<}63Ny8Z&2tS3)WuY0$(~B%kiiuq))gd@n9c^^8YHgLybN5;= zm1sFMb#|10iM7{7pR}P?&=)_kBG07fdLK9nn190W(mj%Y4Ycb(Pt`Yf?H_Az-*>k7 zMWp*(C)6aOXafHuJDc6DB5kTY)(CyrFT$vV0h^rg>2@}YSZrloJYDEUM88fZY5daM zBvk(EzWh@0(QDoL1>9q9fhIY+3X>CNzdK}b^S)2FcvliDmC{CGptgjlnF1wm@CDuj zpm6~vVh|MAuOXZ5G5?8e^~jF;RErmnY2)T&Zy9*+@m=GkgT;GQ1z0ECOV2-YS8ubT zE+(E(-e9a560P5KTd{F-{Xn5zYC|TX%@o|A=A6=0A)gJ$r8HA5O=VQE2OV3^8Mci5 zXxEP#wC0)L*MpDkp_WEDTC2K3S@A3gpq1DeDJ^wWQgcFjqB8rFo@9`pq&1w_e%=+O ztIFFWGNyAa8?IBTd_%-$d7 z15#f(PwE|JAj!h{T5C*CTZN*B!$B_gXja1_t?k^58A=bfJj)k8^7Ze0b?U*twVa8x z3uQ_mjJne`u}iNsVICESuZh;*c+19cVEU9-r?2Lx6HR8PI73{Z&^U9v)$ZLY--*HV zHfnpeq;)L2h3T-eB=$}~6Wf^p$RH&|Y$j^Bbtz!o4=Z9F(K?4S`d*b2d_y{bc0*zY zdl0+aa%;=SgEs?9Mokcg_}Yru9P2Bzc6CzSmNTO8XW4$K?XR{43}5=JFXd5*I%28| zovlpp5;~C5xS|Bs*1Asg#iqn&SF6Xc{kP9x(1!`beog@5DDHNqtf zLi`$#K|5rvD!FD3z~EQdN1x+XDd`jNNuJUtkrG&Ofh8Zuil3ze6fD0Xjh-Z)KEW{_ znN2dvC!A!eSbSKFQ43F>Qk+a8NIX>;0T6D|6G~9?Sd`;jPbBaNP7~x|60J|72ugQ% zOhor~4G5&pOOC&Id-HS~1$M0Q!%pojePeggV}|&cpMa(zOKk zRZ<`VtJsr~#nG0_6rYFv(el-m0O-cB2^4CY+m7+lkS^>UqP;Ou$RJwE#A8a3*@k=k zPY091A^gxA3nRQg$M7%$zX5~swBs3ut(q_=Bn!CRs7eDBBh+!tt+11AgtC9c zSMoPP6MZ(Dn(f0i!_=yaj2#Vz>J$&dTeJfi2P0Jm{zihLtNQdnV!tmu-|ka%J8#IggloNTb-*^)fEO zRSxoEB;Z57I%Gr7BkEKl(i7xZOuYxfhaU_Z*5`~|FlFOdQkqf z4c{F_-Vsn{DKRk>9tSuFRj?Itrc1uQTri8+OGaGOr(fTPvok5w428U))K2^mV)!W! zTEz+;U4_^4Dvb+={TlZaNazG(&d&$Jt6RhtLF?>yOB0!)dkKYd)piRGzbWY5C~f{Z)Oi72*@vd5D+4uqY(x$b`cSf zr3K@wJFN8un7iyQS)AW}XzQ+*Ki6Ec;)%r{k3f~_HXTo_OgijW|Mo{Pz*!~tkWz6<@e;#Q`$?c7%)O{e^2~tM z;V9GLsN;*J;bo&m{}ujc*6q@drTt|<;7PAV#Y#tB#b!ySWKQOD z)Q_#W->Q=a*w6K^pKi$0yAFZRI=*6T01YuKfWsbP;IqU#FaW@QQhrLsZLvKV{)5o#Jlg)7%4c7dBmUO$?oBiA;WG+AuR zbm*?qoH3WnzG5y}KqLoNL6hLPG1ZzS%|#_tIxVN4%@zMho)wIV+tgJ^Q;K`ewKeZk ze!MZ0_i3r&fVA2^y^eX&+?thU8RczH%T%YJIG-+C$jh^fuzJ&IBHaMUZLazKB>9zR zd9Qn{WKSGlEq!PszRfBxd+=9Cd54EX9$d?$<>$p3%x8Ts)3J4yvL)oX^5hoS*(;JJOV| z+(`*N?}iz+!9BkklZqf)M;zXZO)*?CF_C5~mZ73)FrAR{suKmstJ|GwllSC}7fdx~ z9PGVzPE-dUx5DtqAI{nP_EvA|s%Oe`T?W8Vq?W~BiE{_zK^d-au!IdQ7fj)`UI*$xOmTR zxvmw=SLUp;CXqd7|i=$VlES{=GB9!z%TR4(NE1f}< z1$I4G#V%onGiB#eZK9raEqLXv>{hvMbz;q@?r>J~bYKArT_neCl45$Zm*;LstM6;I`w2Pr9Y1Gwrj~4f9wz4&-Ir z_elbm$abvm_FTf8P2-3>wCXk1=vFB_be!YPTdwIl`}-93Eoj>`E=dFr&k98_>sZuv z+z^5_mVYae$wj{homMbDvrCwC43eW@%}RT%s({sORu+tKVkY_=txq}RSPYRDwI>k zRX>olnMq6Fy`sqao!1gsoYg^OE>l5e2o#NKBT=UlUD6s3gcet%r@t@as!d|yUY=== z7^(wyG-hSAnCVdiX-W|9pIjgCBH)YDEE5XA!Tr9+;3O!ogp)FG+YiVqt|zgK6%aGW z!GCAK9wl)Jjv|(51Sc`!4c}Oi)V^sHf89f55}}hB)Kp4v6*6p0)+!w!+g$1Air4O{ zh2);AYptFUROdU)l7bV6i_=6=QO{0=OBn!!yeQTzH7nb8Hi`5nk--?1K_2&p3I5KV zqDxN+b8b`Zbayclv%~O(Ow`OIh?}Vp^A&&HJ zd$?8YbR$i{vf;DzY35+LKu$XK^TVObJc86$Z$c!fhi`pj}5*VmbYG*H#SZ z)FWps8!1ZTXcOHrDU&2V6;nPvJtcL+ii&3!c@M|K<<7f%KuMt0VXkURRB9RoFHKrW z?dL;p9Z#7krCtzR@@9gvQMXSDs%SrVw9YmrRjJZKL#WpfZf2{kT2HiIPmE->mAaV! zvZMKbOiQJ*s|N+=k&Ylkw1NmwKYH}tJiHDK*Sm}^c{z+*G?tY_tHZ=}@sJ9H zmu(-FS(RCC-;0c!BISK^Rw~s<;cJ(^a|rbik*+YOLXNY_;wYG|C7WE*2=Ma3=)@1C z8s<5PUO(kT1?bH>Y4(*ol`0wAr4Ce{{kaR1 zUz%NsW)-z4u5AtK6j#)geulE(TWcC5qO`5stf_5H#K|xqX_b374=U^3g~{FwHYnst z2>}nyMv`iX!Yan}Zj+{e@4Em(W>x#YiP^d3l&Uxzap$(FRjXtcU+q6c$EQxa=)UGLMm?Y13C?UDCn(z#@o`zn__Y+k?pqD;oj zHBJOTZ)liLriv6fk25g(bTPR*=e|fr^kWSJy#A80N z$5{@+HfI{{sdpxK4bhTxBRR|qoT*s}<@-phhFnq^C2J29aD4|{9YntpIhyR#QsZP+ z=hfF8;`qiGZL>Y&X4Vk(z?kS?isK;I7B|vuT)8h8)2QbL#IA%QEC`?0({z{!rN%($ zv0JmyxK7WvmuAn6Nl+6iaaDOYrSwF`d*Q2bDDs5u)K28Ta?=*c6fG60*Er-MY1iSc zH`&s3&{Mo!WM}|VfY0EbP-3QC+GUtaY!-?@p^LJi;v=nv$@R3&C&bH+s1Kfp?u7Hi zKsmS8K*ELkKi48_Q34a)aY>YKS7UG$8^J$6S8GC%3fuwnZVMK*m3)k0GuL=2NGjKn zT9xN8P|TW(mo~PrZ{~Fw^ak_x!G3v;DE2+Kh?q7gx_P? z)ey1K?^l>r&ykMym99&bp?a*RQX^XQM7a_vDs7yqzK)70u>=}WJXMsokH*-*S8~+$ z_pksUv)Qiw!Kbl3w*-F&pdu3{B0N%ki%8` z&&qxhVy|oz@|iu+QRAt6v?f%{?ce89*T}i7Fm0su${V>reYxLU$$wrPZD(t3xHT!Z zfOhQ&e@C?Ko1QDWBj%T!LfY-;`u;mDX!!#WBiFF9K7Whj%MiMjNl6prr_etq<;wwV z<#L_IdqkSv+nVvi#oDHh_n4KvThGLO5VzDkS{*HVMV7q#szH&;2^PWe$fRped@_{X8jWBt9Anpy>xM~_%W0cr3 zSJ^c%4y3K{$5;B^+*bZ_p)4 zEvZvY88dkbvyUVpTqG>h!WJTCteW{IIUL~nL7Ye`gEof z)PBm{si3}z?Z4y9?$L}c)AMClm1g|Irp)w>N^ji!@^!u?Dqt`d;oQox+W5V3y`UU9 zd;2E{s~T?+w&&ouhY`%IWvi@(5}2-E!ma+e5CYdP3HLYDj(@#gsZ>+iC?~0=t z0(vB8E};%9T)}2t_}kBE%k{qC*VG3DqCRTx5I%vY)ffXK2Ei$frUQe);BIj>L)|X} zIn+O2V)De#b`6e%qp%1)M7FyeFd!hr=pZ1}|2Dq5)HncLG!2}uINAy3=$}z`F~m&N za2UMfWrniI$c!|UVu(`t`^Z|7BGDc=)6$V4|`tvzfx~}A)>zR6L$*Ib}RNqIp##e!KQE@VA6QP z=u;aSkcXy5?V`id@A+fb-0!LBcWMU&FOPUu1+sZ&1zLCN58nf6t z6dP$)8QrEtTbb(~4`9yV{bC zRo*;Q6BAFKnXi1`QqKkv&CGtYmt6*cj$gVafl;I#*dYTKY0-c@g4H3|h_hc8o`+Cz zGDL(fVN}i;#Dwl)6zykHouqN&8{?xeJ+l6D0^n_?ng^6i$|p6ANx`MOy3Ql*ngw; z|4CTR8R0^mA6|ylyKnX`IT&|?3PYni@dvGo9mVL78*X3KE6VXi!G(`=5+KE_zK224XCTWtoNKU?in4Idn=dsrHObN?+w&|Jco;D!SmpmBrrt}^sn^&J;!{5dXC z;@aS7p7u~kVe&v!f!I8xz}r0Gc|kuh7$X~~s-KJ@DTeacY+09PvK$naCa1pv20_#JZQsld|>nxq2fKFOcn=Fr5#8vO^n8^ zKTs=DmNE*IGOI5vpA#0M#oRSlxf8ICfeD9guEBn%m07eE2q(adz}o+)n`c^5e{y9o zz%9+3230mL6!K^%aA^>9RcI;FifraV&}T0n%$!URRgKefDNE@^w^$#&mh3aFuA;Hj z3K$NCtq2=7XTwtO$ z2f}%T`>Zh#dN4=Aa*>uM{FLV)kDdfS%MKSF9s~F7^(7ptd%YyYjTkqsRHJUqfbLI~ zJ@y|?uklWLlc%B0AX+U|xu+ubR{PX_R=w3W_V^1aE>UMqB-;Rp2m1Jz5_u>VO5$oI zHQC9wD~^x|vyw*hdc3T(RP!U*_S5^RuGulu)42gZNw$Z&aPn9Hi~OfvfS1@ZLW8@% z&S`Qawsq9WZ0srPn(?yPZ%ejc>#rGBhx_nl*v(UH2X~6L59fHXJ_GB0ZAaHy%0Iaq zq&pAenun$&3Jn2AYpHE$+><;jN$V3qwuUK291pzmPGY**7nR*g^H`Y6g6llQzFm1r zo887|7AV@mh}wyhS9l6?ZW5zCb8*)28}^u2NNwj%Q5z_!UG8+N5vDO11aJ@+an^U5 zY5c^xpk)^X9IwBs*j&OZa|kIIj#YU-yxlr5nvQu*1498$+`Vt*6poFT(DtFv0+2o6 z0^CkN<34yeb$&8W1!=h?-vw#i!A^D5A0=PkWhovMp6oLQs)kZlN?M%ab2ZW6#9D~Cn$eUV`q?ZTFVA8D<7Nf|Kl*d9FF(wDx z(O9!=?eCn&6v)P$u9tX6lqyRXovR2;vBz~Wm@i8Cdb##Szl=HM*PTg4pC>c@xyOi% z>2?4Pbog8$J%(L1^dYZOwz)|2g$P=O*kMU3Ot}bZD+(=*>*927xrT}`D+V5`;#7Nn z$r!C9S?Xrd+v3ODMV$xS@yWVo%?5(uEZE^ktlP{wyQJ(l4h=QEEo2eHg|%#i)iiMS zT9C00zgaiX+vQI-PgN3EQU)GL-AQj&cnAPJeLHCG2=&mSk-rA{0XpegJVrq;g?sHPY3D%JyeQrY zl|&8@UwgHj6~^Z%oHB*U(YYeH$J@ea4LPdj>Z68LLnwb zwPLGM{xiQc9Cobc6W^a7?9biQxjlQPo$ZIw_MH#!)tg`Uw#Q==;P*B0PdQH;Y+Mm` z2{RyYvd~s`6)(yNz*3B+$yA!AZa9qGpY)5<`R^3=eYL~6=m)L>yVxpT98nM|)2{(4 z^rx}pxW7-?bF1o$DE!kd(D_hh@|l&N1mZGvewuxsk$*Yb$ycA>Yn7}bQ^gzzWF){-HLKkTzzZP(i~}; zLd~JNxQw>^3K_0|smA>yWiE|rZSgnK*E-TiQy0hR-(P75-#4+v3y9!!<%o z(QZx^g;E&;j!Tgr$S3>O5Wp&My-r);vhB5$?MtjOx9kJnP-S4~JA=g=#&Cw08@3?02MP$;xI z62cJYQ3@6^PAZY?Co-orLmk^6-bLIT$Ji}NCPzkJs??KKOLZ<-;O+8m1Jl9HkIhHt*DVG_Kmb~|6kawliO zA=PJ+Ylrgjv9RSH`=LX`QG3ev?tjzc6B6o01=CQg?u{D^h%gZs7uICAJ+j@TX?Jb$ zs1rm0fZTGcxa##kDtC2io>qfquhgozvWPosXmjChDo5{bSy<4P2%^AaZ50C5t_wr2 z_Iz;M_c0K3YSsGLS33#U+3pR)LbFzijF7q&begJJ-$6dWG?sy9OZir22pauJHzWuO zyR7}|7qV8K+EY(E!#MtdIo6)y>;ga=f#C)K?3AS^;xwFS`(68))pN)Of0UMY)whfx zp2ESzKo^`NNBw@d*4&*`9RCnZw$9*Gws)N0v)8cx6}ujDeHE>l8z(HZ{lGs5*fk4I z3bQj;H&76Og=?J8!dO3EReHdE@%~qV0Ut*^O(jyu3i7cH#?YuIA@*#IZeru%)F)w@6 zcI&b?)uKVv&6Z^oeAMOHsI)M;IhLvbv9ocb2Cb8d`2Mi*3=}pv(5b_LHjn%rO|fat zQXgO^79Wraw(<>E^JP9&Zx$ENHnIA-E8a zXm-M)vBd38wxUSAt8o*;8hfxRV;o?xj`pzSik=!155Ug~>y#4S@_LDXqu~HF?-Rdp z01B*|xjU;br7=Ur_moHVnIGf(6=JxJrN&eZ9X_{f&yp|&!u>G{Mmf3E7xt?aV`T$5~D9o4;q4L3r6&Ru@CK;3~z28gTgTUUA1wS{@~Ny z=s!KYboGLB#~>8`n{P$tLWc`S0u}9%gM4{fnA9OdOr_oiBhQqVH_DNjAYF_UJ8p_N zgBR+MOPW0|)h_9^2lBqo?ih#8kdPnbndCI0Ce633RYE|{frR)YyoDYh$oGpksu(3j zPw@PjixrBcDmbN?W+kci9Z#UV6^Ghr5PqqWAjSOOpi=gBo9R$BD13C#q*hWDHs_E zYN;B(q9>!@jqj5_=PDZ@$?HsTg`U<+&*h!dGp^{9?fSF0cA1rXu=rep(E-OYDA#EW@0wj6EbK6os(F8 z4+Jr>NGo9&UlbQWoCq+6?uVWqhQ-U*{YJ7dM@e`dGuMx$VgK_LaSnDNg>O&KQ@A(l z%D5=7A9m;~WXlAWdz-wrgAylYO8beK>=IEKj7mVP=bhSUKRqvYmTYVTlOn5MSeyA4bzr0=tM zpCfYXUahPoh1dY9NlGhmi-OSv^Jw2#Hx;5|YThaF_dh1~&Mw)}F{wlQM=-of8B+Gy z6Dk|7;0nn@71vVsIOFrCpQEq}9!}kv1UuNU)2{R1=pE+?=##REts>Fso#s`i++3(q z+sYEh4_#7N8;a6dq7iR(Lyp@#yZhiwhlDvM4^#>P2~hx=gEq|-Jz|rRcB;74_GeZv z`tc)a{mUcjYWMvr@m+L#?eH!}_jXpAqB3+?3+NCQJzWaE2Urfu&auG?J>L}9N~d{d z`y}(KO#OW~*cuJbpw8@zVr_fpd1-!$-5C3F%s(_QHuPJhgvZh>61$W3)(3R3Hum=B zIjsI1RX_m2rkvcbvpo#2W@(n;Njp5p8!!4TYFnrVt^uR(^m}{mUfB%1V(77LWol?^ zV?&IuY5Q}wDy{u;Lert}DNvf*6ldO#ONY}Kta2DT%x;jb9n_A9h zZ@FENY4koNB{;EW-(^*pqsQqlGG^6bFhnMW@_6ay0~b$SYApk|PT_`30_OFmHKctZVuSfDu$GGqU?iyp@m$0z~mO#G#t zttl-rlfS4=E|UcyWWqbZ%1xQCQG!7IPUpIeaA}_5Axoz~SP#oXQ}5#TBg44dzl6`nJ_i_6R_88}M2U_mZ6Jn%4&6XiK=&bEg*ANU2s?w0 z=&@VZ=LTU7LJ!wzA5pWl7K`7ShX(BL;6j;wWdn8^rAO+K?<-!STQOLb;_;&f3ivk% zUKzU@^q#QWxAB}H=vsxi9n4GbWh$-@e=K5IBG`!YmLo0R?4XO7h8CH$E6u|III;7K z7rj~0!UwID6sLT!5M-FklGjiu(a zOu&@mSphW)td-GoY9xAsWnTpv;1ls4H{1?7I3ejrYgO(w-UwC%n`J%cdJU8tO!h4N zSf3~v1_uyAb0~Fu8FDqBdxyu|M7##76x};&^gEIRlHhw8wjTK=9wMKuXooTeQ&UXQ zVYn0nuAO&n>0n$-u&aj>djqMtraU4|oXVF_5%r0MwOGMNq~U>z91;BazD z9tLZWckO}RjY71AX>}zHCoXFSfgPl3{z!Ww&!hK>Zc(p!g!;3qE%<8eW2fk8o{}8n3a{WtQM-A5BO4>JkHZO%(?r>FM(3s>VIOi zXNaxDgC_e7 z#5`8`{zRe%Y*gI#8$U}tBiFkD8Y`p4o9JQEsRg7RO5d>rs&7$mA4zS+Yv2+$Cj%V& zZocs=5b+RJO<;p`m|k35H-!*WirK;)PiwqjULz}dX&+iVYb68zI(|~y-usyNM8unh zRQ+QCWWk6sckdv1%7^J=4A)H~SNXyLUs0o0;N!G_WP?O2mF~_tf&#%azyL$bh5h3aR#gTytjccnx`=K1#=aW9VJfw*2NytE^ksBzTa2aFl9 zS@-P@13hctMY}`2gUcsGpUi?^R%}%BE3yxOJrMupW-$`{C2Zt}4zx*#rl#9pUcWfd z48KdP2fSjbDRMqX8o%dCS%rPpL14$dY?){UTHQtHj`|k8#rzVo%`8bz^865YGSUB2 zZZfPv{~OZ!qBUe(7n8eb;H8{-UuskoE|Fy?!X#BmAL8g6G&sFpr7aR@n2?}KU@Z~~ zU~0;7i-C9OFbaR=4z8P>o}m)L#Ay!6|L%Gq}qA}J@Gtop}$^cEd(#;;N`Bmd1 zxH~-7;FY1gjL8vydvfuESQd;G`dC;U0DJ54I$Y581V0^?X;F4;nBAUr0lc`5j>f@1P{0QxE* zIp5V16#RwIXjK%T{cTbP4iwzs`>+Ln+ql2UYZ!`#@Z1^7?^2d4zm#9d=Ajz|Qpn{B z`lUtbC`?VhYijC1c)pILgkJqLcDO)LOc(kTI2@}Q$61o66p`UR!Y4`^WMiE=p$1BQKK@s=kk z5Z8`SOYC`v4KEMx@f$UE&Wsgn_qn=C!|J2FM>msLY+3o%MgH*P=&N?dCFLjj9ney5 zN{~FJ@%Un1d~?pv3Qg9>k)a3*J7o>IyeNT7jL(O#PQ%iXv_g$TN z^LqvL4$k~IAcvSP8r)>92M|n_hUSM^e$yA%SmArLA1iYlF_8^H{pjbL(#Kg>J#g~I zBO5H@OInxPCn)HIg1pg!#*Pwf`_`EOmvDo~geZ%cg8nPA^nX~i1hAI(9r8NKLU*$H9e_}+A|3xJzB9vUg)+J6F; zbf=QDqCd?HK(2$mohaScR`eyQmogmGQxjbEG6b`KK7j;fZ#d z(QOnKH_T0h z!{|c0#;8kB0WP!xpSnIo9HCdLO{gaN!Rn5iqX8GHk7$2H7QiMFchSK~KWmBbI{KK( z324Y;t*}o-v9D0UP5z83zc340`FnIIQtfEay&{;&Z!jhy3z6@#yOxxEf-G3(_}elp zna;51af(L3szN7$UZP0CK}(pv(W;2ux!(R}aMctsn2FVS#^r!!RAYD0V*{u?`dn&H z%ij*Hg-P><#(;>)7C%K}4E5?l`#%BBj|CcR=oEZVGbGj{#g!zidU-)Akl`ybNED*J zFx+V5*3vn}<@t#O)HSuKk=qmP2}fYc4IBp(O0rUsxS8iCY3nNolyA=<_UjCsIo41!v#zJnj$xt+$(+BhhlwoWT z<9dJYBebIn^yOEY)qp#QGdSLz)+?E72gK+Z7Yl3StSLAAb6f2?j(4{H&pMhDS?}5V zavH`bvsbp)>M$*XVhveNLV3^~Mn)(rxM%6N1 zxQ41xInO(vgcZWiFEMqV;yay2=?#3y5(2}w)#cL|QAmgWRL{xaUvzI$>oSv@2Ng6^ zHy*%jHwv!v4!aH&f?p=}Z={-l$RSYUeNaZFATAyW}Ak9=r=R} zKyAdMYy{qlwxYa1i*(vY_Auz57P)gSzQ}5FeOnFbhu&@SRf4!_BLPS@1|7P z-BHF}{^^iszlfJleK~UCYljlH7tV+Y?4ZOxnn%c$f$+dCZy8sHwFOy$P60THuodLO zA|)|pZH3-$<*5*zGJ7K>Z9!Eb#kUK5D?*A-<`)%zg}&z(r~Uf2z#qEDFZ6JSq_S$0 zn|kWX{t@yC8)GMIbWQMqfI%42`N;o)&m&?%Wo7^#sSeoz=?ZbLu|J-19IE0k`UPP% zfQCbrGfx@9uU`59olJvvUI17vEZo%9J#WY$BAw@S*#W_3=@X-7)lxXjgOt^hJ58|t0lkDmT3Jn)3<{lwUDMR zAwxegt)oN5f4f92G%>J{5T2~a!-t8YFU1anUeAtBs;r+(&OZPnt8jD@npWT4GcLhC zooAhb?O@Jep}Au>u%F7Dn}DfwWba_13Syb(k7TBd3LEuRS1OZ^9T7%u{@m;Vo=OaS z{qsKp^;d9!E=H)p^cDDqpK4P0i2ETk1_XcekMRD!Bp|?yH8SA4GaeWONIXu1zl(%E z4ANJ>#$Puj2nuj&mh&$U{Jnrn*%m4B{wv$*Z}b0q6$W&`{4ghu@NJPA ztQ`9v#k(X8R`=tdnzclY_g_cI{WvM|7ngnHub#_8(MSCdB)%u;_o) z*`oVrl>67{zr3{nWfZ{nA0sHB@(Lr^xzs|0{@rTC0p;pK5;# znSoua)L@7@zyNawAlxc4ka7(N3`YMi!~+_x5#aszm-zpE6$Y4E{QWLM$VmT>Lk77J z>bC$2uk(Q2S^xp-dSHImz#129;M2N17`+29z!wh)<%9XJm&gqqumQ)v6b+DO0U5aa z7m_*ycl{{;m0|}Y!~buyg#p%{K&4GpFg35gf&@6WDGK)P`%m2nM*+4hAp_O6aKNqr zK&LHBP-&pzCMoc9O9AXH^qTelstraMessaging jar TelstraMessaging - 1.0.0 + 1.0.8 https://github.com/openapitools/openapi-generator OpenAPI Java @@ -53,6 +53,26 @@ + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M4 + + + + integration-test + verify + + + + + src/it + + + + + + org.apache.maven.plugins maven-surefire-plugin @@ -130,6 +150,18 @@ + + add-integration-test-source + generate-test-sources + + add-test-source + + + + src/it/java + + + @@ -145,6 +177,9 @@ + 8 + -Xdoclint:none + none http.response.details @@ -192,6 +227,33 @@ + + failsafe + + + + maven-failsafe-plugin + 2.22.0 + + + + integration-test + verify + + + + none + + + **/*IT + + + + + + + + @@ -226,6 +288,16 @@ gson-fire ${gson-fire-version} + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 1.0.1 + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + org.threeten threetenbp @@ -252,10 +324,11 @@ 1.5.22 3.14.2 2.8.5 + 3.9 1.4.0 1.0.0 1.0 - 4.12 + 4.13 UTF-8 diff --git a/src/it/java/com/telstra/messaging/BackwardCompatibilityIT.java b/src/it/java/com/telstra/messaging/BackwardCompatibilityIT.java new file mode 100644 index 0000000..7c2b7b4 --- /dev/null +++ b/src/it/java/com/telstra/messaging/BackwardCompatibilityIT.java @@ -0,0 +1,30 @@ +package com.telstra.messaging; + +import com.telstra.ApiClient; +import com.telstra.ApiException; +import com.telstra.Configuration; +import com.telstra.models.*; +import com.telstra.messaging.AuthenticationApi; + +public class BackwardCompatibilityIT { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://tapi.telstra.com/v2"); + + AuthenticationApi apiInstance = new AuthenticationApi(defaultClient); + String clientId = System.getenv("CLIENT_ID"); // String | + String clientSecret = System.getenv("CLIENT_SECRET"); // String | + String grantType = "\"client_credentials\""; // String | + String scope = "NSMS"; // String | NSMS + try { + OAuthResponse result = apiInstance.authToken(clientId, clientSecret, grantType, scope); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthenticationApi#authToken"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/telstra/ApiCallback.java b/src/main/java/com/telstra/ApiCallback.java index 5c264d8..490cc07 100755 --- a/src/main/java/com/telstra/ApiCallback.java +++ b/src/main/java/com/telstra/ApiCallback.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ApiClient.java b/src/main/java/com/telstra/ApiClient.java index eab8af7..0597f58 100755 --- a/src/main/java/com/telstra/ApiClient.java +++ b/src/main/java/com/telstra/ApiClient.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -23,6 +23,8 @@ import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.common.message.types.GrantType; import javax.net.ssl.*; import java.io.File; @@ -48,14 +50,18 @@ import com.telstra.auth.Authentication; import com.telstra.auth.HttpBasicAuth; +import com.telstra.auth.HttpBearerAuth; import com.telstra.auth.ApiKeyAuth; import com.telstra.auth.OAuth; +import com.telstra.auth.RetryingOAuth; +import com.telstra.auth.OAuthFlow; public class ApiClient { private String basePath = "https://tapi.telstra.com/v2"; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); private String tempFolderPath = null; private Map authentications; @@ -78,7 +84,49 @@ public class ApiClient { * Basic constructor for ApiClient */ public ApiClient() { - httpClient = new OkHttpClient(); + init(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("auth", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /* + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + */ + public ApiClient(String clientId) { + this(clientId, null, null); + } + + /* + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + */ + public ApiClient(String clientId, Map parameters) { + this(clientId, null, parameters); + } + + /* + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + */ + public ApiClient(String clientId, String clientSecret, Map parameters) { + init(); + + RetryingOAuth retryingOAuth = new RetryingOAuth("https://tapi.telstra.com/v2/oauth/token", clientId, OAuthFlow.application, clientSecret, parameters); + authentications.put( + "auth", + retryingOAuth + ); + httpClient.interceptors().add(retryingOAuth); + + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void init() { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + httpClient = builder.build(); verifyingSsl = true; @@ -86,13 +134,9 @@ public ApiClient() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.0.5/java"); + setUserAgent("OpenAPI-Generator/1.0.8/java"); - // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); - authentications.put("auth", new OAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); } /** @@ -364,6 +408,18 @@ public ApiClient addDefaultHeader(String key, String value) { return this; } + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + /** * Check that whether debugging is enabled for this API client. * @@ -483,6 +539,21 @@ public ApiClient setWriteTimeout(int writeTimeout) { return this; } + /** + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * + * @return Token request builder + */ + public TokenRequestBuilder getTokenEndPoint() { + for (Authentication apiAuth : authentications.values()) { + if (apiAuth instanceof RetryingOAuth) { + RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; + return retryingOAuth.getTokenRequestBuilder(); + } + } + return null; + } + /** * Format the given parameter object into string. * @@ -581,6 +652,40 @@ public List parameterToPairs(String collectionFormat, String name, Collect return params; } + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + /** * Sanitize filename by removing path. * e.g. ../../sun.gif becomes sun.gif @@ -940,14 +1045,15 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @param collectionQueryParams The collection query parameters * @param body The request body object * @param headerParams The header parameters + * @param cookieParams The cookie parameters * @param formParams The form parameters * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP call * @throws ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, callback); + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -961,18 +1067,20 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams); + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); final String url = buildUrl(path, queryParams, collectionQueryParams); final Request.Builder reqBuilder = new Request.Builder().url(url); processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); String contentType = (String) headerParams.get("Content-Type"); // ensuring a default content type @@ -1081,20 +1189,38 @@ public void processHeaderParams(Map headerParams, Request.Builde } } + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + /** * Update query and header parameters based on authentication settings. * * @param authNames The authentications to apply * @param queryParams List of query parameters * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { throw new RuntimeException("Authentication undefined: " + authName); } - auth.applyToParams(queryParams, headerParams); + auth.applyToParams(queryParams, headerParams, cookieParams); } } @@ -1183,16 +1309,16 @@ private void applySslSettings() { trustManagers = new TrustManager[]{ new X509TrustManager() { @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { } @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { } @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[]{}; + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; } } }; diff --git a/src/main/java/com/telstra/ApiException.java b/src/main/java/com/telstra/ApiException.java index d7c00af..3a1e389 100755 --- a/src/main/java/com/telstra/ApiException.java +++ b/src/main/java/com/telstra/ApiException.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:

{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ApiResponse.java b/src/main/java/com/telstra/ApiResponse.java index 66886b5..883dd96 100755 --- a/src/main/java/com/telstra/ApiResponse.java +++ b/src/main/java/com/telstra/ApiResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/Configuration.java b/src/main/java/com/telstra/Configuration.java index 0eb085a..7e094c0 100755 --- a/src/main/java/com/telstra/Configuration.java +++ b/src/main/java/com/telstra/Configuration.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/GzipRequestInterceptor.java b/src/main/java/com/telstra/GzipRequestInterceptor.java index 6b77814..42d93fe 100755 --- a/src/main/java/com/telstra/GzipRequestInterceptor.java +++ b/src/main/java/com/telstra/GzipRequestInterceptor.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/JSON.java b/src/main/java/com/telstra/JSON.java index 7624c02..dcbc55f 100755 --- a/src/main/java/com/telstra/JSON.java +++ b/src/main/java/com/telstra/JSON.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -27,7 +27,7 @@ import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; -import com.telstra.messaging.*; +import com.telstra.models.*; import okio.ByteString; import java.io.IOException; diff --git a/src/main/java/com/telstra/Pair.java b/src/main/java/com/telstra/Pair.java index 219c47e..cd39848 100755 --- a/src/main/java/com/telstra/Pair.java +++ b/src/main/java/com/telstra/Pair.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ProgressRequestBody.java b/src/main/java/com/telstra/ProgressRequestBody.java index 6fabda2..70b0b62 100755 --- a/src/main/java/com/telstra/ProgressRequestBody.java +++ b/src/main/java/com/telstra/ProgressRequestBody.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ProgressResponseBody.java b/src/main/java/com/telstra/ProgressResponseBody.java index cbec515..0f16275 100755 --- a/src/main/java/com/telstra/ProgressResponseBody.java +++ b/src/main/java/com/telstra/ProgressResponseBody.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/StringUtil.java b/src/main/java/com/telstra/StringUtil.java index af34039..9d2bd71 100755 --- a/src/main/java/com/telstra/StringUtil.java +++ b/src/main/java/com/telstra/StringUtil.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/ApiKeyAuth.java b/src/main/java/com/telstra/auth/ApiKeyAuth.java index 36b680a..d270720 100755 --- a/src/main/java/com/telstra/auth/ApiKeyAuth.java +++ b/src/main/java/com/telstra/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -56,7 +56,7 @@ public void setApiKeyPrefix(String apiKeyPrefix) { } @Override - public void applyToParams(List queryParams, Map headerParams) { + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { if (apiKey == null) { return; } @@ -70,6 +70,8 @@ public void applyToParams(List queryParams, Map headerPara queryParams.add(new Pair(paramName, value)); } else if ("header".equals(location)) { headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); } } } diff --git a/src/main/java/com/telstra/auth/Authentication.java b/src/main/java/com/telstra/auth/Authentication.java index 240d1f5..cdac669 100755 --- a/src/main/java/com/telstra/auth/Authentication.java +++ b/src/main/java/com/telstra/auth/Authentication.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -24,6 +24,7 @@ public interface Authentication { * * @param queryParams List of query parameters * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters */ - void applyToParams(List queryParams, Map headerParams); + void applyToParams(List queryParams, Map headerParams, Map cookieParams); } diff --git a/src/main/java/com/telstra/auth/HttpBasicAuth.java b/src/main/java/com/telstra/auth/HttpBasicAuth.java index 2c67550..bf481bd 100755 --- a/src/main/java/com/telstra/auth/HttpBasicAuth.java +++ b/src/main/java/com/telstra/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -43,7 +43,7 @@ public void setPassword(String password) { } @Override - public void applyToParams(List queryParams, Map headerParams) { + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { if (username == null && password == null) { return; } diff --git a/src/main/java/com/telstra/auth/HttpBearerAuth.java b/src/main/java/com/telstra/auth/HttpBearerAuth.java new file mode 100644 index 0000000..aecb459 --- /dev/null +++ b/src/main/java/com/telstra/auth/HttpBearerAuth.java @@ -0,0 +1,60 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.auth; + +import com.telstra.Pair; + +import java.util.Map; +import java.util.List; + + +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/com/telstra/auth/OAuth.java b/src/main/java/com/telstra/auth/OAuth.java index 38d6ef0..79fb178 100755 --- a/src/main/java/com/telstra/auth/OAuth.java +++ b/src/main/java/com/telstra/auth/OAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -31,7 +31,7 @@ public void setAccessToken(String accessToken) { } @Override - public void applyToParams(List queryParams, Map headerParams) { + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { if (accessToken != null) { headerParams.put("Authorization", "Bearer " + accessToken); } diff --git a/src/main/java/com/telstra/auth/OAuthFlow.java b/src/main/java/com/telstra/auth/OAuthFlow.java index 5d285d7..15ddc67 100755 --- a/src/main/java/com/telstra/auth/OAuthFlow.java +++ b/src/main/java/com/telstra/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/OAuthOkHttpClient.java b/src/main/java/com/telstra/auth/OAuthOkHttpClient.java new file mode 100644 index 0000000..b73aaab --- /dev/null +++ b/src/main/java/com/telstra/auth/OAuthOkHttpClient.java @@ -0,0 +1,68 @@ +package com.telstra.auth; + +import okhttp3.OkHttpClient; +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.HttpClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthClientResponse; +import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; + +public class OAuthOkHttpClient implements HttpClient { + private OkHttpClient client; + + public OAuthOkHttpClient() { + this.client = new OkHttpClient(); + } + + public OAuthOkHttpClient(OkHttpClient client) { + this.client = client; + } + + @Override + public T execute(OAuthClientRequest request, Map headers, + String requestMethod, Class responseClass) + throws OAuthSystemException, OAuthProblemException { + + MediaType mediaType = MediaType.parse("application/json"); + Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); + + if(headers != null) { + for (Entry entry : headers.entrySet()) { + if (entry.getKey().equalsIgnoreCase("Content-Type")) { + mediaType = MediaType.parse(entry.getValue()); + } else { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + } + } + + RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; + requestBuilder.method(requestMethod, body); + + try { + Response response = client.newCall(requestBuilder.build()).execute(); + return OAuthClientResponseFactory.createCustomResponse( + response.body().string(), + response.body().contentType().toString(), + response.code(), + responseClass); + } catch (IOException e) { + throw new OAuthSystemException(e); + } + } + + @Override + public void shutdown() { + // Nothing to do here + } +} diff --git a/src/main/java/com/telstra/auth/RetryingOAuth.java b/src/main/java/com/telstra/auth/RetryingOAuth.java new file mode 100644 index 0000000..7adcd3c --- /dev/null +++ b/src/main/java/com/telstra/auth/RetryingOAuth.java @@ -0,0 +1,174 @@ +package com.telstra.auth; + +import com.telstra.Pair; + +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.util.Map; +import java.util.List; + +public class RetryingOAuth extends OAuth implements Interceptor { + private OAuthClient oAuthClient; + + private TokenRequestBuilder tokenRequestBuilder; + + public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { + this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); + this.tokenRequestBuilder = tokenRequestBuilder; + } + + public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { + this(new OkHttpClient(), tokenRequestBuilder); + } + + public RetryingOAuth( + String tokenUrl, + String clientId, + OAuthFlow flow, + String clientSecret, + Map parameters + ) { + this(OAuthClientRequest.tokenLocation(tokenUrl) + .setClientId(clientId) + .setClientSecret(clientSecret)); + setFlow(flow); + if (parameters != null) { + for (String paramName : parameters.keySet()) { + tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + } + } + } + + public void setFlow(OAuthFlow flow) { + switch(flow) { + case accessCode: + tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); + break; + case implicit: + tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); + break; + case password: + tokenRequestBuilder.setGrantType(GrantType.PASSWORD); + break; + case application: + tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); + break; + default: + break; + } + } + + @Override + public Response intercept(Chain chain) throws IOException { + return retryingIntercept(chain, true); + } + + private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { + Request request = chain.request(); + + // If the request already has an authorization (e.g. Basic auth), proceed with the request as is + if (request.header("Authorization") != null) { + return chain.proceed(request); + } + + // Get the token if it has not yet been acquired + if (getAccessToken() == null) { + updateAccessToken(null); + } + + OAuthClientRequest oAuthRequest; + if (getAccessToken() != null) { + // Build the request + Request.Builder requestBuilder = request.newBuilder(); + + String requestAccessToken = getAccessToken(); + try { + oAuthRequest = + new OAuthBearerClientRequest(request.url().toString()). + setAccessToken(requestAccessToken). + buildHeaderMessage(); + } catch (OAuthSystemException e) { + throw new IOException(e); + } + + Map headers = oAuthRequest.getHeaders(); + for (String headerName : headers.keySet()) { + requestBuilder.addHeader(headerName, headers.get(headerName)); + } + requestBuilder.url(oAuthRequest.getLocationUri()); + + // Execute the request + Response response = chain.proceed(requestBuilder.build()); + + // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row + if ( + response != null && + ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || + response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && + updateTokenAndRetryOnAuthorizationFailure + ) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body().close(); + return retryingIntercept(chain, false); + } + } catch (Exception e) { + response.body().close(); + throw e; + } + } + return response; + } + else { + return chain.proceed(chain.request()); + } + } + + /* + * Returns true if the access token has been updated + */ + public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + try { + OAuthJSONAccessTokenResponse accessTokenResponse = + oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken()); + return !getAccessToken().equals(requestAccessToken); + } + } catch (OAuthSystemException | OAuthProblemException e) { + throw new IOException(e); + } + } + + return false; + } + + public TokenRequestBuilder getTokenRequestBuilder() { + return tokenRequestBuilder; + } + + public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { + this.tokenRequestBuilder = tokenRequestBuilder; + } + + // Applying authorization to parameters is performed in the retryingIntercept method + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + // No implementation necessary + } +} diff --git a/src/main/java/com/telstra/messaging/AuthenticationApi.java b/src/main/java/com/telstra/messaging/AuthenticationApi.java index d8b033c..3a93098 100755 --- a/src/main/java/com/telstra/messaging/AuthenticationApi.java +++ b/src/main/java/com/telstra/messaging/AuthenticationApi.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -27,7 +27,7 @@ import java.io.IOException; -import com.telstra.messaging.OAuthResponse; +import com.telstra.models.OAuthResponse; import java.lang.reflect.Type; import java.util.ArrayList; @@ -83,6 +83,7 @@ public okhttp3.Call authTokenCall(String clientId, String clientSecret, String g List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (clientId != null) { localVarFormParams.put("client_id", clientId); @@ -115,7 +116,7 @@ public okhttp3.Call authTokenCall(String clientId, String clientSecret, String g localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/src/main/java/com/telstra/messaging/DeleteNumberRequest.java b/src/main/java/com/telstra/messaging/DeleteNumberRequest.java deleted file mode 100755 index 58a957a..0000000 --- a/src/main/java/com/telstra/messaging/DeleteNumberRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * DeleteNumberRequest - */ - -public class DeleteNumberRequest { - public static final String SERIALIZED_NAME_EMPTY_ARR = "emptyArr"; - @SerializedName(SERIALIZED_NAME_EMPTY_ARR) - private Integer emptyArr = 0; - - - public DeleteNumberRequest emptyArr(Integer emptyArr) { - - this.emptyArr = emptyArr; - return this; - } - - /** - * Empty Arr - * @return emptyArr - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Empty Arr") - - public Integer getEmptyArr() { - return emptyArr; - } - - - public void setEmptyArr(Integer emptyArr) { - this.emptyArr = emptyArr; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteNumberRequest deleteNumberRequest = (DeleteNumberRequest) o; - return Objects.equals(this.emptyArr, deleteNumberRequest.emptyArr); - } - - @Override - public int hashCode() { - return Objects.hash(emptyArr); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteNumberRequest {\n"); - sb.append(" emptyArr: ").append(toIndentedString(emptyArr)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/GetMmsResponse.java b/src/main/java/com/telstra/messaging/GetMmsResponse.java deleted file mode 100644 index f62c3b5..0000000 --- a/src/main/java/com/telstra/messaging/GetMmsResponse.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.MMSContent; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * GetMmsResponse - */ - -public class GetMmsResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) - private String destinationAddress; - - public static final String SERIALIZED_NAME_SENDER_ADDRESS = "senderAddress"; - @SerializedName(SERIALIZED_NAME_SENDER_ADDRESS) - private String senderAddress; - - public static final String SERIALIZED_NAME_SUBJECT = "subject"; - @SerializedName(SERIALIZED_NAME_SUBJECT) - private String subject; - - public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; - @SerializedName(SERIALIZED_NAME_MESSAGE_ID) - private String messageId; - - public static final String SERIALIZED_NAME_API_MSG_ID = "apiMsgId"; - @SerializedName(SERIALIZED_NAME_API_MSG_ID) - private String apiMsgId; - - public static final String SERIALIZED_NAME_SENT_TIMESTAMP = "sentTimestamp"; - @SerializedName(SERIALIZED_NAME_SENT_TIMESTAMP) - private String sentTimestamp; - - public static final String SERIALIZED_NAME_MM_S_CONTENT = "MMSContent"; - @SerializedName(SERIALIZED_NAME_MM_S_CONTENT) - private List mmSContent = new ArrayList(); - - - public GetMmsResponse status(String status) { - - this.status = status; - return this; - } - - /** - * The final state of the message. - * @return status - **/ - @ApiModelProperty(example = "RECEIVED", required = true, value = "The final state of the message. ") - - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - public GetMmsResponse destinationAddress(String destinationAddress) { - - this.destinationAddress = destinationAddress; - return this; - } - - /** - * The number the message was sent to. - * @return destinationAddress - **/ - @ApiModelProperty(example = "61412345678", required = true, value = "The number the message was sent to. ") - - public String getDestinationAddress() { - return destinationAddress; - } - - - public void setDestinationAddress(String destinationAddress) { - this.destinationAddress = destinationAddress; - } - - - public GetMmsResponse senderAddress(String senderAddress) { - - this.senderAddress = senderAddress; - return this; - } - - /** - * The number the message was sent from. - * @return senderAddress - **/ - @ApiModelProperty(example = "61487654321", required = true, value = "The number the message was sent from. ") - - public String getSenderAddress() { - return senderAddress; - } - - - public void setSenderAddress(String senderAddress) { - this.senderAddress = senderAddress; - } - - - public GetMmsResponse subject(String subject) { - - this.subject = subject; - return this; - } - - /** - * The subject assigned to the message. - * @return subject - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The subject assigned to the message. ") - - public String getSubject() { - return subject; - } - - - public void setSubject(String subject) { - this.subject = subject; - } - - - public GetMmsResponse messageId(String messageId) { - - this.messageId = messageId; - return this; - } - - /** - * Message Id assigned by the MMSC. - * @return messageId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Message Id assigned by the MMSC. ") - - public String getMessageId() { - return messageId; - } - - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - - public GetMmsResponse apiMsgId(String apiMsgId) { - - this.apiMsgId = apiMsgId; - return this; - } - - /** - * Message Id assigned by the API. - * @return apiMsgId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Message Id assigned by the API. ") - - public String getApiMsgId() { - return apiMsgId; - } - - - public void setApiMsgId(String apiMsgId) { - this.apiMsgId = apiMsgId; - } - - - public GetMmsResponse sentTimestamp(String sentTimestamp) { - - this.sentTimestamp = sentTimestamp; - return this; - } - - /** - * Time handling of the message ended. - * @return sentTimestamp - **/ - @ApiModelProperty(example = "2018-11-23T16:14:02+10:00", required = true, value = "Time handling of the message ended. ") - - public String getSentTimestamp() { - return sentTimestamp; - } - - - public void setSentTimestamp(String sentTimestamp) { - this.sentTimestamp = sentTimestamp; - } - - - public GetMmsResponse mmSContent(List mmSContent) { - - this.mmSContent = mmSContent; - return this; - } - - public GetMmsResponse addMmSContentItem(MMSContent mmSContentItem) { - this.mmSContent.add(mmSContentItem); - return this; - } - - /** - * An array of content that was received in an MMS message. - * @return mmSContent - **/ - @ApiModelProperty(required = true, value = "An array of content that was received in an MMS message. ") - - public List getMmSContent() { - return mmSContent; - } - - - public void setMmSContent(List mmSContent) { - this.mmSContent = mmSContent; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetMmsResponse getMmsResponse = (GetMmsResponse) o; - return Objects.equals(this.status, getMmsResponse.status) && - Objects.equals(this.destinationAddress, getMmsResponse.destinationAddress) && - Objects.equals(this.senderAddress, getMmsResponse.senderAddress) && - Objects.equals(this.subject, getMmsResponse.subject) && - Objects.equals(this.messageId, getMmsResponse.messageId) && - Objects.equals(this.apiMsgId, getMmsResponse.apiMsgId) && - Objects.equals(this.sentTimestamp, getMmsResponse.sentTimestamp) && - Objects.equals(this.mmSContent, getMmsResponse.mmSContent); - } - - @Override - public int hashCode() { - return Objects.hash(status, destinationAddress, senderAddress, subject, messageId, apiMsgId, sentTimestamp, mmSContent); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetMmsResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); - sb.append(" senderAddress: ").append(toIndentedString(senderAddress)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); - sb.append(" apiMsgId: ").append(toIndentedString(apiMsgId)).append("\n"); - sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); - sb.append(" mmSContent: ").append(toIndentedString(mmSContent)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java b/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java deleted file mode 100755 index 86fd3ae..0000000 --- a/src/main/java/com/telstra/messaging/GetSubscriptionResponse.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * GetSubscriptionResponse - */ - -public class GetSubscriptionResponse { - public static final String SERIALIZED_NAME_ACTIVE_DAYS = "activeDays"; - @SerializedName(SERIALIZED_NAME_ACTIVE_DAYS) - private String activeDays; - - public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; - @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) - private String notifyURL; - - public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) - private String destinationAddress; - - - public GetSubscriptionResponse activeDays(String activeDays) { - - this.activeDays = activeDays; - return this; - } - - /** - * Number of active days - * @return activeDays - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Number of active days") - - public String getActiveDays() { - return activeDays; - } - - - public void setActiveDays(String activeDays) { - this.activeDays = activeDays; - } - - - public GetSubscriptionResponse notifyURL(String notifyURL) { - - this.notifyURL = notifyURL; - return this; - } - - /** - * Notify url configured - * @return notifyURL - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Notify url configured") - - public String getNotifyURL() { - return notifyURL; - } - - - public void setNotifyURL(String notifyURL) { - this.notifyURL = notifyURL; - } - - - public GetSubscriptionResponse destinationAddress(String destinationAddress) { - - this.destinationAddress = destinationAddress; - return this; - } - - /** - * The mobile phone number that was allocated - * @return destinationAddress - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The mobile phone number that was allocated") - - public String getDestinationAddress() { - return destinationAddress; - } - - - public void setDestinationAddress(String destinationAddress) { - this.destinationAddress = destinationAddress; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetSubscriptionResponse getSubscriptionResponse = (GetSubscriptionResponse) o; - return Objects.equals(this.activeDays, getSubscriptionResponse.activeDays) && - Objects.equals(this.notifyURL, getSubscriptionResponse.notifyURL) && - Objects.equals(this.destinationAddress, getSubscriptionResponse.destinationAddress); - } - - @Override - public int hashCode() { - return Objects.hash(activeDays, notifyURL, destinationAddress); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSubscriptionResponse {\n"); - sb.append(" activeDays: ").append(toIndentedString(activeDays)).append("\n"); - sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); - sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/HealthCheckResponse.java b/src/main/java/com/telstra/messaging/HealthCheckResponse.java deleted file mode 100644 index fbe8457..0000000 --- a/src/main/java/com/telstra/messaging/HealthCheckResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * Information regarding service being up or down. - */ -@ApiModel(description = "Information regarding service being up or down. ") - -public class HealthCheckResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - - public HealthCheckResponse status(String status) { - - this.status = status; - return this; - } - - /** - * message status - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "up", value = "message status") - - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HealthCheckResponse healthCheckResponse = (HealthCheckResponse) o; - return Objects.equals(this.status, healthCheckResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HealthCheckResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/InboundPollResponse.java b/src/main/java/com/telstra/messaging/InboundPollResponse.java deleted file mode 100755 index 496b617..0000000 --- a/src/main/java/com/telstra/messaging/InboundPollResponse.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. - */ -@ApiModel(description = "Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. ") - -public class InboundPollResponse { - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) - private String destinationAddress; - - public static final String SERIALIZED_NAME_SENDER_ADDRESS = "senderAddress"; - @SerializedName(SERIALIZED_NAME_SENDER_ADDRESS) - private String senderAddress; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; - @SerializedName(SERIALIZED_NAME_MESSAGE_ID) - private String messageId; - - public static final String SERIALIZED_NAME_SENT_TIMESTAMP = "sentTimestamp"; - @SerializedName(SERIALIZED_NAME_SENT_TIMESTAMP) - private String sentTimestamp; - - - public InboundPollResponse status(String status) { - - this.status = status; - return this; - } - - /** - * message status - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "message status") - - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - public InboundPollResponse destinationAddress(String destinationAddress) { - - this.destinationAddress = destinationAddress; - return this; - } - - /** - * The phone number (recipient) that the message was sent to (in E.164 format). - * @return destinationAddress - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The phone number (recipient) that the message was sent to (in E.164 format). ") - - public String getDestinationAddress() { - return destinationAddress; - } - - - public void setDestinationAddress(String destinationAddress) { - this.destinationAddress = destinationAddress; - } - - - public InboundPollResponse senderAddress(String senderAddress) { - - this.senderAddress = senderAddress; - return this; - } - - /** - * The phone number (sender) that the message was sent from (in E.164 format). - * @return senderAddress - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The phone number (sender) that the message was sent from (in E.164 format). ") - - public String getSenderAddress() { - return senderAddress; - } - - - public void setSenderAddress(String senderAddress) { - this.senderAddress = senderAddress; - } - - - public InboundPollResponse message(String message) { - - this.message = message; - return this; - } - - /** - * Text of the message that was sent - * @return message - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Text of the message that was sent") - - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public InboundPollResponse messageId(String messageId) { - - this.messageId = messageId; - return this; - } - - /** - * Message Id - * @return messageId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Message Id") - - public String getMessageId() { - return messageId; - } - - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - - public InboundPollResponse sentTimestamp(String sentTimestamp) { - - this.sentTimestamp = sentTimestamp; - return this; - } - - /** - * The date and time when the message was sent by recipient. - * @return sentTimestamp - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The date and time when the message was sent by recipient.") - - public String getSentTimestamp() { - return sentTimestamp; - } - - - public void setSentTimestamp(String sentTimestamp) { - this.sentTimestamp = sentTimestamp; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InboundPollResponse inboundPollResponse = (InboundPollResponse) o; - return Objects.equals(this.status, inboundPollResponse.status) && - Objects.equals(this.destinationAddress, inboundPollResponse.destinationAddress) && - Objects.equals(this.senderAddress, inboundPollResponse.senderAddress) && - Objects.equals(this.message, inboundPollResponse.message) && - Objects.equals(this.messageId, inboundPollResponse.messageId) && - Objects.equals(this.sentTimestamp, inboundPollResponse.sentTimestamp); - } - - @Override - public int hashCode() { - return Objects.hash(status, destinationAddress, senderAddress, message, messageId, sentTimestamp); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InboundPollResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); - sb.append(" senderAddress: ").append(toIndentedString(senderAddress)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); - sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/MMSContent.java b/src/main/java/com/telstra/messaging/MMSContent.java deleted file mode 100755 index 62a93f1..0000000 --- a/src/main/java/com/telstra/messaging/MMSContent.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * MMSContent - */ - -public class MMSContent { - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_FILENAME = "filename"; - @SerializedName(SERIALIZED_NAME_FILENAME) - private String filename; - - public static final String SERIALIZED_NAME_PAYLOAD = "payload"; - @SerializedName(SERIALIZED_NAME_PAYLOAD) - private String payload; - - - public MMSContent type(String type) { - - this.type = type; - return this; - } - - /** - * The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar - * @return type - **/ - @ApiModelProperty(required = true, value = "The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar ") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public MMSContent filename(String filename) { - - this.filename = filename; - return this; - } - - /** - * The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. - * @return filename - **/ - @ApiModelProperty(required = true, value = "The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. ") - - public String getFilename() { - return filename; - } - - - public void setFilename(String filename) { - this.filename = filename; - } - - - public MMSContent payload(String payload) { - - this.payload = payload; - return this; - } - - /** - * Base64 encoded message content. - * @return payload - **/ - @ApiModelProperty(required = true, value = "Base64 encoded message content. ") - - public String getPayload() { - return payload; - } - - - public void setPayload(String payload) { - this.payload = payload; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MMSContent mmSContent = (MMSContent) o; - return Objects.equals(this.type, mmSContent.type) && - Objects.equals(this.filename, mmSContent.filename) && - Objects.equals(this.payload, mmSContent.payload); - } - - @Override - public int hashCode() { - return Objects.hash(type, filename, payload); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MMSContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); - sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/Message.java b/src/main/java/com/telstra/messaging/Message.java deleted file mode 100755 index a7df855..0000000 --- a/src/main/java/com/telstra/messaging/Message.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * Message - */ - -public class Message { - public static final String SERIALIZED_NAME_TO = "to"; - @SerializedName(SERIALIZED_NAME_TO) - private String to; - - public static final String SERIALIZED_NAME_DELIVERY_STATUS = "deliveryStatus"; - @SerializedName(SERIALIZED_NAME_DELIVERY_STATUS) - private String deliveryStatus; - - public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; - @SerializedName(SERIALIZED_NAME_MESSAGE_ID) - private String messageId; - - public static final String SERIALIZED_NAME_MESSAGE_STATUS_U_R_L = "messageStatusURL"; - @SerializedName(SERIALIZED_NAME_MESSAGE_STATUS_U_R_L) - private String messageStatusURL; - - - public Message to(String to) { - - this.to = to; - return this; - } - - /** - * Just a copy of the number the message is sent to. - * @return to - **/ - @ApiModelProperty(example = "+61412345678", required = true, value = "Just a copy of the number the message is sent to.") - - public String getTo() { - return to; - } - - - public void setTo(String to) { - this.to = to; - } - - - public Message deliveryStatus(String deliveryStatus) { - - this.deliveryStatus = deliveryStatus; - return this; - } - - /** - * Gives an indication if the message has been accepted for delivery. The description field contains information on why a message may have been rejected. - * @return deliveryStatus - **/ - @ApiModelProperty(example = "MessageWaiting", required = true, value = "Gives an indication if the message has been accepted for delivery. The description field contains information on why a message may have been rejected. ") - - public String getDeliveryStatus() { - return deliveryStatus; - } - - - public void setDeliveryStatus(String deliveryStatus) { - this.deliveryStatus = deliveryStatus; - } - - - public Message messageId(String messageId) { - - this.messageId = messageId; - return this; - } - - /** - * 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 `messageId` will be different for each number that the message was sent to. - * @return messageId - **/ - @ApiModelProperty(example = "d997474900097a1f0000000008d7e18102cc0901-1261412345678", required = true, value = "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 `messageId` will be different for each number that the message was sent to. ") - - public String getMessageId() { - return messageId; - } - - - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - - public Message messageStatusURL(String messageStatusURL) { - - this.messageStatusURL = messageStatusURL; - return this; - } - - /** - * 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. - * @return messageStatusURL - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "https://tapi.telstra.com/v2/messages/sms/d997474900097a1f0000000008d7e18102cc0901-1261412345678/status ", value = "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. ") - - public String getMessageStatusURL() { - return messageStatusURL; - } - - - public void setMessageStatusURL(String messageStatusURL) { - this.messageStatusURL = messageStatusURL; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Message message = (Message) o; - return Objects.equals(this.to, message.to) && - Objects.equals(this.deliveryStatus, message.deliveryStatus) && - Objects.equals(this.messageId, message.messageId) && - Objects.equals(this.messageStatusURL, message.messageStatusURL); - } - - @Override - public int hashCode() { - return Objects.hash(to, deliveryStatus, messageId, messageStatusURL); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Message {\n"); - sb.append(" to: ").append(toIndentedString(to)).append("\n"); - sb.append(" deliveryStatus: ").append(toIndentedString(deliveryStatus)).append("\n"); - sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); - sb.append(" messageStatusURL: ").append(toIndentedString(messageStatusURL)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/MessageMulti.java b/src/main/java/com/telstra/messaging/MessageMulti.java deleted file mode 100644 index 997f068..0000000 --- a/src/main/java/com/telstra/messaging/MessageMulti.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * MessageMulti - */ - -public class MessageMulti { - public static final String SERIALIZED_NAME_TO = "to"; - @SerializedName(SERIALIZED_NAME_TO) - private String to; - - public static final String SERIALIZED_NAME_BODY = "body"; - @SerializedName(SERIALIZED_NAME_BODY) - private String body; - - public static final String SERIALIZED_NAME_RECEIPT_OFF = "receiptOff"; - @SerializedName(SERIALIZED_NAME_RECEIPT_OFF) - private Boolean receiptOff; - - - public MessageMulti to(String to) { - - this.to = to; - return this; - } - - /** - * Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. - * @return to - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "+61412345678", value = "Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. ") - - public String getTo() { - return to; - } - - - public void setTo(String to) { - this.to = to; - } - - - public MessageMulti body(String body) { - - this.body = body; - return this; - } - - /** - * 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 - * @return body - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "Test Message", value = "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 ") - - public String getBody() { - return body; - } - - - public void setBody(String body) { - this.body = body; - } - - - public MessageMulti receiptOff(Boolean receiptOff) { - - this.receiptOff = receiptOff; - return this; - } - - /** - * Whether Delivery Receipt will be sent back or not. Setting this field to `true` will disable Delivery Receipts. The `notifyURL` field will be ignored, if there is one in the payload. An \"OLD-NONEXISTANT-MESSAGE-ID\" 400 error will also be returned upon Polling for the SMS Status. - * @return receiptOff - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Whether Delivery Receipt will be sent back or not. Setting this field to `true` will disable Delivery Receipts. The `notifyURL` field will be ignored, if there is one in the payload. An \"OLD-NONEXISTANT-MESSAGE-ID\" 400 error will also be returned upon Polling for the SMS Status. ") - - public Boolean getReceiptOff() { - return receiptOff; - } - - - public void setReceiptOff(Boolean receiptOff) { - this.receiptOff = receiptOff; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MessageMulti messageMulti = (MessageMulti) o; - return Objects.equals(this.to, messageMulti.to) && - Objects.equals(this.body, messageMulti.body) && - Objects.equals(this.receiptOff, messageMulti.receiptOff); - } - - @Override - public int hashCode() { - return Objects.hash(to, body, receiptOff); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MessageMulti {\n"); - sb.append(" to: ").append(toIndentedString(to)).append("\n"); - sb.append(" body: ").append(toIndentedString(body)).append("\n"); - sb.append(" receiptOff: ").append(toIndentedString(receiptOff)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/MessageSentResponseMms.java b/src/main/java/com/telstra/messaging/MessageSentResponseMms.java deleted file mode 100644 index ce40970..0000000 --- a/src/main/java/com/telstra/messaging/MessageSentResponseMms.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.Message; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * MessageSentResponseMms - */ - -public class MessageSentResponseMms { - public static final String SERIALIZED_NAME_MESSAGES = "messages"; - @SerializedName(SERIALIZED_NAME_MESSAGES) - private List messages = new ArrayList(); - - public static final String SERIALIZED_NAME_MMS_MEDIA_K_B = "MmsMediaKB"; - @SerializedName(SERIALIZED_NAME_MMS_MEDIA_K_B) - private Integer mmsMediaKB; - - public static final String SERIALIZED_NAME_COUNTRY = "Country"; - @SerializedName(SERIALIZED_NAME_COUNTRY) - private List country = null; - - public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; - @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) - private String messageType; - - public static final String SERIALIZED_NAME_NUMBER_SEGMENTS = "numberSegments"; - @SerializedName(SERIALIZED_NAME_NUMBER_SEGMENTS) - private Integer numberSegments; - - - public MessageSentResponseMms messages(List messages) { - - this.messages = messages; - return this; - } - - public MessageSentResponseMms addMessagesItem(Message messagesItem) { - this.messages.add(messagesItem); - return this; - } - - /** - * An array of messages. - * @return messages - **/ - @ApiModelProperty(required = true, value = "An array of messages.") - - public List getMessages() { - return messages; - } - - - public void setMessages(List messages) { - this.messages = messages; - } - - - public MessageSentResponseMms mmsMediaKB(Integer mmsMediaKB) { - - this.mmsMediaKB = mmsMediaKB; - return this; - } - - /** - * Indicates the message size in kB of the MMS sent. - * @return mmsMediaKB - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "2", value = "Indicates the message size in kB of the MMS sent. ") - - public Integer getMmsMediaKB() { - return mmsMediaKB; - } - - - public void setMmsMediaKB(Integer mmsMediaKB) { - this.mmsMediaKB = mmsMediaKB; - } - - - public MessageSentResponseMms country(List country) { - - this.country = country; - return this; - } - - public MessageSentResponseMms addCountryItem(Object countryItem) { - if (this.country == null) { - this.country = new ArrayList(); - } - this.country.add(countryItem); - return this; - } - - /** - * An array of the countries to which the destination MSISDNs belong. - * @return country - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "[{AUS=1}]", value = "An array of the countries to which the destination MSISDNs belong.") - - public List getCountry() { - return country; - } - - - public void setCountry(List country) { - this.country = country; - } - - - public MessageSentResponseMms messageType(String messageType) { - - this.messageType = messageType; - return this; - } - - /** - * This returns whether the message sent was a SMS or MMS. - * @return messageType - **/ - @ApiModelProperty(example = "MMS", required = true, value = "This returns whether the message sent was a SMS or MMS.") - - public String getMessageType() { - return messageType; - } - - - public void setMessageType(String messageType) { - this.messageType = messageType; - } - - - public MessageSentResponseMms numberSegments(Integer numberSegments) { - - this.numberSegments = numberSegments; - return this; - } - - /** - * MMS with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. - * @return numberSegments - **/ - @ApiModelProperty(example = "4", required = true, value = "MMS with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. ") - - public Integer getNumberSegments() { - return numberSegments; - } - - - public void setNumberSegments(Integer numberSegments) { - this.numberSegments = numberSegments; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MessageSentResponseMms messageSentResponseMms = (MessageSentResponseMms) o; - return Objects.equals(this.messages, messageSentResponseMms.messages) && - Objects.equals(this.mmsMediaKB, messageSentResponseMms.mmsMediaKB) && - Objects.equals(this.country, messageSentResponseMms.country) && - Objects.equals(this.messageType, messageSentResponseMms.messageType) && - Objects.equals(this.numberSegments, messageSentResponseMms.numberSegments); - } - - @Override - public int hashCode() { - return Objects.hash(messages, mmsMediaKB, country, messageType, numberSegments); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MessageSentResponseMms {\n"); - sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); - sb.append(" mmsMediaKB: ").append(toIndentedString(mmsMediaKB)).append("\n"); - sb.append(" country: ").append(toIndentedString(country)).append("\n"); - sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); - sb.append(" numberSegments: ").append(toIndentedString(numberSegments)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/MessageSentResponseSms.java b/src/main/java/com/telstra/messaging/MessageSentResponseSms.java deleted file mode 100644 index f29c5c9..0000000 --- a/src/main/java/com/telstra/messaging/MessageSentResponseSms.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.Message; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * MessageSentResponseSms - */ - -public class MessageSentResponseSms { - public static final String SERIALIZED_NAME_MESSAGES = "messages"; - @SerializedName(SERIALIZED_NAME_MESSAGES) - private List messages = new ArrayList(); - - public static final String SERIALIZED_NAME_COUNTRY = "Country"; - @SerializedName(SERIALIZED_NAME_COUNTRY) - private List country = null; - - public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; - @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) - private String messageType; - - public static final String SERIALIZED_NAME_NUMBER_SEGMENTS = "numberSegments"; - @SerializedName(SERIALIZED_NAME_NUMBER_SEGMENTS) - private Integer numberSegments; - - - public MessageSentResponseSms messages(List messages) { - - this.messages = messages; - return this; - } - - public MessageSentResponseSms addMessagesItem(Message messagesItem) { - this.messages.add(messagesItem); - return this; - } - - /** - * An array of messages. - * @return messages - **/ - @ApiModelProperty(required = true, value = "An array of messages.") - - public List getMessages() { - return messages; - } - - - public void setMessages(List messages) { - this.messages = messages; - } - - - public MessageSentResponseSms country(List country) { - - this.country = country; - return this; - } - - public MessageSentResponseSms addCountryItem(Object countryItem) { - if (this.country == null) { - this.country = new ArrayList(); - } - this.country.add(countryItem); - return this; - } - - /** - * An array of the countries to which the destination MSISDNs belong. - * @return country - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "[{AUS=1}]", value = "An array of the countries to which the destination MSISDNs belong.") - - public List getCountry() { - return country; - } - - - public void setCountry(List country) { - this.country = country; - } - - - public MessageSentResponseSms messageType(String messageType) { - - this.messageType = messageType; - return this; - } - - /** - * This returns whether the message sent was a SMS or MMS. - * @return messageType - **/ - @ApiModelProperty(example = "SMS", required = true, value = "This returns whether the message sent was a SMS or MMS.") - - public String getMessageType() { - return messageType; - } - - - public void setMessageType(String messageType) { - this.messageType = messageType; - } - - - public MessageSentResponseSms numberSegments(Integer numberSegments) { - - this.numberSegments = numberSegments; - return this; - } - - /** - * A message which has 160 GSM-7 characters or less will have numberSegments=1. Note that multi-part messages which are over 160 GSM-7 characters will include the User Data Header as part of the numberSegments. The User Data Header is being used for the re-assembly of the messages. - * @return numberSegments - **/ - @ApiModelProperty(example = "1", required = true, value = "A message which has 160 GSM-7 characters or less will have numberSegments=1. Note that multi-part messages which are over 160 GSM-7 characters will include the User Data Header as part of the numberSegments. The User Data Header is being used for the re-assembly of the messages. ") - - public Integer getNumberSegments() { - return numberSegments; - } - - - public void setNumberSegments(Integer numberSegments) { - this.numberSegments = numberSegments; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MessageSentResponseSms messageSentResponseSms = (MessageSentResponseSms) o; - return Objects.equals(this.messages, messageSentResponseSms.messages) && - Objects.equals(this.country, messageSentResponseSms.country) && - Objects.equals(this.messageType, messageSentResponseSms.messageType) && - Objects.equals(this.numberSegments, messageSentResponseSms.numberSegments); - } - - @Override - public int hashCode() { - return Objects.hash(messages, country, messageType, numberSegments); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MessageSentResponseSms {\n"); - sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); - sb.append(" country: ").append(toIndentedString(country)).append("\n"); - sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); - sb.append(" numberSegments: ").append(toIndentedString(numberSegments)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/MessagingApi.java b/src/main/java/com/telstra/messaging/MessagingApi.java index 70a3a7c..78198d7 100755 --- a/src/main/java/com/telstra/messaging/MessagingApi.java +++ b/src/main/java/com/telstra/messaging/MessagingApi.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -27,15 +27,15 @@ import java.io.IOException; -import com.telstra.messaging.GetMmsResponse; -import com.telstra.messaging.HealthCheckResponse; -import com.telstra.messaging.InboundPollResponse; -import com.telstra.messaging.MessageSentResponseMms; -import com.telstra.messaging.MessageSentResponseSms; -import com.telstra.messaging.OutboundPollResponse; -import com.telstra.messaging.SendMmsRequest; -import com.telstra.messaging.SendSMSRequest; -import com.telstra.messaging.SendSmsMultiRequest; +import com.telstra.models.GetMmsResponse; +import com.telstra.models.HealthCheckResponse; +import com.telstra.models.InboundPollResponse; +import com.telstra.models.MessageSentResponseMms; +import com.telstra.models.MessageSentResponseSms; +import com.telstra.models.OutboundPollResponse; +import com.telstra.models.SendMmsRequest; +import com.telstra.models.SendSMSRequest; +import com.telstra.models.SendSmsMultiRequest; import java.lang.reflect.Type; import java.util.ArrayList; @@ -95,6 +95,7 @@ public okhttp3.Call getMMSStatusCall(String messageid, final ApiCallback _callba List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -111,7 +112,7 @@ public okhttp3.Call getMMSStatusCall(String messageid, final ApiCallback _callba localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -249,6 +250,7 @@ public okhttp3.Call getSMSStatusCall(String messageId, final ApiCallback _callba List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -265,7 +267,7 @@ public okhttp3.Call getSMSStatusCall(String messageId, final ApiCallback _callba localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -394,6 +396,7 @@ public okhttp3.Call mMSHealthCheckCall(final ApiCallback _callback) throws ApiEx List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -410,7 +413,7 @@ public okhttp3.Call mMSHealthCheckCall(final ApiCallback _callback) throws ApiEx localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -517,6 +520,7 @@ public okhttp3.Call retrieveMMSRepliesCall(final ApiCallback _callback) throws A List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -533,7 +537,7 @@ public okhttp3.Call retrieveMMSRepliesCall(final ApiCallback _callback) throws A localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -661,6 +665,7 @@ public okhttp3.Call retrieveSMSRepliesCall(final ApiCallback _callback) throws A List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -677,7 +682,7 @@ public okhttp3.Call retrieveSMSRepliesCall(final ApiCallback _callback) throws A localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -798,6 +803,7 @@ public okhttp3.Call sMSHealthCheckCall(final ApiCallback _callback) throws ApiEx List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -814,7 +820,7 @@ public okhttp3.Call sMSHealthCheckCall(final ApiCallback _callback) throws ApiEx localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -916,6 +922,7 @@ public okhttp3.Call sMSMultiCall(SendSmsMultiRequest payload, final ApiCallback List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -932,7 +939,7 @@ public okhttp3.Call sMSMultiCall(SendSmsMultiRequest payload, final ApiCallback localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1051,6 +1058,7 @@ public okhttp3.Call sendMMSCall(SendMmsRequest body, final ApiCallback _callback List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -1067,7 +1075,7 @@ public okhttp3.Call sendMMSCall(SendMmsRequest body, final ApiCallback _callback localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1204,6 +1212,7 @@ public okhttp3.Call sendSMSCall(SendSMSRequest payload, final ApiCallback _callb List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -1220,7 +1229,7 @@ public okhttp3.Call sendSMSCall(SendSMSRequest payload, final ApiCallback _callb localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/src/main/java/com/telstra/messaging/OAuthResponse.java b/src/main/java/com/telstra/messaging/OAuthResponse.java deleted file mode 100755 index 1b081bd..0000000 --- a/src/main/java/com/telstra/messaging/OAuthResponse.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * OAuthResponse - */ - -public class OAuthResponse { - public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; - @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) - private String accessToken; - - public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type"; - @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) - private String tokenType; - - public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; - @SerializedName(SERIALIZED_NAME_EXPIRES_IN) - private String expiresIn; - - - public OAuthResponse accessToken(String accessToken) { - - this.accessToken = accessToken; - return this; - } - - /** - * OAuth access token - * @return accessToken - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "OAuth access token") - - public String getAccessToken() { - return accessToken; - } - - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - - public OAuthResponse tokenType(String tokenType) { - - this.tokenType = tokenType; - return this; - } - - /** - * OAuth token type - * @return tokenType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "OAuth token type") - - public String getTokenType() { - return tokenType; - } - - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - - public OAuthResponse expiresIn(String expiresIn) { - - this.expiresIn = expiresIn; - return this; - } - - /** - * OAuth expiry time - * @return expiresIn - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "OAuth expiry time") - - public String getExpiresIn() { - return expiresIn; - } - - - public void setExpiresIn(String expiresIn) { - this.expiresIn = expiresIn; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthResponse oauthResponse = (OAuthResponse) o; - return Objects.equals(this.accessToken, oauthResponse.accessToken) && - Objects.equals(this.tokenType, oauthResponse.tokenType) && - Objects.equals(this.expiresIn, oauthResponse.expiresIn); - } - - @Override - public int hashCode() { - return Objects.hash(accessToken, tokenType, expiresIn); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthResponse {\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/OutboundPollResponse.java b/src/main/java/com/telstra/messaging/OutboundPollResponse.java deleted file mode 100755 index 9ec9a1a..0000000 --- a/src/main/java/com/telstra/messaging/OutboundPollResponse.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.Status; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * OutboundPollResponse - */ - -public class OutboundPollResponse { - public static final String SERIALIZED_NAME_TO = "to"; - @SerializedName(SERIALIZED_NAME_TO) - private String to; - - public static final String SERIALIZED_NAME_SENT_TIMESTAMP = "sentTimestamp"; - @SerializedName(SERIALIZED_NAME_SENT_TIMESTAMP) - private String sentTimestamp; - - public static final String SERIALIZED_NAME_RECEIVED_TIMESTAMP = "receivedTimestamp"; - @SerializedName(SERIALIZED_NAME_RECEIVED_TIMESTAMP) - private String receivedTimestamp; - - public static final String SERIALIZED_NAME_DELIVERY_STATUS = "deliveryStatus"; - @SerializedName(SERIALIZED_NAME_DELIVERY_STATUS) - private Status deliveryStatus; - - - public OutboundPollResponse to(String to) { - - this.to = to; - return this; - } - - /** - * The phone number (recipient) the message was sent to (in E.164 format). - * @return to - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "+61418123456", value = "The phone number (recipient) the message was sent to (in E.164 format). ") - - public String getTo() { - return to; - } - - - public void setTo(String to) { - this.to = to; - } - - - public OutboundPollResponse sentTimestamp(String sentTimestamp) { - - this.sentTimestamp = sentTimestamp; - return this; - } - - /** - * The date and time when the message was sent. - * @return sentTimestamp - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "2017-03-17T09:16:49+10:00", value = "The date and time when the message was sent.") - - public String getSentTimestamp() { - return sentTimestamp; - } - - - public void setSentTimestamp(String sentTimestamp) { - this.sentTimestamp = sentTimestamp; - } - - - public OutboundPollResponse receivedTimestamp(String receivedTimestamp) { - - this.receivedTimestamp = receivedTimestamp; - return this; - } - - /** - * The date and time when the message was recieved by recipient. - * @return receivedTimestamp - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "2017-03-17T09:16:50+10:00", value = "The date and time when the message was recieved by recipient.") - - public String getReceivedTimestamp() { - return receivedTimestamp; - } - - - public void setReceivedTimestamp(String receivedTimestamp) { - this.receivedTimestamp = receivedTimestamp; - } - - - public OutboundPollResponse deliveryStatus(Status deliveryStatus) { - - this.deliveryStatus = deliveryStatus; - return this; - } - - /** - * Get deliveryStatus - * @return deliveryStatus - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Status getDeliveryStatus() { - return deliveryStatus; - } - - - public void setDeliveryStatus(Status deliveryStatus) { - this.deliveryStatus = deliveryStatus; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OutboundPollResponse outboundPollResponse = (OutboundPollResponse) o; - return Objects.equals(this.to, outboundPollResponse.to) && - Objects.equals(this.sentTimestamp, outboundPollResponse.sentTimestamp) && - Objects.equals(this.receivedTimestamp, outboundPollResponse.receivedTimestamp) && - Objects.equals(this.deliveryStatus, outboundPollResponse.deliveryStatus); - } - - @Override - public int hashCode() { - return Objects.hash(to, sentTimestamp, receivedTimestamp, deliveryStatus); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OutboundPollResponse {\n"); - sb.append(" to: ").append(toIndentedString(to)).append("\n"); - sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); - sb.append(" receivedTimestamp: ").append(toIndentedString(receivedTimestamp)).append("\n"); - sb.append(" deliveryStatus: ").append(toIndentedString(deliveryStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java b/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java deleted file mode 100755 index 39900aa..0000000 --- a/src/main/java/com/telstra/messaging/ProvisionNumberRequest.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -/** - * ProvisionNumberRequest - */ - -public class ProvisionNumberRequest { - public static final String SERIALIZED_NAME_ACTIVE_DAYS = "activeDays"; - @SerializedName(SERIALIZED_NAME_ACTIVE_DAYS) - private Integer activeDays; - - public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; - @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) - private String notifyURL; - - - public ProvisionNumberRequest activeDays(Integer activeDays) { - - this.activeDays = activeDays; - return this; - } - - /** - * The number of days before for which this number is provisioned. - * @return activeDays - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "20", value = "The number of days before for which this number is provisioned. ") - - public Integer getActiveDays() { - return activeDays; - } - - - public void setActiveDays(Integer activeDays) { - this.activeDays = activeDays; - } - - - public ProvisionNumberRequest notifyURL(String notifyURL) { - - this.notifyURL = notifyURL; - return this; - } - - /** - * A notification URL that will be POSTed to whenever a new message (i.e. 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. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). *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.* - * @return notifyURL - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "http://wwww.example.com/", value = "A notification URL that will be POSTed to whenever a new message (i.e. 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. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). *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.* ") - - public String getNotifyURL() { - return notifyURL; - } - - - public void setNotifyURL(String notifyURL) { - this.notifyURL = notifyURL; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProvisionNumberRequest provisionNumberRequest = (ProvisionNumberRequest) o; - return Objects.equals(this.activeDays, provisionNumberRequest.activeDays) && - Objects.equals(this.notifyURL, provisionNumberRequest.notifyURL); - } - - @Override - public int hashCode() { - return Objects.hash(activeDays, notifyURL); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProvisionNumberRequest {\n"); - sb.append(" activeDays: ").append(toIndentedString(activeDays)).append("\n"); - sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java b/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java deleted file mode 100755 index dabcd12..0000000 --- a/src/main/java/com/telstra/messaging/ProvisionNumberResponse.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; - -/** - * ProvisionNumberResponse - */ - -public class ProvisionNumberResponse { - public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) - private String destinationAddress; - - public static final String SERIALIZED_NAME_EXPIRY_DATE = "expiryDate"; - @SerializedName(SERIALIZED_NAME_EXPIRY_DATE) - private BigDecimal expiryDate; - - - public ProvisionNumberResponse destinationAddress(String destinationAddress) { - - this.destinationAddress = destinationAddress; - return this; - } - - /** - * The mobile phone number that was allocated - * @return destinationAddress - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "+61412345678", value = "The mobile phone number that was allocated") - - public String getDestinationAddress() { - return destinationAddress; - } - - - public void setDestinationAddress(String destinationAddress) { - this.destinationAddress = destinationAddress; - } - - - public ProvisionNumberResponse expiryDate(BigDecimal expiryDate) { - - this.expiryDate = expiryDate; - return this; - } - - /** - * Free Trial apps can only add activeDays for their provisioned number every 30 days. This is in Unix time format. - * @return expiryDate - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1534463077362", value = "Free Trial apps can only add activeDays for their provisioned number every 30 days. This is in Unix time format.") - - public BigDecimal getExpiryDate() { - return expiryDate; - } - - - public void setExpiryDate(BigDecimal expiryDate) { - this.expiryDate = expiryDate; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProvisionNumberResponse provisionNumberResponse = (ProvisionNumberResponse) o; - return Objects.equals(this.destinationAddress, provisionNumberResponse.destinationAddress) && - Objects.equals(this.expiryDate, provisionNumberResponse.expiryDate); - } - - @Override - public int hashCode() { - return Objects.hash(destinationAddress, expiryDate); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProvisionNumberResponse {\n"); - sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); - sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/ProvisioningApi.java b/src/main/java/com/telstra/messaging/ProvisioningApi.java index 33452f7..27128b5 100755 --- a/src/main/java/com/telstra/messaging/ProvisioningApi.java +++ b/src/main/java/com/telstra/messaging/ProvisioningApi.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -27,10 +27,10 @@ import java.io.IOException; -import com.telstra.messaging.DeleteNumberRequest; -import com.telstra.messaging.GetSubscriptionResponse; -import com.telstra.messaging.ProvisionNumberRequest; -import com.telstra.messaging.ProvisionNumberResponse; +import com.telstra.models.DeleteNumberRequest; +import com.telstra.models.GetSubscriptionResponse; +import com.telstra.models.ProvisionNumberRequest; +import com.telstra.models.ProvisionNumberResponse; import java.lang.reflect.Type; import java.util.ArrayList; @@ -85,6 +85,7 @@ public okhttp3.Call createSubscriptionCall(ProvisionNumberRequest body, final Ap List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -101,7 +102,7 @@ public okhttp3.Call createSubscriptionCall(ProvisionNumberRequest body, final Ap localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -221,6 +222,7 @@ public okhttp3.Call deleteSubscriptionCall(DeleteNumberRequest body, final ApiCa List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { @@ -237,7 +239,7 @@ public okhttp3.Call deleteSubscriptionCall(DeleteNumberRequest body, final ApiCa localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -349,6 +351,7 @@ public okhttp3.Call getSubscriptionCall(final ApiCallback _callback) throws ApiE List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" @@ -365,7 +368,7 @@ public okhttp3.Call getSubscriptionCall(final ApiCallback _callback) throws ApiE localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/src/main/java/com/telstra/messaging/SendMmsRequest.java b/src/main/java/com/telstra/messaging/SendMmsRequest.java deleted file mode 100755 index 1225926..0000000 --- a/src/main/java/com/telstra/messaging/SendMmsRequest.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.MMSContent; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * SendMmsRequest - */ - -public class SendMmsRequest { - public static final String SERIALIZED_NAME_TO = "to"; - @SerializedName(SERIALIZED_NAME_TO) - private String to; - - public static final String SERIALIZED_NAME_FROM = "from"; - @SerializedName(SERIALIZED_NAME_FROM) - private String from; - - public static final String SERIALIZED_NAME_SUBJECT = "subject"; - @SerializedName(SERIALIZED_NAME_SUBJECT) - private String subject; - - public static final String SERIALIZED_NAME_REPLY_REQUEST = "replyRequest"; - @SerializedName(SERIALIZED_NAME_REPLY_REQUEST) - private Boolean replyRequest; - - public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; - @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) - private String notifyURL; - - public static final String SERIALIZED_NAME_MM_S_CONTENT = "MMSContent"; - @SerializedName(SERIALIZED_NAME_MM_S_CONTENT) - private List mmSContent = new ArrayList(); - - - public SendMmsRequest to(String to) { - - this.to = to; - return this; - } - - /** - * This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] - * @return to - **/ - @ApiModelProperty(example = "", required = true, value = "This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] ") - - public String getTo() { - return to; - } - - - public void setTo(String to) { - this.to = to; - } - - - public SendMmsRequest from(String from) { - - this.from = from; - return this; - } - - /** - * This will be the source address that will be displayed on the receiving device. You can set an Alphanumeric sender ID of up to 11 characters that the MMS was sent from. Phone numbers in the `from` attribute will be blocked (400-error) to prevent number spoofing. Most standard ASCII characters are accepted in the alphanumeric `from` attribute, however there are some limitations. The following limitations and characters are allowed in the alphanumeric `from` attribute; any alphabetic character (e.g. `abc`), any number mixed with alphabetic characters (e.g. `123abc`), uppercase and lowercase characters (e.g. `aBc`), any of the following special characters mixed with alphabetic characters are allowed; `~!@#$%^&*()~_~+-={}|[];'?,./` (e.g. `abc~!@`), any combination of lowercase, uppercase, numeric or allowed special characters (e.g. `abc@#123DE`). All other characters, including spaces and extended ASCII characters, are not allowed (e.g. `<>:\"\\`). If attribute is not present, the service will use the mobile number associated with the application (in E.164 format). If `replyRequest` is set to true, this field should not be present. This feature is only available on Telstra Account paid plans, not through Free Trials or credit card paid plans. *Please note:* *- Alphanumeric sender ID works for domestic, i.e. Australian, destinations only.* *- When Alphanumeric sender ID is used in sending MMS, Delivery Reports will NOT be returned.* - * @return from - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "This will be the source address that will be displayed on the receiving device. You can set an Alphanumeric sender ID of up to 11 characters that the MMS was sent from. Phone numbers in the `from` attribute will be blocked (400-error) to prevent number spoofing. Most standard ASCII characters are accepted in the alphanumeric `from` attribute, however there are some limitations. The following limitations and characters are allowed in the alphanumeric `from` attribute; any alphabetic character (e.g. `abc`), any number mixed with alphabetic characters (e.g. `123abc`), uppercase and lowercase characters (e.g. `aBc`), any of the following special characters mixed with alphabetic characters are allowed; `~!@#$%^&*()~_~+-={}|[];'?,./` (e.g. `abc~!@`), any combination of lowercase, uppercase, numeric or allowed special characters (e.g. `abc@#123DE`). All other characters, including spaces and extended ASCII characters, are not allowed (e.g. `<>:\"\\`). If attribute is not present, the service will use the mobile number associated with the application (in E.164 format). If `replyRequest` is set to true, this field should not be present. This feature is only available on Telstra Account paid plans, not through Free Trials or credit card paid plans. *Please note:* *- Alphanumeric sender ID works for domestic, i.e. Australian, destinations only.* *- When Alphanumeric sender ID is used in sending MMS, Delivery Reports will NOT be returned.* ") - - public String getFrom() { - return from; - } - - - public void setFrom(String from) { - this.from = from; - } - - - public SendMmsRequest subject(String subject) { - - this.subject = subject; - return this; - } - - /** - * The subject that will be used in an MMS message. Subject is limited to maximum of 64 characters. Some special characters need to be encoded if used in the `subject` field (e.g. &amp;amp; for & and &amp;lt; for <). - * @return subject - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The subject that will be used in an MMS message. Subject is limited to maximum of 64 characters. Some special characters need to be encoded if used in the `subject` field (e.g. &amp; for & and &lt; for <). ") - - public String getSubject() { - return subject; - } - - - public void setSubject(String subject) { - this.subject = subject; - } - - - public SendMmsRequest replyRequest(Boolean replyRequest) { - - this.replyRequest = replyRequest; - return this; - } - - /** - * If set to true, the reply message functionality will be implemented. The `from` field should not be present. - * @return replyRequest - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "If set to true, the reply message functionality will be implemented. The `from` field should not be present. ") - - public Boolean getReplyRequest() { - return replyRequest; - } - - - public void setReplyRequest(Boolean replyRequest) { - this.replyRequest = replyRequest; - } - - - public SendMmsRequest notifyURL(String notifyURL) { - - this.notifyURL = notifyURL; - return this; - } - - /** - * Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). - * @return notifyURL - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "http://www.example.com/", value = "Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). ") - - public String getNotifyURL() { - return notifyURL; - } - - - public void setNotifyURL(String notifyURL) { - this.notifyURL = notifyURL; - } - - - public SendMmsRequest mmSContent(List mmSContent) { - - this.mmSContent = mmSContent; - return this; - } - - public SendMmsRequest addMmSContentItem(MMSContent mmSContentItem) { - this.mmSContent.add(mmSContentItem); - return this; - } - - /** - * 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. - * @return mmSContent - **/ - @ApiModelProperty(required = true, value = "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. ") - - public List getMmSContent() { - return mmSContent; - } - - - public void setMmSContent(List mmSContent) { - this.mmSContent = mmSContent; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SendMmsRequest sendMmsRequest = (SendMmsRequest) o; - return Objects.equals(this.to, sendMmsRequest.to) && - Objects.equals(this.from, sendMmsRequest.from) && - Objects.equals(this.subject, sendMmsRequest.subject) && - Objects.equals(this.replyRequest, sendMmsRequest.replyRequest) && - Objects.equals(this.notifyURL, sendMmsRequest.notifyURL) && - Objects.equals(this.mmSContent, sendMmsRequest.mmSContent); - } - - @Override - public int hashCode() { - return Objects.hash(to, from, subject, replyRequest, notifyURL, mmSContent); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SendMmsRequest {\n"); - sb.append(" to: ").append(toIndentedString(to)).append("\n"); - sb.append(" from: ").append(toIndentedString(from)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" replyRequest: ").append(toIndentedString(replyRequest)).append("\n"); - sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); - sb.append(" mmSContent: ").append(toIndentedString(mmSContent)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/SendSmsMultiRequest.java b/src/main/java/com/telstra/messaging/SendSmsMultiRequest.java deleted file mode 100644 index 6a3c596..0000000 --- a/src/main/java/com/telstra/messaging/SendSmsMultiRequest.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.telstra.messaging.MessageMulti; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * SendSmsMultiRequest - */ - -public class SendSmsMultiRequest { - public static final String SERIALIZED_NAME_SMS_MULTI = "smsMulti"; - @SerializedName(SERIALIZED_NAME_SMS_MULTI) - private List smsMulti = null; - - public static final String SERIALIZED_NAME_NOTIY_U_R_L = "notiyURL"; - @SerializedName(SERIALIZED_NAME_NOTIY_U_R_L) - private String notiyURL; - - - public SendSmsMultiRequest smsMulti(List smsMulti) { - - this.smsMulti = smsMulti; - return this; - } - - public SendSmsMultiRequest addSmsMultiItem(MessageMulti smsMultiItem) { - if (this.smsMulti == null) { - this.smsMulti = new ArrayList(); - } - this.smsMulti.add(smsMultiItem); - return this; - } - - /** - * Multiple SMS. Up to 10 messages can be sent in one API call. - * @return smsMulti - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Multiple SMS. Up to 10 messages can be sent in one API call.") - - public List getSmsMulti() { - return smsMulti; - } - - - public void setSmsMulti(List smsMulti) { - this.smsMulti = smsMulti; - } - - - public SendSmsMultiRequest notiyURL(String notiyURL) { - - this.notiyURL = notiyURL; - return this; - } - - /** - * Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). - * @return notiyURL - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "http://www.example.com/", value = "Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). ") - - public String getNotiyURL() { - return notiyURL; - } - - - public void setNotiyURL(String notiyURL) { - this.notiyURL = notiyURL; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SendSmsMultiRequest sendSmsMultiRequest = (SendSmsMultiRequest) o; - return Objects.equals(this.smsMulti, sendSmsMultiRequest.smsMulti) && - Objects.equals(this.notiyURL, sendSmsMultiRequest.notiyURL); - } - - @Override - public int hashCode() { - return Objects.hash(smsMulti, notiyURL); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SendSmsMultiRequest {\n"); - sb.append(" smsMulti: ").append(toIndentedString(smsMulti)).append("\n"); - sb.append(" notiyURL: ").append(toIndentedString(notiyURL)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/src/main/java/com/telstra/messaging/Status.java b/src/main/java/com/telstra/messaging/Status.java deleted file mode 100755 index 8a30d03..0000000 --- a/src/main/java/com/telstra/messaging/Status.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) - * - * The version of the OpenAPI document: 2.2.9 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.telstra.messaging; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Gets or Sets Status - */ -@JsonAdapter(Status.Adapter.class) -public enum Status { - - PEND("PEND"), - - SENT("SENT"), - - DELIVRD("DELIVRD"), - - EXPIRED("EXPIRED"), - - DELETED("DELETED"), - - UNDVBL("UNDVBL"), - - REJECTD("REJECTD"), - - UNKNOWN("Unknown"); - - private String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Status fromValue(String value) { - for (Status b : Status.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Status enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Status read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Status.fromValue(value); - } - } -} - diff --git a/src/main/java/com/telstra/models/DeleteNumberRequest.java b/src/main/java/com/telstra/models/DeleteNumberRequest.java new file mode 100644 index 0000000..e8d087f --- /dev/null +++ b/src/main/java/com/telstra/models/DeleteNumberRequest.java @@ -0,0 +1,99 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DeleteNumberRequest + */ + +public class DeleteNumberRequest { + public static final String SERIALIZED_NAME_EMPTY_ARR = "emptyArr"; + @SerializedName(SERIALIZED_NAME_EMPTY_ARR) + private Integer emptyArr = 0; + + + public DeleteNumberRequest emptyArr(Integer emptyArr) { + + this.emptyArr = emptyArr; + return this; + } + + /** + * Empty Arr + * @return emptyArr + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Empty Arr") + + public Integer getEmptyArr() { + return emptyArr; + } + + + public void setEmptyArr(Integer emptyArr) { + this.emptyArr = emptyArr; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteNumberRequest deleteNumberRequest = (DeleteNumberRequest) o; + return Objects.equals(this.emptyArr, deleteNumberRequest.emptyArr); + } + + @Override + public int hashCode() { + return Objects.hash(emptyArr); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteNumberRequest {\n"); + sb.append(" emptyArr: ").append(toIndentedString(emptyArr)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/GetMmsResponse.java b/src/main/java/com/telstra/models/GetMmsResponse.java new file mode 100644 index 0000000..50d2500 --- /dev/null +++ b/src/main/java/com/telstra/models/GetMmsResponse.java @@ -0,0 +1,305 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.MMSContent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * GetMmsResponse + */ + +public class GetMmsResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; + @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) + private String destinationAddress; + + public static final String SERIALIZED_NAME_SENDER_ADDRESS = "senderAddress"; + @SerializedName(SERIALIZED_NAME_SENDER_ADDRESS) + private String senderAddress; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + private String subject; + + public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; + @SerializedName(SERIALIZED_NAME_MESSAGE_ID) + private String messageId; + + public static final String SERIALIZED_NAME_API_MSG_ID = "apiMsgId"; + @SerializedName(SERIALIZED_NAME_API_MSG_ID) + private String apiMsgId; + + public static final String SERIALIZED_NAME_SENT_TIMESTAMP = "sentTimestamp"; + @SerializedName(SERIALIZED_NAME_SENT_TIMESTAMP) + private String sentTimestamp; + + public static final String SERIALIZED_NAME_MM_S_CONTENT = "MMSContent"; + @SerializedName(SERIALIZED_NAME_MM_S_CONTENT) + private List mmSContent = new ArrayList(); + + + public GetMmsResponse status(String status) { + + this.status = status; + return this; + } + + /** + * The final state of the message. + * @return status + **/ + @ApiModelProperty(example = "RECEIVED", required = true, value = "The final state of the message. ") + + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public GetMmsResponse destinationAddress(String destinationAddress) { + + this.destinationAddress = destinationAddress; + return this; + } + + /** + * The number the message was sent to. + * @return destinationAddress + **/ + @ApiModelProperty(example = "61412345678", required = true, value = "The number the message was sent to. ") + + public String getDestinationAddress() { + return destinationAddress; + } + + + public void setDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + } + + + public GetMmsResponse senderAddress(String senderAddress) { + + this.senderAddress = senderAddress; + return this; + } + + /** + * The number the message was sent from. + * @return senderAddress + **/ + @ApiModelProperty(example = "61487654321", required = true, value = "The number the message was sent from. ") + + public String getSenderAddress() { + return senderAddress; + } + + + public void setSenderAddress(String senderAddress) { + this.senderAddress = senderAddress; + } + + + public GetMmsResponse subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * The subject assigned to the message. + * @return subject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The subject assigned to the message. ") + + public String getSubject() { + return subject; + } + + + public void setSubject(String subject) { + this.subject = subject; + } + + + public GetMmsResponse messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message Id assigned by the MMSC. + * @return messageId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message Id assigned by the MMSC. ") + + public String getMessageId() { + return messageId; + } + + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public GetMmsResponse apiMsgId(String apiMsgId) { + + this.apiMsgId = apiMsgId; + return this; + } + + /** + * Message Id assigned by the API. + * @return apiMsgId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message Id assigned by the API. ") + + public String getApiMsgId() { + return apiMsgId; + } + + + public void setApiMsgId(String apiMsgId) { + this.apiMsgId = apiMsgId; + } + + + public GetMmsResponse sentTimestamp(String sentTimestamp) { + + this.sentTimestamp = sentTimestamp; + return this; + } + + /** + * Time handling of the message ended. + * @return sentTimestamp + **/ + @ApiModelProperty(example = "2018-11-23T16:14:02+10:00", required = true, value = "Time handling of the message ended. ") + + public String getSentTimestamp() { + return sentTimestamp; + } + + + public void setSentTimestamp(String sentTimestamp) { + this.sentTimestamp = sentTimestamp; + } + + + public GetMmsResponse mmSContent(List mmSContent) { + + this.mmSContent = mmSContent; + return this; + } + + public GetMmsResponse addMmSContentItem(MMSContent mmSContentItem) { + this.mmSContent.add(mmSContentItem); + return this; + } + + /** + * An array of content that was received in an MMS message. + * @return mmSContent + **/ + @ApiModelProperty(required = true, value = "An array of content that was received in an MMS message. ") + + public List getMmSContent() { + return mmSContent; + } + + + public void setMmSContent(List mmSContent) { + this.mmSContent = mmSContent; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMmsResponse getMmsResponse = (GetMmsResponse) o; + return Objects.equals(this.status, getMmsResponse.status) && + Objects.equals(this.destinationAddress, getMmsResponse.destinationAddress) && + Objects.equals(this.senderAddress, getMmsResponse.senderAddress) && + Objects.equals(this.subject, getMmsResponse.subject) && + Objects.equals(this.messageId, getMmsResponse.messageId) && + Objects.equals(this.apiMsgId, getMmsResponse.apiMsgId) && + Objects.equals(this.sentTimestamp, getMmsResponse.sentTimestamp) && + Objects.equals(this.mmSContent, getMmsResponse.mmSContent); + } + + @Override + public int hashCode() { + return Objects.hash(status, destinationAddress, senderAddress, subject, messageId, apiMsgId, sentTimestamp, mmSContent); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMmsResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); + sb.append(" senderAddress: ").append(toIndentedString(senderAddress)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" apiMsgId: ").append(toIndentedString(apiMsgId)).append("\n"); + sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); + sb.append(" mmSContent: ").append(toIndentedString(mmSContent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/GetSubscriptionResponse.java b/src/main/java/com/telstra/models/GetSubscriptionResponse.java new file mode 100644 index 0000000..11d2494 --- /dev/null +++ b/src/main/java/com/telstra/models/GetSubscriptionResponse.java @@ -0,0 +1,157 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * GetSubscriptionResponse + */ + +public class GetSubscriptionResponse { + public static final String SERIALIZED_NAME_ACTIVE_DAYS = "activeDays"; + @SerializedName(SERIALIZED_NAME_ACTIVE_DAYS) + private String activeDays; + + public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; + @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) + private String notifyURL; + + public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; + @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) + private String destinationAddress; + + + public GetSubscriptionResponse activeDays(String activeDays) { + + this.activeDays = activeDays; + return this; + } + + /** + * Number of active days + * @return activeDays + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Number of active days") + + public String getActiveDays() { + return activeDays; + } + + + public void setActiveDays(String activeDays) { + this.activeDays = activeDays; + } + + + public GetSubscriptionResponse notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * Notify url configured + * @return notifyURL + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Notify url configured") + + public String getNotifyURL() { + return notifyURL; + } + + + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + public GetSubscriptionResponse destinationAddress(String destinationAddress) { + + this.destinationAddress = destinationAddress; + return this; + } + + /** + * The mobile phone number that was allocated + * @return destinationAddress + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The mobile phone number that was allocated") + + public String getDestinationAddress() { + return destinationAddress; + } + + + public void setDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubscriptionResponse getSubscriptionResponse = (GetSubscriptionResponse) o; + return Objects.equals(this.activeDays, getSubscriptionResponse.activeDays) && + Objects.equals(this.notifyURL, getSubscriptionResponse.notifyURL) && + Objects.equals(this.destinationAddress, getSubscriptionResponse.destinationAddress); + } + + @Override + public int hashCode() { + return Objects.hash(activeDays, notifyURL, destinationAddress); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptionResponse {\n"); + sb.append(" activeDays: ").append(toIndentedString(activeDays)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/HealthCheckResponse.java b/src/main/java/com/telstra/models/HealthCheckResponse.java new file mode 100644 index 0000000..585f740 --- /dev/null +++ b/src/main/java/com/telstra/models/HealthCheckResponse.java @@ -0,0 +1,100 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Information regarding service being up or down. + */ +@ApiModel(description = "Information regarding service being up or down. ") + +public class HealthCheckResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + + public HealthCheckResponse status(String status) { + + this.status = status; + return this; + } + + /** + * message status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "up", value = "message status") + + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResponse healthCheckResponse = (HealthCheckResponse) o; + return Objects.equals(this.status, healthCheckResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/InboundPollResponse.java b/src/main/java/com/telstra/models/InboundPollResponse.java new file mode 100644 index 0000000..5b57214 --- /dev/null +++ b/src/main/java/com/telstra/models/InboundPollResponse.java @@ -0,0 +1,245 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. + */ +@ApiModel(description = "Poll for incoming messages returning the latest. Only works if no callback url was specified when provisioning a number. ") + +public class InboundPollResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; + @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) + private String destinationAddress; + + public static final String SERIALIZED_NAME_SENDER_ADDRESS = "senderAddress"; + @SerializedName(SERIALIZED_NAME_SENDER_ADDRESS) + private String senderAddress; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; + @SerializedName(SERIALIZED_NAME_MESSAGE_ID) + private String messageId; + + public static final String SERIALIZED_NAME_SENT_TIMESTAMP = "sentTimestamp"; + @SerializedName(SERIALIZED_NAME_SENT_TIMESTAMP) + private String sentTimestamp; + + + public InboundPollResponse status(String status) { + + this.status = status; + return this; + } + + /** + * message status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "message status") + + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public InboundPollResponse destinationAddress(String destinationAddress) { + + this.destinationAddress = destinationAddress; + return this; + } + + /** + * The phone number (recipient) that the message was sent to (in E.164 format). + * @return destinationAddress + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The phone number (recipient) that the message was sent to (in E.164 format). ") + + public String getDestinationAddress() { + return destinationAddress; + } + + + public void setDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + } + + + public InboundPollResponse senderAddress(String senderAddress) { + + this.senderAddress = senderAddress; + return this; + } + + /** + * The phone number (sender) that the message was sent from (in E.164 format). + * @return senderAddress + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The phone number (sender) that the message was sent from (in E.164 format). ") + + public String getSenderAddress() { + return senderAddress; + } + + + public void setSenderAddress(String senderAddress) { + this.senderAddress = senderAddress; + } + + + public InboundPollResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Text of the message that was sent + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Text of the message that was sent") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public InboundPollResponse messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * Message Id + * @return messageId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Message Id") + + public String getMessageId() { + return messageId; + } + + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public InboundPollResponse sentTimestamp(String sentTimestamp) { + + this.sentTimestamp = sentTimestamp; + return this; + } + + /** + * The date and time when the message was sent by recipient. + * @return sentTimestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The date and time when the message was sent by recipient.") + + public String getSentTimestamp() { + return sentTimestamp; + } + + + public void setSentTimestamp(String sentTimestamp) { + this.sentTimestamp = sentTimestamp; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InboundPollResponse inboundPollResponse = (InboundPollResponse) o; + return Objects.equals(this.status, inboundPollResponse.status) && + Objects.equals(this.destinationAddress, inboundPollResponse.destinationAddress) && + Objects.equals(this.senderAddress, inboundPollResponse.senderAddress) && + Objects.equals(this.message, inboundPollResponse.message) && + Objects.equals(this.messageId, inboundPollResponse.messageId) && + Objects.equals(this.sentTimestamp, inboundPollResponse.sentTimestamp); + } + + @Override + public int hashCode() { + return Objects.hash(status, destinationAddress, senderAddress, message, messageId, sentTimestamp); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InboundPollResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); + sb.append(" senderAddress: ").append(toIndentedString(senderAddress)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/MMSContent.java b/src/main/java/com/telstra/models/MMSContent.java new file mode 100644 index 0000000..2449f5d --- /dev/null +++ b/src/main/java/com/telstra/models/MMSContent.java @@ -0,0 +1,154 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * MMSContent + */ + +public class MMSContent { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_FILENAME = "filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + private String filename; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + + public MMSContent type(String type) { + + this.type = type; + return this; + } + + /** + * The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar + * @return type + **/ + @ApiModelProperty(required = true, value = "The following types are supported audio/amr audio/aac audio/mp3 audio/mpeg3 audio/mpeg audio/mpg audio/wav audio/3gpp audio/mp4 image/gif image/jpeg image/jpg image/png image/bmp video/mpeg4 video/mp4 video/mpeg video/3gpp video/3gp video/h263 text/plain text/x-vCard text/x-vCalendar ") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public MMSContent filename(String filename) { + + this.filename = filename; + return this; + } + + /** + * The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. + * @return filename + **/ + @ApiModelProperty(required = true, value = "The file name to be associated with the content. Some devices will display this file name with a placeholder for the content. ") + + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public MMSContent payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Base64 encoded message content. + * @return payload + **/ + @ApiModelProperty(required = true, value = "Base64 encoded message content. ") + + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MMSContent mmSContent = (MMSContent) o; + return Objects.equals(this.type, mmSContent.type) && + Objects.equals(this.filename, mmSContent.filename) && + Objects.equals(this.payload, mmSContent.payload); + } + + @Override + public int hashCode() { + return Objects.hash(type, filename, payload); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MMSContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/Message.java b/src/main/java/com/telstra/models/Message.java new file mode 100644 index 0000000..ad4a346 --- /dev/null +++ b/src/main/java/com/telstra/models/Message.java @@ -0,0 +1,183 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Message + */ + +public class Message { + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_DELIVERY_STATUS = "deliveryStatus"; + @SerializedName(SERIALIZED_NAME_DELIVERY_STATUS) + private String deliveryStatus; + + public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; + @SerializedName(SERIALIZED_NAME_MESSAGE_ID) + private String messageId; + + public static final String SERIALIZED_NAME_MESSAGE_STATUS_U_R_L = "messageStatusURL"; + @SerializedName(SERIALIZED_NAME_MESSAGE_STATUS_U_R_L) + private String messageStatusURL; + + + public Message to(String to) { + + this.to = to; + return this; + } + + /** + * Just a copy of the number the message is sent to. + * @return to + **/ + @ApiModelProperty(example = "+61412345678", required = true, value = "Just a copy of the number the message is sent to.") + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Message deliveryStatus(String deliveryStatus) { + + this.deliveryStatus = deliveryStatus; + return this; + } + + /** + * Gives an indication if the message has been accepted for delivery. The description field contains information on why a message may have been rejected. + * @return deliveryStatus + **/ + @ApiModelProperty(example = "MessageWaiting", required = true, value = "Gives an indication if the message has been accepted for delivery. The description field contains information on why a message may have been rejected. ") + + public String getDeliveryStatus() { + return deliveryStatus; + } + + + public void setDeliveryStatus(String deliveryStatus) { + this.deliveryStatus = deliveryStatus; + } + + + public Message messageId(String messageId) { + + this.messageId = messageId; + return this; + } + + /** + * 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 `messageId` will be different for each number that the message was sent to. + * @return messageId + **/ + @ApiModelProperty(example = "d997474900097a1f0000000008d7e18102cc0901-1261412345678", required = true, value = "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 `messageId` will be different for each number that the message was sent to. ") + + public String getMessageId() { + return messageId; + } + + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + + public Message messageStatusURL(String messageStatusURL) { + + this.messageStatusURL = messageStatusURL; + return this; + } + + /** + * 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. + * @return messageStatusURL + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "https://tapi.telstra.com/v2/messages/sms/d997474900097a1f0000000008d7e18102cc0901-1261412345678/status ", value = "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. ") + + public String getMessageStatusURL() { + return messageStatusURL; + } + + + public void setMessageStatusURL(String messageStatusURL) { + this.messageStatusURL = messageStatusURL; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Message message = (Message) o; + return Objects.equals(this.to, message.to) && + Objects.equals(this.deliveryStatus, message.deliveryStatus) && + Objects.equals(this.messageId, message.messageId) && + Objects.equals(this.messageStatusURL, message.messageStatusURL); + } + + @Override + public int hashCode() { + return Objects.hash(to, deliveryStatus, messageId, messageStatusURL); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Message {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" deliveryStatus: ").append(toIndentedString(deliveryStatus)).append("\n"); + sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n"); + sb.append(" messageStatusURL: ").append(toIndentedString(messageStatusURL)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/MessageMulti.java b/src/main/java/com/telstra/models/MessageMulti.java new file mode 100644 index 0000000..be816be --- /dev/null +++ b/src/main/java/com/telstra/models/MessageMulti.java @@ -0,0 +1,157 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * MessageMulti + */ + +public class MessageMulti { + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_BODY = "body"; + @SerializedName(SERIALIZED_NAME_BODY) + private String body; + + public static final String SERIALIZED_NAME_RECEIPT_OFF = "receiptOff"; + @SerializedName(SERIALIZED_NAME_RECEIPT_OFF) + private Boolean receiptOff; + + + public MessageMulti to(String to) { + + this.to = to; + return this; + } + + /** + * Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. + * @return to + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "+61412345678", value = "Phone number (in E.164 format) to send the SMS to. This number can be in international format `\"to\": \"+61412345678\"` or in national format. ") + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public MessageMulti body(String body) { + + this.body = body; + return this; + } + + /** + * 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 + * @return body + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Test Message", value = "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 ") + + public String getBody() { + return body; + } + + + public void setBody(String body) { + this.body = body; + } + + + public MessageMulti receiptOff(Boolean receiptOff) { + + this.receiptOff = receiptOff; + return this; + } + + /** + * Whether Delivery Receipt will be sent back or not. Setting this field to `true` will disable Delivery Receipts. The `notifyURL` field will be ignored, if there is one in the payload. An \"OLD-NONEXISTANT-MESSAGE-ID\" 400 error will also be returned upon Polling for the SMS Status. + * @return receiptOff + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "Whether Delivery Receipt will be sent back or not. Setting this field to `true` will disable Delivery Receipts. The `notifyURL` field will be ignored, if there is one in the payload. An \"OLD-NONEXISTANT-MESSAGE-ID\" 400 error will also be returned upon Polling for the SMS Status. ") + + public Boolean getReceiptOff() { + return receiptOff; + } + + + public void setReceiptOff(Boolean receiptOff) { + this.receiptOff = receiptOff; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageMulti messageMulti = (MessageMulti) o; + return Objects.equals(this.to, messageMulti.to) && + Objects.equals(this.body, messageMulti.body) && + Objects.equals(this.receiptOff, messageMulti.receiptOff); + } + + @Override + public int hashCode() { + return Objects.hash(to, body, receiptOff); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageMulti {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" receiptOff: ").append(toIndentedString(receiptOff)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/MessageSentResponseMms.java b/src/main/java/com/telstra/models/MessageSentResponseMms.java new file mode 100644 index 0000000..b6f7920 --- /dev/null +++ b/src/main/java/com/telstra/models/MessageSentResponseMms.java @@ -0,0 +1,228 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.Message; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * MessageSentResponseMms + */ + +public class MessageSentResponseMms { + public static final String SERIALIZED_NAME_MESSAGES = "messages"; + @SerializedName(SERIALIZED_NAME_MESSAGES) + private List messages = new ArrayList(); + + public static final String SERIALIZED_NAME_MMS_MEDIA_K_B = "MmsMediaKB"; + @SerializedName(SERIALIZED_NAME_MMS_MEDIA_K_B) + private Integer mmsMediaKB; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private List country = null; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_NUMBER_SEGMENTS = "numberSegments"; + @SerializedName(SERIALIZED_NAME_NUMBER_SEGMENTS) + private Integer numberSegments; + + + public MessageSentResponseMms messages(List messages) { + + this.messages = messages; + return this; + } + + public MessageSentResponseMms addMessagesItem(Message messagesItem) { + this.messages.add(messagesItem); + return this; + } + + /** + * An array of messages. + * @return messages + **/ + @ApiModelProperty(required = true, value = "An array of messages.") + + public List getMessages() { + return messages; + } + + + public void setMessages(List messages) { + this.messages = messages; + } + + + public MessageSentResponseMms mmsMediaKB(Integer mmsMediaKB) { + + this.mmsMediaKB = mmsMediaKB; + return this; + } + + /** + * Indicates the message size in kB of the MMS sent. + * @return mmsMediaKB + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2", value = "Indicates the message size in kB of the MMS sent. ") + + public Integer getMmsMediaKB() { + return mmsMediaKB; + } + + + public void setMmsMediaKB(Integer mmsMediaKB) { + this.mmsMediaKB = mmsMediaKB; + } + + + public MessageSentResponseMms country(List country) { + + this.country = country; + return this; + } + + public MessageSentResponseMms addCountryItem(Object countryItem) { + if (this.country == null) { + this.country = new ArrayList(); + } + this.country.add(countryItem); + return this; + } + + /** + * An array of the countries to which the destination MSISDNs belong. + * @return country + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "[{AUS=1}]", value = "An array of the countries to which the destination MSISDNs belong.") + + public List getCountry() { + return country; + } + + + public void setCountry(List country) { + this.country = country; + } + + + public MessageSentResponseMms messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * This returns whether the message sent was a SMS or MMS. + * @return messageType + **/ + @ApiModelProperty(example = "MMS", required = true, value = "This returns whether the message sent was a SMS or MMS.") + + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public MessageSentResponseMms numberSegments(Integer numberSegments) { + + this.numberSegments = numberSegments; + return this; + } + + /** + * MMS with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. + * @return numberSegments + **/ + @ApiModelProperty(example = "4", required = true, value = "MMS with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. ") + + public Integer getNumberSegments() { + return numberSegments; + } + + + public void setNumberSegments(Integer numberSegments) { + this.numberSegments = numberSegments; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageSentResponseMms messageSentResponseMms = (MessageSentResponseMms) o; + return Objects.equals(this.messages, messageSentResponseMms.messages) && + Objects.equals(this.mmsMediaKB, messageSentResponseMms.mmsMediaKB) && + Objects.equals(this.country, messageSentResponseMms.country) && + Objects.equals(this.messageType, messageSentResponseMms.messageType) && + Objects.equals(this.numberSegments, messageSentResponseMms.numberSegments); + } + + @Override + public int hashCode() { + return Objects.hash(messages, mmsMediaKB, country, messageType, numberSegments); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageSentResponseMms {\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" mmsMediaKB: ").append(toIndentedString(mmsMediaKB)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" numberSegments: ").append(toIndentedString(numberSegments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/MessageSentResponseSms.java b/src/main/java/com/telstra/models/MessageSentResponseSms.java new file mode 100644 index 0000000..6946156 --- /dev/null +++ b/src/main/java/com/telstra/models/MessageSentResponseSms.java @@ -0,0 +1,199 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.Message; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * MessageSentResponseSms + */ + +public class MessageSentResponseSms { + public static final String SERIALIZED_NAME_MESSAGES = "messages"; + @SerializedName(SERIALIZED_NAME_MESSAGES) + private List messages = new ArrayList(); + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private List country = null; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_NUMBER_SEGMENTS = "numberSegments"; + @SerializedName(SERIALIZED_NAME_NUMBER_SEGMENTS) + private Integer numberSegments; + + + public MessageSentResponseSms messages(List messages) { + + this.messages = messages; + return this; + } + + public MessageSentResponseSms addMessagesItem(Message messagesItem) { + this.messages.add(messagesItem); + return this; + } + + /** + * An array of messages. + * @return messages + **/ + @ApiModelProperty(required = true, value = "An array of messages.") + + public List getMessages() { + return messages; + } + + + public void setMessages(List messages) { + this.messages = messages; + } + + + public MessageSentResponseSms country(List country) { + + this.country = country; + return this; + } + + public MessageSentResponseSms addCountryItem(Object countryItem) { + if (this.country == null) { + this.country = new ArrayList(); + } + this.country.add(countryItem); + return this; + } + + /** + * An array of the countries to which the destination MSISDNs belong. + * @return country + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "[{AUS=1}]", value = "An array of the countries to which the destination MSISDNs belong.") + + public List getCountry() { + return country; + } + + + public void setCountry(List country) { + this.country = country; + } + + + public MessageSentResponseSms messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * This returns whether the message sent was a SMS or MMS. + * @return messageType + **/ + @ApiModelProperty(example = "SMS", required = true, value = "This returns whether the message sent was a SMS or MMS.") + + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public MessageSentResponseSms numberSegments(Integer numberSegments) { + + this.numberSegments = numberSegments; + return this; + } + + /** + * A message which has 160 GSM-7 characters or less will have numberSegments=1. Note that multi-part messages which are over 160 GSM-7 characters will include the User Data Header as part of the numberSegments. The User Data Header is being used for the re-assembly of the messages. + * @return numberSegments + **/ + @ApiModelProperty(example = "1", required = true, value = "A message which has 160 GSM-7 characters or less will have numberSegments=1. Note that multi-part messages which are over 160 GSM-7 characters will include the User Data Header as part of the numberSegments. The User Data Header is being used for the re-assembly of the messages. ") + + public Integer getNumberSegments() { + return numberSegments; + } + + + public void setNumberSegments(Integer numberSegments) { + this.numberSegments = numberSegments; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageSentResponseSms messageSentResponseSms = (MessageSentResponseSms) o; + return Objects.equals(this.messages, messageSentResponseSms.messages) && + Objects.equals(this.country, messageSentResponseSms.country) && + Objects.equals(this.messageType, messageSentResponseSms.messageType) && + Objects.equals(this.numberSegments, messageSentResponseSms.numberSegments); + } + + @Override + public int hashCode() { + return Objects.hash(messages, country, messageType, numberSegments); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageSentResponseSms {\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" numberSegments: ").append(toIndentedString(numberSegments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/OAuthResponse.java b/src/main/java/com/telstra/models/OAuthResponse.java new file mode 100644 index 0000000..60b64a0 --- /dev/null +++ b/src/main/java/com/telstra/models/OAuthResponse.java @@ -0,0 +1,157 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * OAuthResponse + */ + +public class OAuthResponse { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + private String accessToken; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + private String tokenType; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + private String expiresIn; + + + public OAuthResponse accessToken(String accessToken) { + + this.accessToken = accessToken; + return this; + } + + /** + * OAuth access token + * @return accessToken + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "OAuth access token") + + public String getAccessToken() { + return accessToken; + } + + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + + public OAuthResponse tokenType(String tokenType) { + + this.tokenType = tokenType; + return this; + } + + /** + * OAuth token type + * @return tokenType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "OAuth token type") + + public String getTokenType() { + return tokenType; + } + + + public void setTokenType(String tokenType) { + this.tokenType = tokenType; + } + + + public OAuthResponse expiresIn(String expiresIn) { + + this.expiresIn = expiresIn; + return this; + } + + /** + * OAuth expiry time + * @return expiresIn + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "OAuth expiry time") + + public String getExpiresIn() { + return expiresIn; + } + + + public void setExpiresIn(String expiresIn) { + this.expiresIn = expiresIn; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthResponse oauthResponse = (OAuthResponse) o; + return Objects.equals(this.accessToken, oauthResponse.accessToken) && + Objects.equals(this.tokenType, oauthResponse.tokenType) && + Objects.equals(this.expiresIn, oauthResponse.expiresIn); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenType, expiresIn); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/OutboundPollResponse.java b/src/main/java/com/telstra/models/OutboundPollResponse.java new file mode 100644 index 0000000..13aa6c9 --- /dev/null +++ b/src/main/java/com/telstra/models/OutboundPollResponse.java @@ -0,0 +1,187 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.Status; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * OutboundPollResponse + */ + +public class OutboundPollResponse { + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_SENT_TIMESTAMP = "sentTimestamp"; + @SerializedName(SERIALIZED_NAME_SENT_TIMESTAMP) + private String sentTimestamp; + + public static final String SERIALIZED_NAME_RECEIVED_TIMESTAMP = "receivedTimestamp"; + @SerializedName(SERIALIZED_NAME_RECEIVED_TIMESTAMP) + private String receivedTimestamp; + + public static final String SERIALIZED_NAME_DELIVERY_STATUS = "deliveryStatus"; + @SerializedName(SERIALIZED_NAME_DELIVERY_STATUS) + private Status deliveryStatus; + + + public OutboundPollResponse to(String to) { + + this.to = to; + return this; + } + + /** + * The phone number (recipient) the message was sent to (in E.164 format). + * @return to + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "+61418123456", value = "The phone number (recipient) the message was sent to (in E.164 format). ") + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public OutboundPollResponse sentTimestamp(String sentTimestamp) { + + this.sentTimestamp = sentTimestamp; + return this; + } + + /** + * The date and time when the message was sent. + * @return sentTimestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2017-03-17T09:16:49+10:00", value = "The date and time when the message was sent.") + + public String getSentTimestamp() { + return sentTimestamp; + } + + + public void setSentTimestamp(String sentTimestamp) { + this.sentTimestamp = sentTimestamp; + } + + + public OutboundPollResponse receivedTimestamp(String receivedTimestamp) { + + this.receivedTimestamp = receivedTimestamp; + return this; + } + + /** + * The date and time when the message was recieved by recipient. + * @return receivedTimestamp + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2017-03-17T09:16:50+10:00", value = "The date and time when the message was recieved by recipient.") + + public String getReceivedTimestamp() { + return receivedTimestamp; + } + + + public void setReceivedTimestamp(String receivedTimestamp) { + this.receivedTimestamp = receivedTimestamp; + } + + + public OutboundPollResponse deliveryStatus(Status deliveryStatus) { + + this.deliveryStatus = deliveryStatus; + return this; + } + + /** + * Get deliveryStatus + * @return deliveryStatus + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Status getDeliveryStatus() { + return deliveryStatus; + } + + + public void setDeliveryStatus(Status deliveryStatus) { + this.deliveryStatus = deliveryStatus; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundPollResponse outboundPollResponse = (OutboundPollResponse) o; + return Objects.equals(this.to, outboundPollResponse.to) && + Objects.equals(this.sentTimestamp, outboundPollResponse.sentTimestamp) && + Objects.equals(this.receivedTimestamp, outboundPollResponse.receivedTimestamp) && + Objects.equals(this.deliveryStatus, outboundPollResponse.deliveryStatus); + } + + @Override + public int hashCode() { + return Objects.hash(to, sentTimestamp, receivedTimestamp, deliveryStatus); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundPollResponse {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" sentTimestamp: ").append(toIndentedString(sentTimestamp)).append("\n"); + sb.append(" receivedTimestamp: ").append(toIndentedString(receivedTimestamp)).append("\n"); + sb.append(" deliveryStatus: ").append(toIndentedString(deliveryStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/ProvisionNumberRequest.java b/src/main/java/com/telstra/models/ProvisionNumberRequest.java new file mode 100644 index 0000000..81a359d --- /dev/null +++ b/src/main/java/com/telstra/models/ProvisionNumberRequest.java @@ -0,0 +1,128 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ProvisionNumberRequest + */ + +public class ProvisionNumberRequest { + public static final String SERIALIZED_NAME_ACTIVE_DAYS = "activeDays"; + @SerializedName(SERIALIZED_NAME_ACTIVE_DAYS) + private Integer activeDays; + + public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; + @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) + private String notifyURL; + + + public ProvisionNumberRequest activeDays(Integer activeDays) { + + this.activeDays = activeDays; + return this; + } + + /** + * The number of days before for which this number is provisioned. + * @return activeDays + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "20", value = "The number of days before for which this number is provisioned. ") + + public Integer getActiveDays() { + return activeDays; + } + + + public void setActiveDays(Integer activeDays) { + this.activeDays = activeDays; + } + + + public ProvisionNumberRequest notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * A notification URL that will be POSTed to whenever a new message (i.e. 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. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). *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.* + * @return notifyURL + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "http://wwww.example.com/", value = "A notification URL that will be POSTed to whenever a new message (i.e. 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. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). *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.* ") + + public String getNotifyURL() { + return notifyURL; + } + + + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProvisionNumberRequest provisionNumberRequest = (ProvisionNumberRequest) o; + return Objects.equals(this.activeDays, provisionNumberRequest.activeDays) && + Objects.equals(this.notifyURL, provisionNumberRequest.notifyURL); + } + + @Override + public int hashCode() { + return Objects.hash(activeDays, notifyURL); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProvisionNumberRequest {\n"); + sb.append(" activeDays: ").append(toIndentedString(activeDays)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/ProvisionNumberResponse.java b/src/main/java/com/telstra/models/ProvisionNumberResponse.java new file mode 100644 index 0000000..9816983 --- /dev/null +++ b/src/main/java/com/telstra/models/ProvisionNumberResponse.java @@ -0,0 +1,129 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +/** + * ProvisionNumberResponse + */ + +public class ProvisionNumberResponse { + public static final String SERIALIZED_NAME_DESTINATION_ADDRESS = "destinationAddress"; + @SerializedName(SERIALIZED_NAME_DESTINATION_ADDRESS) + private String destinationAddress; + + public static final String SERIALIZED_NAME_EXPIRY_DATE = "expiryDate"; + @SerializedName(SERIALIZED_NAME_EXPIRY_DATE) + private BigDecimal expiryDate; + + + public ProvisionNumberResponse destinationAddress(String destinationAddress) { + + this.destinationAddress = destinationAddress; + return this; + } + + /** + * The mobile phone number that was allocated + * @return destinationAddress + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "+61412345678", value = "The mobile phone number that was allocated") + + public String getDestinationAddress() { + return destinationAddress; + } + + + public void setDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + } + + + public ProvisionNumberResponse expiryDate(BigDecimal expiryDate) { + + this.expiryDate = expiryDate; + return this; + } + + /** + * Free Trial apps can only add activeDays for their provisioned number every 30 days. This is in Unix time format. + * @return expiryDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1534463077362", value = "Free Trial apps can only add activeDays for their provisioned number every 30 days. This is in Unix time format.") + + public BigDecimal getExpiryDate() { + return expiryDate; + } + + + public void setExpiryDate(BigDecimal expiryDate) { + this.expiryDate = expiryDate; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProvisionNumberResponse provisionNumberResponse = (ProvisionNumberResponse) o; + return Objects.equals(this.destinationAddress, provisionNumberResponse.destinationAddress) && + Objects.equals(this.expiryDate, provisionNumberResponse.expiryDate); + } + + @Override + public int hashCode() { + return Objects.hash(destinationAddress, expiryDate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProvisionNumberResponse {\n"); + sb.append(" destinationAddress: ").append(toIndentedString(destinationAddress)).append("\n"); + sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/SendMmsRequest.java b/src/main/java/com/telstra/models/SendMmsRequest.java new file mode 100644 index 0000000..8d89d5a --- /dev/null +++ b/src/main/java/com/telstra/models/SendMmsRequest.java @@ -0,0 +1,250 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.MMSContent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * SendMmsRequest + */ + +public class SendMmsRequest { + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + private String subject; + + public static final String SERIALIZED_NAME_REPLY_REQUEST = "replyRequest"; + @SerializedName(SERIALIZED_NAME_REPLY_REQUEST) + private Boolean replyRequest; + + public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; + @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) + private String notifyURL; + + public static final String SERIALIZED_NAME_MM_S_CONTENT = "MMSContent"; + @SerializedName(SERIALIZED_NAME_MM_S_CONTENT) + private List mmSContent = new ArrayList(); + + + public SendMmsRequest to(String to) { + + this.to = to; + return this; + } + + /** + * This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] + * @return to + **/ + @ApiModelProperty(example = "", required = true, value = "This is the destination address. Can be an array of strings if sending to multiple numbers: \"to\":[\"+61412345678\", \"+61418765432\"] ") + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public SendMmsRequest from(String from) { + + this.from = from; + return this; + } + + /** + * This will be the source address that will be displayed on the receiving device. You can set an Alphanumeric sender ID of up to 11 characters that the MMS was sent from. Phone numbers in the `from` attribute will be blocked (400-error) to prevent number spoofing. Most standard ASCII characters are accepted in the alphanumeric `from` attribute, however there are some limitations. The following limitations and characters are allowed in the alphanumeric `from` attribute; any alphabetic character (e.g. `abc`), any number mixed with alphabetic characters (e.g. `123abc`), uppercase and lowercase characters (e.g. `aBc`), any of the following special characters mixed with alphabetic characters are allowed; `~!@#$%^&*()~_~+-={}|[];'?,./` (e.g. `abc~!@`), any combination of lowercase, uppercase, numeric or allowed special characters (e.g. `abc@#123DE`). All other characters, including spaces and extended ASCII characters, are not allowed (e.g. `<>:\"\\`). If attribute is not present, the service will use the mobile number associated with the application (in E.164 format). If `replyRequest` is set to true, this field should not be present. This feature is only available on Telstra Account paid plans, not through Free Trials or credit card paid plans. *Please note:* *- Alphanumeric sender ID works for domestic, i.e. Australian, destinations only.* *- When Alphanumeric sender ID is used in sending MMS, Delivery Reports will NOT be returned.* + * @return from + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "This will be the source address that will be displayed on the receiving device. You can set an Alphanumeric sender ID of up to 11 characters that the MMS was sent from. Phone numbers in the `from` attribute will be blocked (400-error) to prevent number spoofing. Most standard ASCII characters are accepted in the alphanumeric `from` attribute, however there are some limitations. The following limitations and characters are allowed in the alphanumeric `from` attribute; any alphabetic character (e.g. `abc`), any number mixed with alphabetic characters (e.g. `123abc`), uppercase and lowercase characters (e.g. `aBc`), any of the following special characters mixed with alphabetic characters are allowed; `~!@#$%^&*()~_~+-={}|[];'?,./` (e.g. `abc~!@`), any combination of lowercase, uppercase, numeric or allowed special characters (e.g. `abc@#123DE`). All other characters, including spaces and extended ASCII characters, are not allowed (e.g. `<>:\"\\`). If attribute is not present, the service will use the mobile number associated with the application (in E.164 format). If `replyRequest` is set to true, this field should not be present. This feature is only available on Telstra Account paid plans, not through Free Trials or credit card paid plans. *Please note:* *- Alphanumeric sender ID works for domestic, i.e. Australian, destinations only.* *- When Alphanumeric sender ID is used in sending MMS, Delivery Reports will NOT be returned.* ") + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public SendMmsRequest subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * The subject that will be used in an MMS message. Subject is limited to maximum of 64 characters. Some special characters need to be encoded if used in the `subject` field (e.g. &amp;amp; for & and &amp;lt; for <). + * @return subject + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The subject that will be used in an MMS message. Subject is limited to maximum of 64 characters. Some special characters need to be encoded if used in the `subject` field (e.g. &amp; for & and &lt; for <). ") + + public String getSubject() { + return subject; + } + + + public void setSubject(String subject) { + this.subject = subject; + } + + + public SendMmsRequest replyRequest(Boolean replyRequest) { + + this.replyRequest = replyRequest; + return this; + } + + /** + * If set to true, the reply message functionality will be implemented. The `from` field should not be present. + * @return replyRequest + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "If set to true, the reply message functionality will be implemented. The `from` field should not be present. ") + + public Boolean getReplyRequest() { + return replyRequest; + } + + + public void setReplyRequest(Boolean replyRequest) { + this.replyRequest = replyRequest; + } + + + public SendMmsRequest notifyURL(String notifyURL) { + + this.notifyURL = notifyURL; + return this; + } + + /** + * Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). + * @return notifyURL + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "http://www.example.com/", value = "Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). ") + + public String getNotifyURL() { + return notifyURL; + } + + + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; + } + + + public SendMmsRequest mmSContent(List mmSContent) { + + this.mmSContent = mmSContent; + return this; + } + + public SendMmsRequest addMmSContentItem(MMSContent mmSContentItem) { + this.mmSContent.add(mmSContentItem); + return this; + } + + /** + * 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. + * @return mmSContent + **/ + @ApiModelProperty(required = true, value = "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. ") + + public List getMmSContent() { + return mmSContent; + } + + + public void setMmSContent(List mmSContent) { + this.mmSContent = mmSContent; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendMmsRequest sendMmsRequest = (SendMmsRequest) o; + return Objects.equals(this.to, sendMmsRequest.to) && + Objects.equals(this.from, sendMmsRequest.from) && + Objects.equals(this.subject, sendMmsRequest.subject) && + Objects.equals(this.replyRequest, sendMmsRequest.replyRequest) && + Objects.equals(this.notifyURL, sendMmsRequest.notifyURL) && + Objects.equals(this.mmSContent, sendMmsRequest.mmSContent); + } + + @Override + public int hashCode() { + return Objects.hash(to, from, subject, replyRequest, notifyURL, mmSContent); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendMmsRequest {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" replyRequest: ").append(toIndentedString(replyRequest)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); + sb.append(" mmSContent: ").append(toIndentedString(mmSContent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/messaging/SendSMSRequest.java b/src/main/java/com/telstra/models/SendSMSRequest.java old mode 100755 new mode 100644 similarity index 58% rename from src/main/java/com/telstra/messaging/SendSMSRequest.java rename to src/main/java/com/telstra/models/SendSMSRequest.java index a0d654d..cdc8af2 --- a/src/main/java/com/telstra/messaging/SendSMSRequest.java +++ b/src/main/java/com/telstra/models/SendSMSRequest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -11,7 +11,7 @@ */ -package com.telstra.messaging; +package com.telstra.models; import java.util.Objects; import java.util.Arrays; diff --git a/src/main/java/com/telstra/models/SendSmsMultiRequest.java b/src/main/java/com/telstra/models/SendSmsMultiRequest.java new file mode 100644 index 0000000..c5c2b0b --- /dev/null +++ b/src/main/java/com/telstra/models/SendSmsMultiRequest.java @@ -0,0 +1,139 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.MessageMulti; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * SendSmsMultiRequest + */ + +public class SendSmsMultiRequest { + public static final String SERIALIZED_NAME_SMS_MULTI = "smsMulti"; + @SerializedName(SERIALIZED_NAME_SMS_MULTI) + private List smsMulti = null; + + public static final String SERIALIZED_NAME_NOTIY_U_R_L = "notiyURL"; + @SerializedName(SERIALIZED_NAME_NOTIY_U_R_L) + private String notiyURL; + + + public SendSmsMultiRequest smsMulti(List smsMulti) { + + this.smsMulti = smsMulti; + return this; + } + + public SendSmsMultiRequest addSmsMultiItem(MessageMulti smsMultiItem) { + if (this.smsMulti == null) { + this.smsMulti = new ArrayList(); + } + this.smsMulti.add(smsMultiItem); + return this; + } + + /** + * Multiple SMS. Up to 10 messages can be sent in one API call. + * @return smsMulti + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Multiple SMS. Up to 10 messages can be sent in one API call.") + + public List getSmsMulti() { + return smsMulti; + } + + + public void setSmsMulti(List smsMulti) { + this.smsMulti = smsMulti; + } + + + public SendSmsMultiRequest notiyURL(String notiyURL) { + + this.notiyURL = notiyURL; + return this; + } + + /** + * Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). + * @return notiyURL + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "http://www.example.com/", value = "Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). ") + + public String getNotiyURL() { + return notiyURL; + } + + + public void setNotiyURL(String notiyURL) { + this.notiyURL = notiyURL; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendSmsMultiRequest sendSmsMultiRequest = (SendSmsMultiRequest) o; + return Objects.equals(this.smsMulti, sendSmsMultiRequest.smsMulti) && + Objects.equals(this.notiyURL, sendSmsMultiRequest.notiyURL); + } + + @Override + public int hashCode() { + return Objects.hash(smsMulti, notiyURL); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendSmsMultiRequest {\n"); + sb.append(" smsMulti: ").append(toIndentedString(smsMulti)).append("\n"); + sb.append(" notiyURL: ").append(toIndentedString(notiyURL)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/telstra/models/Status.java b/src/main/java/com/telstra/models/Status.java new file mode 100644 index 0000000..6c77235 --- /dev/null +++ b/src/main/java/com/telstra/models/Status.java @@ -0,0 +1,85 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Status + */ +@JsonAdapter(Status.Adapter.class) +public enum Status { + + PEND("PEND"), + + SENT("SENT"), + + DELIVRD("DELIVRD"), + + EXPIRED("EXPIRED"), + + DELETED("DELETED"), + + UNDVBL("UNDVBL"), + + REJECTD("REJECTD"), + + UNKNOWN("Unknown"); + + private String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Status fromValue(String value) { + for (Status b : Status.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Status enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Status read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Status.fromValue(value); + } + } +} + diff --git a/src/test/java/com/telstra/messaging/AuthenticationApiTest.java b/src/test/java/com/telstra/messaging/AuthenticationApiTest.java index 622ebe8..4447162 100755 --- a/src/test/java/com/telstra/messaging/AuthenticationApiTest.java +++ b/src/test/java/com/telstra/messaging/AuthenticationApiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -14,7 +14,7 @@ package com.telstra.messaging; import com.telstra.ApiException; -import com.telstra.messaging.OAuthResponse; +import com.telstra.models.OAuthResponse; import org.junit.Test; import org.junit.Ignore; diff --git a/src/test/java/com/telstra/messaging/MessagingApiTest.java b/src/test/java/com/telstra/messaging/MessagingApiTest.java index 686bc21..b240d70 100755 --- a/src/test/java/com/telstra/messaging/MessagingApiTest.java +++ b/src/test/java/com/telstra/messaging/MessagingApiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -14,15 +14,15 @@ package com.telstra.messaging; import com.telstra.ApiException; -import com.telstra.messaging.GetMmsResponse; -import com.telstra.messaging.HealthCheckResponse; -import com.telstra.messaging.InboundPollResponse; -import com.telstra.messaging.MessageSentResponseMms; -import com.telstra.messaging.MessageSentResponseSms; -import com.telstra.messaging.OutboundPollResponse; -import com.telstra.messaging.SendMmsRequest; -import com.telstra.messaging.SendSMSRequest; -import com.telstra.messaging.SendSmsMultiRequest; +import com.telstra.models.GetMmsResponse; +import com.telstra.models.HealthCheckResponse; +import com.telstra.models.InboundPollResponse; +import com.telstra.models.MessageSentResponseMms; +import com.telstra.models.MessageSentResponseSms; +import com.telstra.models.OutboundPollResponse; +import com.telstra.models.SendMmsRequest; +import com.telstra.models.SendSMSRequest; +import com.telstra.models.SendSmsMultiRequest; import org.junit.Test; import org.junit.Ignore; diff --git a/src/test/java/com/telstra/messaging/ProvisioningApiTest.java b/src/test/java/com/telstra/messaging/ProvisioningApiTest.java index 6771a6c..f1de444 100755 --- a/src/test/java/com/telstra/messaging/ProvisioningApiTest.java +++ b/src/test/java/com/telstra/messaging/ProvisioningApiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * # 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 The Telstra Messaging API provides the features below. | Feature | Description | | --- | --- | | `Dedicated Number` | Provision a mobile number for your account to be used as `from` address in the API | | `Send Messages` | Sending SMS or MMS messages | | `Receive Messages` | Telstra will deliver messages sent to a dedicated number or to the `notifyURL` defined by you | | `Broadcast Messages` | Invoke a single API call to send a message to a list of numbers provided in `to` | | `Delivery Status` | Query the delivery status of your messages | | `Callbacks` | Provide a notification URL and Telstra will notify your app when a message status changes | | `Alphanumeric Identifier` | Differentiate yourself by providing an alphanumeric string in `from`. This feature is only available on Telstra Account paid plans and works on domestic, i.e. Australian, destinations only | | `Concatenation` | Send messages up to 1900 characters long and Telstra will automaticaly segment and reassemble them | | `Reply Request` | Create a chat session by associating `messageId` and `to` number to track responses received from a mobile number. We will store this association for 8 days | | `Character set` | Accepts all Unicode characters as part of UTF-8 | | `Bounce-back response` | See if your SMS hits an unreachable or unallocated number (Australia Only) | | `Queuing` | Messaging API will automatically queue and deliver each message at a compliant rate. | | `Emoji Encoding` | The API supports the encoding of the full range of emojis in the Basic Multilingual Plane. Support for emojis in the Supplementary Planes include those in the U+1F600 to U+1F6FF block. Emojis in the reply messages will be in their UTF-8 format | ## Delivery Status: Notification/Callbacks vs Polling The API provides two methods to confirm that a message has been delivered to the destination. 1. When you send a message there is an opportunity to specify a `notifyURL`. Once the message has been delivered, the API will make a call to this URL to advise of the message status. 2. If you do not specify a URL you can always call the `GET /status` API to get the status of the message. # Getting Access to the API 1. Register at [https://dev.telstra.com](https://dev.telstra.com). 2. After registration, login to [https://dev.telstra.com](https://dev.telstra.com) and navigate to the **My apps** page. 3. Create your application by clicking the **Add new app** button 4. Select **API Free Trial** Product when configuring your application. This Product includes the Telstra Messaging API as well as other free trial APIs. Your application will be approved automatically. 5. There is a maximum of 1000 free messages per developer. Additional messages and features can be purchased from [https://dev.telstra.com](https://dev.telstra.com). 6. Note your `Client key` and `Client secret` as these will be needed to provision a number for your application and for authentication. Now head over to **Getting Started** where you can find a postman collection as well as some links to sample apps and SDKs to get you started. Happy Messaging! # Frequently Asked Questions **Q: Is creating a subscription via the Provisioning call a required step?** A. Yes. You will only be able to start sending messages if you have a provisioned dedicated number. Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: When trying to send an SMS I receive a `400 Bad Request` response. How can I fix this?** A. You need to make sure you have a provisioned dedicated number before you can send an SMS. If you do not have a provisioned dedicated number and you try to send a message via the API, you will get the error below in the response:
{   \"status\":\"400\",   \"code\":\"DELIVERY-IMPOSSIBLE\",   \"message\":\"Invalid \\'from\\' address specified\" }
Use Provisioning to create a dedicated number subscription, or renew your dedicated number if it has expired. **Q: How long does my dedicated number stay active for?** A. When you provision a dedicated number, by default it will be active for 30 days. You can use the `activeDays` parameter during the provisioning call to increment or decrement the number of days your dedicated number will remain active. Note that Free Trial apps will have 30 days as the maximum `activeDays` they can add to 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`. **Q: Can I send a broadcast message using the Telstra Messaging API?** A. Yes. Recipient numbers can be in the form of an array of strings if a broadcast message needs to be sent, allowing you to send to multiple mobile numbers in one API call. A sample request body for this will be: `{\"to\":[\"+61412345678\",\"+61487654321\"],\"body\":\"Test Message\"}` **Q: How many recipient numbers can I send a broadcast message to at one time?** A. The API currently supports up to 10 recipient numbers in the `\"to\"` array. **Q: Can I send SMS and MMS to all countries?** A. You can send SMS and MMS to the countries in [this list](https://raw.githubusercontent.com/telstra/MessagingAPI-v2/master/docs/Telstra_Messaging_API_Country_Codes.csv), provided the destination network supports delivery. Messages CANNOT be sent to countries which are subject to global sanctions namely: Burma, Côte d'Ivoire, Cuba, Iran, North Korea, Syria. **Q: Can I use `Alphanumeric Identifier` from my paid plan via credit card?** A. `Alphanumeric Identifier` is only available on Telstra Account paid plans, not through credit card paid plans. **Q: What is the maximum sized MMS that I can send?** A. This will depend on the carrier that will receive the MMS. For Telstra it's up to 2MB, Optus up to 1.5MB and Vodafone only allows up to 500kB. You will need to check with international carriers for thier MMS size limits. **Q: How is the size of an MMS calculated?** A. Images are scaled up to approximately 4/3 when base64 encoded. Additionally, there is approximately 200 bytes of overhead on each MMS. Assuming the maximum MMS that can be sent on Telstra’s network is 2MB, then the maximum image size that can be sent will be approximately 1.378MB (1.378 x 1.34 + 200, without SOAP encapsulation). **Q: How is an MMS classified as Small or Large?** A. MMSes with numberSegments below 600 are classed as Small whereas those that are bigger than 600 are classed as Large. They will be charged accordingly. **Q: Are SMILs supported by the Messaging API?** A. While there will be no error if you send an MMS with a SMIL presentation, the actual layout or sequence defined in the SMIL may not display as expected because most of the new smartphone devices ignore the SMIL presentation layer. SMIL was used in feature phones which had limited capability and SMIL allowed a *powerpoint type* presentation to be provided. Smartphones now have the capability to display video which is the better option for presentations. It is recommended that MMS messages should just drop the SMIL. **Q: How do I assign a delivery notification or callback URL?** A. You can assign a delivery notification or callback URL by adding the `notifyURL` parameter in the body of the request when you send a message. Once the message has been delivered, a notification will then be posted to this callback URL. **Q: Sometimes I am missing delivery receipts, why is this happening?** A: Telstra can guarantee delivery receipts are provided for any mobile service connected on Telstra's network so long as the destination handset is able to receive SMS or MMS messages. For other carriers, although messages will be delivered to valid handsets on those carriers, they do not have an obligation to provide delivery receipts back to Telstra. **Q: What is the difference between the `notifyURL` parameter in the Provisoning call versus the `notifyURL` parameter in the Send Message call?** A. The `notifyURL` in the Provisoning call will be the URL where replies to the provisioned number will be posted. On the other hand, the `notifyURL` in the Send Message call will be the URL where the delivery notification will be posted, e.g. when an SMS has already been delivered to the recipient. **Q: Is there a specific format for the `notifyURL` parameter?** A. The `notifyURL` should be a complete URL address which includes the protocol identifier (e.g. `https://`). It should also have a forward slash at the end if it is just a domain (e.g. http://www.example.com/). # Getting Started Below are the steps to get started with the Telstra Messaging API. 1. Generate an OAuth2 token using your `Client key` and `Client secret`. 2. Use the Provisioning call to create a subscription and receive a dedicated number. 3. Send a message to a specific mobile number. ## Run in Postman \"Run ## Sample Apps - [Perl Sample App](https://github.com/telstra/MessagingAPI-perl-sample-app) - [Happy Chat App](https://github.com/telstra/messaging-sample-code-happy-chat) - [PHP Sample App](https://github.com/developersteve/telstra-messaging-php) ## SDK Repos - [Messaging API - PHP SDK](https://github.com/telstra/MessagingAPI-SDK-php) - [Messaging API - Python SDK](https://github.com/telstra/MessagingAPI-SDK-python) - [Messaging API - Ruby SDK](https://github.com/telstra/MessagingAPI-SDK-ruby) - [Messaging API - NodeJS SDK](https://github.com/telstra/MessagingAPI-SDK-node) - [Messaging API - .Net2 SDK](https://github.com/telstra/MessagingAPI-SDK-dotnet) - [Messaging API - Java SDK](https://github.com/telstra/MessagingAPI-SDK-Java) ## Blog Posts For more information on the Messaging API, you can read these blog posts: - [Callbacks Part 1](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-1) - [Callbacks Part 2](https://dev.telstra.com/content/understanding-messaging-api-callbacks-part-2) + * The API specification for Telstra Messaging API * * The version of the OpenAPI document: 2.2.9 * @@ -14,10 +14,10 @@ package com.telstra.messaging; import com.telstra.ApiException; -import com.telstra.messaging.DeleteNumberRequest; -import com.telstra.messaging.GetSubscriptionResponse; -import com.telstra.messaging.ProvisionNumberRequest; -import com.telstra.messaging.ProvisionNumberResponse; +import com.telstra.models.DeleteNumberRequest; +import com.telstra.models.GetSubscriptionResponse; +import com.telstra.models.ProvisionNumberRequest; +import com.telstra.models.ProvisionNumberResponse; import org.junit.Test; import org.junit.Ignore; diff --git a/src/test/java/com/telstra/models/DeleteNumberRequestTest.java b/src/test/java/com/telstra/models/DeleteNumberRequestTest.java new file mode 100644 index 0000000..4cf3709 --- /dev/null +++ b/src/test/java/com/telstra/models/DeleteNumberRequestTest.java @@ -0,0 +1,51 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DeleteNumberRequest + */ +public class DeleteNumberRequestTest { + private final DeleteNumberRequest model = new DeleteNumberRequest(); + + /** + * Model tests for DeleteNumberRequest + */ + @Test + public void testDeleteNumberRequest() { + // TODO: test DeleteNumberRequest + } + + /** + * Test the property 'emptyArr' + */ + @Test + public void emptyArrTest() { + // TODO: test emptyArr + } + +} diff --git a/src/test/java/com/telstra/models/GetMmsResponseTest.java b/src/test/java/com/telstra/models/GetMmsResponseTest.java new file mode 100644 index 0000000..1273759 --- /dev/null +++ b/src/test/java/com/telstra/models/GetMmsResponseTest.java @@ -0,0 +1,110 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.MMSContent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for GetMmsResponse + */ +public class GetMmsResponseTest { + private final GetMmsResponse model = new GetMmsResponse(); + + /** + * Model tests for GetMmsResponse + */ + @Test + public void testGetMmsResponse() { + // TODO: test GetMmsResponse + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'destinationAddress' + */ + @Test + public void destinationAddressTest() { + // TODO: test destinationAddress + } + + /** + * Test the property 'senderAddress' + */ + @Test + public void senderAddressTest() { + // TODO: test senderAddress + } + + /** + * Test the property 'subject' + */ + @Test + public void subjectTest() { + // TODO: test subject + } + + /** + * Test the property 'messageId' + */ + @Test + public void messageIdTest() { + // TODO: test messageId + } + + /** + * Test the property 'apiMsgId' + */ + @Test + public void apiMsgIdTest() { + // TODO: test apiMsgId + } + + /** + * Test the property 'sentTimestamp' + */ + @Test + public void sentTimestampTest() { + // TODO: test sentTimestamp + } + + /** + * Test the property 'mmSContent' + */ + @Test + public void mmSContentTest() { + // TODO: test mmSContent + } + +} diff --git a/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java b/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java new file mode 100644 index 0000000..e4afb98 --- /dev/null +++ b/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java @@ -0,0 +1,67 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for GetSubscriptionResponse + */ +public class GetSubscriptionResponseTest { + private final GetSubscriptionResponse model = new GetSubscriptionResponse(); + + /** + * Model tests for GetSubscriptionResponse + */ + @Test + public void testGetSubscriptionResponse() { + // TODO: test GetSubscriptionResponse + } + + /** + * Test the property 'activeDays' + */ + @Test + public void activeDaysTest() { + // TODO: test activeDays + } + + /** + * Test the property 'notifyURL' + */ + @Test + public void notifyURLTest() { + // TODO: test notifyURL + } + + /** + * Test the property 'destinationAddress' + */ + @Test + public void destinationAddressTest() { + // TODO: test destinationAddress + } + +} diff --git a/src/test/java/com/telstra/models/HealthCheckResponseTest.java b/src/test/java/com/telstra/models/HealthCheckResponseTest.java new file mode 100644 index 0000000..883c01d --- /dev/null +++ b/src/test/java/com/telstra/models/HealthCheckResponseTest.java @@ -0,0 +1,51 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HealthCheckResponse + */ +public class HealthCheckResponseTest { + private final HealthCheckResponse model = new HealthCheckResponse(); + + /** + * Model tests for HealthCheckResponse + */ + @Test + public void testHealthCheckResponse() { + // TODO: test HealthCheckResponse + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/src/test/java/com/telstra/models/InboundPollResponseTest.java b/src/test/java/com/telstra/models/InboundPollResponseTest.java new file mode 100644 index 0000000..c5e241a --- /dev/null +++ b/src/test/java/com/telstra/models/InboundPollResponseTest.java @@ -0,0 +1,91 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InboundPollResponse + */ +public class InboundPollResponseTest { + private final InboundPollResponse model = new InboundPollResponse(); + + /** + * Model tests for InboundPollResponse + */ + @Test + public void testInboundPollResponse() { + // TODO: test InboundPollResponse + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'destinationAddress' + */ + @Test + public void destinationAddressTest() { + // TODO: test destinationAddress + } + + /** + * Test the property 'senderAddress' + */ + @Test + public void senderAddressTest() { + // TODO: test senderAddress + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'messageId' + */ + @Test + public void messageIdTest() { + // TODO: test messageId + } + + /** + * Test the property 'sentTimestamp' + */ + @Test + public void sentTimestampTest() { + // TODO: test sentTimestamp + } + +} diff --git a/src/test/java/com/telstra/models/MMSContentTest.java b/src/test/java/com/telstra/models/MMSContentTest.java new file mode 100644 index 0000000..978f853 --- /dev/null +++ b/src/test/java/com/telstra/models/MMSContentTest.java @@ -0,0 +1,67 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MMSContent + */ +public class MMSContentTest { + private final MMSContent model = new MMSContent(); + + /** + * Model tests for MMSContent + */ + @Test + public void testMMSContent() { + // TODO: test MMSContent + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'filename' + */ + @Test + public void filenameTest() { + // TODO: test filename + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/src/test/java/com/telstra/models/MessageMultiTest.java b/src/test/java/com/telstra/models/MessageMultiTest.java new file mode 100644 index 0000000..2be480b --- /dev/null +++ b/src/test/java/com/telstra/models/MessageMultiTest.java @@ -0,0 +1,67 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MessageMulti + */ +public class MessageMultiTest { + private final MessageMulti model = new MessageMulti(); + + /** + * Model tests for MessageMulti + */ + @Test + public void testMessageMulti() { + // TODO: test MessageMulti + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'body' + */ + @Test + public void bodyTest() { + // TODO: test body + } + + /** + * Test the property 'receiptOff' + */ + @Test + public void receiptOffTest() { + // TODO: test receiptOff + } + +} diff --git a/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java b/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java new file mode 100644 index 0000000..491c9f5 --- /dev/null +++ b/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java @@ -0,0 +1,86 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.Message; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MessageSentResponseMms + */ +public class MessageSentResponseMmsTest { + private final MessageSentResponseMms model = new MessageSentResponseMms(); + + /** + * Model tests for MessageSentResponseMms + */ + @Test + public void testMessageSentResponseMms() { + // TODO: test MessageSentResponseMms + } + + /** + * Test the property 'messages' + */ + @Test + public void messagesTest() { + // TODO: test messages + } + + /** + * Test the property 'mmsMediaKB' + */ + @Test + public void mmsMediaKBTest() { + // TODO: test mmsMediaKB + } + + /** + * Test the property 'country' + */ + @Test + public void countryTest() { + // TODO: test country + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'numberSegments' + */ + @Test + public void numberSegmentsTest() { + // TODO: test numberSegments + } + +} diff --git a/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java b/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java new file mode 100644 index 0000000..f81a3b8 --- /dev/null +++ b/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java @@ -0,0 +1,78 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.Message; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MessageSentResponseSms + */ +public class MessageSentResponseSmsTest { + private final MessageSentResponseSms model = new MessageSentResponseSms(); + + /** + * Model tests for MessageSentResponseSms + */ + @Test + public void testMessageSentResponseSms() { + // TODO: test MessageSentResponseSms + } + + /** + * Test the property 'messages' + */ + @Test + public void messagesTest() { + // TODO: test messages + } + + /** + * Test the property 'country' + */ + @Test + public void countryTest() { + // TODO: test country + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'numberSegments' + */ + @Test + public void numberSegmentsTest() { + // TODO: test numberSegments + } + +} diff --git a/src/test/java/com/telstra/models/MessageTest.java b/src/test/java/com/telstra/models/MessageTest.java new file mode 100644 index 0000000..a0c471d --- /dev/null +++ b/src/test/java/com/telstra/models/MessageTest.java @@ -0,0 +1,75 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Message + */ +public class MessageTest { + private final Message model = new Message(); + + /** + * Model tests for Message + */ + @Test + public void testMessage() { + // TODO: test Message + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'deliveryStatus' + */ + @Test + public void deliveryStatusTest() { + // TODO: test deliveryStatus + } + + /** + * Test the property 'messageId' + */ + @Test + public void messageIdTest() { + // TODO: test messageId + } + + /** + * Test the property 'messageStatusURL' + */ + @Test + public void messageStatusURLTest() { + // TODO: test messageStatusURL + } + +} diff --git a/src/test/java/com/telstra/models/OAuthResponseTest.java b/src/test/java/com/telstra/models/OAuthResponseTest.java new file mode 100644 index 0000000..c098a05 --- /dev/null +++ b/src/test/java/com/telstra/models/OAuthResponseTest.java @@ -0,0 +1,67 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OAuthResponse + */ +public class OAuthResponseTest { + private final OAuthResponse model = new OAuthResponse(); + + /** + * Model tests for OAuthResponse + */ + @Test + public void testOAuthResponse() { + // TODO: test OAuthResponse + } + + /** + * Test the property 'accessToken' + */ + @Test + public void accessTokenTest() { + // TODO: test accessToken + } + + /** + * Test the property 'tokenType' + */ + @Test + public void tokenTypeTest() { + // TODO: test tokenType + } + + /** + * Test the property 'expiresIn' + */ + @Test + public void expiresInTest() { + // TODO: test expiresIn + } + +} diff --git a/src/test/java/com/telstra/models/OutboundPollResponseTest.java b/src/test/java/com/telstra/models/OutboundPollResponseTest.java new file mode 100644 index 0000000..e35689f --- /dev/null +++ b/src/test/java/com/telstra/models/OutboundPollResponseTest.java @@ -0,0 +1,76 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.Status; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OutboundPollResponse + */ +public class OutboundPollResponseTest { + private final OutboundPollResponse model = new OutboundPollResponse(); + + /** + * Model tests for OutboundPollResponse + */ + @Test + public void testOutboundPollResponse() { + // TODO: test OutboundPollResponse + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'sentTimestamp' + */ + @Test + public void sentTimestampTest() { + // TODO: test sentTimestamp + } + + /** + * Test the property 'receivedTimestamp' + */ + @Test + public void receivedTimestampTest() { + // TODO: test receivedTimestamp + } + + /** + * Test the property 'deliveryStatus' + */ + @Test + public void deliveryStatusTest() { + // TODO: test deliveryStatus + } + +} diff --git a/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java b/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java new file mode 100644 index 0000000..68d6433 --- /dev/null +++ b/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java @@ -0,0 +1,59 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ProvisionNumberRequest + */ +public class ProvisionNumberRequestTest { + private final ProvisionNumberRequest model = new ProvisionNumberRequest(); + + /** + * Model tests for ProvisionNumberRequest + */ + @Test + public void testProvisionNumberRequest() { + // TODO: test ProvisionNumberRequest + } + + /** + * Test the property 'activeDays' + */ + @Test + public void activeDaysTest() { + // TODO: test activeDays + } + + /** + * Test the property 'notifyURL' + */ + @Test + public void notifyURLTest() { + // TODO: test notifyURL + } + +} diff --git a/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java b/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java new file mode 100644 index 0000000..e2171c7 --- /dev/null +++ b/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java @@ -0,0 +1,60 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ProvisionNumberResponse + */ +public class ProvisionNumberResponseTest { + private final ProvisionNumberResponse model = new ProvisionNumberResponse(); + + /** + * Model tests for ProvisionNumberResponse + */ + @Test + public void testProvisionNumberResponse() { + // TODO: test ProvisionNumberResponse + } + + /** + * Test the property 'destinationAddress' + */ + @Test + public void destinationAddressTest() { + // TODO: test destinationAddress + } + + /** + * Test the property 'expiryDate' + */ + @Test + public void expiryDateTest() { + // TODO: test expiryDate + } + +} diff --git a/src/test/java/com/telstra/models/SendMmsRequestTest.java b/src/test/java/com/telstra/models/SendMmsRequestTest.java new file mode 100644 index 0000000..45a6796 --- /dev/null +++ b/src/test/java/com/telstra/models/SendMmsRequestTest.java @@ -0,0 +1,94 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.MMSContent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SendMmsRequest + */ +public class SendMmsRequestTest { + private final SendMmsRequest model = new SendMmsRequest(); + + /** + * Model tests for SendMmsRequest + */ + @Test + public void testSendMmsRequest() { + // TODO: test SendMmsRequest + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'subject' + */ + @Test + public void subjectTest() { + // TODO: test subject + } + + /** + * Test the property 'replyRequest' + */ + @Test + public void replyRequestTest() { + // TODO: test replyRequest + } + + /** + * Test the property 'notifyURL' + */ + @Test + public void notifyURLTest() { + // TODO: test notifyURL + } + + /** + * Test the property 'mmSContent' + */ + @Test + public void mmSContentTest() { + // TODO: test mmSContent + } + +} diff --git a/src/test/java/com/telstra/models/SendSMSRequestTest.java b/src/test/java/com/telstra/models/SendSMSRequestTest.java new file mode 100644 index 0000000..272c382 --- /dev/null +++ b/src/test/java/com/telstra/models/SendSMSRequestTest.java @@ -0,0 +1,107 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SendSMSRequest + */ +public class SendSMSRequestTest { + private final SendSMSRequest model = new SendSMSRequest(); + + /** + * Model tests for SendSMSRequest + */ + @Test + public void testSendSMSRequest() { + // TODO: test SendSMSRequest + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'body' + */ + @Test + public void bodyTest() { + // TODO: test body + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'validity' + */ + @Test + public void validityTest() { + // TODO: test validity + } + + /** + * Test the property 'scheduledDelivery' + */ + @Test + public void scheduledDeliveryTest() { + // TODO: test scheduledDelivery + } + + /** + * Test the property 'notifyURL' + */ + @Test + public void notifyURLTest() { + // TODO: test notifyURL + } + + /** + * Test the property 'replyRequest' + */ + @Test + public void replyRequestTest() { + // TODO: test replyRequest + } + + /** + * Test the property 'priority' + */ + @Test + public void priorityTest() { + // TODO: test priority + } + +} diff --git a/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java b/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java new file mode 100644 index 0000000..9421681 --- /dev/null +++ b/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java @@ -0,0 +1,62 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.telstra.models.MessageMulti; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SendSmsMultiRequest + */ +public class SendSmsMultiRequestTest { + private final SendSmsMultiRequest model = new SendSmsMultiRequest(); + + /** + * Model tests for SendSmsMultiRequest + */ + @Test + public void testSendSmsMultiRequest() { + // TODO: test SendSmsMultiRequest + } + + /** + * Test the property 'smsMulti' + */ + @Test + public void smsMultiTest() { + // TODO: test smsMulti + } + + /** + * Test the property 'notiyURL' + */ + @Test + public void notiyURLTest() { + // TODO: test notiyURL + } + +} diff --git a/src/test/java/com/telstra/models/StatusTest.java b/src/test/java/com/telstra/models/StatusTest.java new file mode 100644 index 0000000..02c6184 --- /dev/null +++ b/src/test/java/com/telstra/models/StatusTest.java @@ -0,0 +1,34 @@ +/* + * Telstra Messaging API + * The API specification for Telstra Messaging API + * + * The version of the OpenAPI document: 2.2.9 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.telstra.models; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Status + */ +public class StatusTest { + /** + * Model tests for Status + */ + @Test + public void testStatus() { + // TODO: test Status + } + +} From 4ec59f70e9f9d262de7877ef18dc2c81548e5fe4 Mon Sep 17 00:00:00 2001 From: Yaser Adel Mehraban Date: Fri, 7 Feb 2020 14:07:32 +1100 Subject: [PATCH 2/2] Updated to the latest version of swagger --- README.md | 6 ++-- docs/MessagingApi.md | 13 +++++--- docs/SendSmsMultiRequest.md | 2 +- src/main/java/com/telstra/ApiCallback.java | 2 +- src/main/java/com/telstra/ApiClient.java | 2 +- src/main/java/com/telstra/ApiException.java | 2 +- src/main/java/com/telstra/ApiResponse.java | 2 +- src/main/java/com/telstra/Configuration.java | 2 +- .../com/telstra/GzipRequestInterceptor.java | 2 +- src/main/java/com/telstra/JSON.java | 2 +- src/main/java/com/telstra/Pair.java | 2 +- .../java/com/telstra/ProgressRequestBody.java | 2 +- .../com/telstra/ProgressResponseBody.java | 2 +- src/main/java/com/telstra/StringUtil.java | 2 +- .../java/com/telstra/auth/ApiKeyAuth.java | 2 +- .../java/com/telstra/auth/Authentication.java | 2 +- .../java/com/telstra/auth/HttpBasicAuth.java | 2 +- .../java/com/telstra/auth/HttpBearerAuth.java | 2 +- src/main/java/com/telstra/auth/OAuth.java | 2 +- src/main/java/com/telstra/auth/OAuthFlow.java | 2 +- .../telstra/messaging/AuthenticationApi.java | 2 +- .../com/telstra/messaging/MessagingApi.java | 16 +++++----- .../telstra/messaging/ProvisioningApi.java | 2 +- .../telstra/models/DeleteNumberRequest.java | 2 +- .../com/telstra/models/GetMmsResponse.java | 2 +- .../models/GetSubscriptionResponse.java | 2 +- .../telstra/models/HealthCheckResponse.java | 2 +- .../telstra/models/InboundPollResponse.java | 2 +- .../java/com/telstra/models/MMSContent.java | 2 +- src/main/java/com/telstra/models/Message.java | 2 +- .../java/com/telstra/models/MessageMulti.java | 2 +- .../models/MessageSentResponseMms.java | 2 +- .../models/MessageSentResponseSms.java | 2 +- .../com/telstra/models/OAuthResponse.java | 2 +- .../telstra/models/OutboundPollResponse.java | 2 +- .../models/ProvisionNumberRequest.java | 2 +- .../models/ProvisionNumberResponse.java | 2 +- .../com/telstra/models/SendMmsRequest.java | 2 +- .../com/telstra/models/SendSMSRequest.java | 2 +- .../telstra/models/SendSmsMultiRequest.java | 32 +++++++++---------- src/main/java/com/telstra/models/Status.java | 2 +- .../messaging/AuthenticationApiTest.java | 2 +- .../telstra/messaging/MessagingApiTest.java | 2 +- .../messaging/ProvisioningApiTest.java | 2 +- .../models/DeleteNumberRequestTest.java | 2 +- .../telstra/models/GetMmsResponseTest.java | 2 +- .../models/GetSubscriptionResponseTest.java | 2 +- .../models/HealthCheckResponseTest.java | 2 +- .../models/InboundPollResponseTest.java | 2 +- .../com/telstra/models/MMSContentTest.java | 2 +- .../com/telstra/models/MessageMultiTest.java | 2 +- .../models/MessageSentResponseMmsTest.java | 2 +- .../models/MessageSentResponseSmsTest.java | 2 +- .../java/com/telstra/models/MessageTest.java | 2 +- .../com/telstra/models/OAuthResponseTest.java | 2 +- .../models/OutboundPollResponseTest.java | 2 +- .../models/ProvisionNumberRequestTest.java | 2 +- .../models/ProvisionNumberResponseTest.java | 2 +- .../telstra/models/SendMmsRequestTest.java | 2 +- .../telstra/models/SendSMSRequestTest.java | 2 +- .../models/SendSmsMultiRequestTest.java | 8 ++--- .../java/com/telstra/models/StatusTest.java | 2 +- 62 files changed, 97 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 1353ef9..09cce0a 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Telstra Messaging API - API version: 2.2.9 -The API specification for Telstra Messaging API +The Telstra Messaging API specification *Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* @@ -112,10 +112,10 @@ Class | Method | HTTP request | Description *AuthenticationApi* | [**authToken**](docs/AuthenticationApi.md#authToken) | **POST** /oauth/token | Generate OAuth2 token *MessagingApi* | [**getMMSStatus**](docs/MessagingApi.md#getMMSStatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status *MessagingApi* | [**getSMSStatus**](docs/MessagingApi.md#getSMSStatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status -*MessagingApi* | [**mMSHealthCheck**](docs/MessagingApi.md#mMSHealthCheck) | **GET** /messages/mms/heathcheck | MMS Health Check +*MessagingApi* | [**mMSHealthCheck**](docs/MessagingApi.md#mMSHealthCheck) | **GET** /messages/mms/healthcheck | MMS Health Check *MessagingApi* | [**retrieveMMSReplies**](docs/MessagingApi.md#retrieveMMSReplies) | **GET** /messages/mms | Retrieve MMS Replies *MessagingApi* | [**retrieveSMSReplies**](docs/MessagingApi.md#retrieveSMSReplies) | **GET** /messages/sms | Retrieve SMS Replies -*MessagingApi* | [**sMSHealthCheck**](docs/MessagingApi.md#sMSHealthCheck) | **GET** /messages/sms/heathcheck | SMS Health Check +*MessagingApi* | [**sMSHealthCheck**](docs/MessagingApi.md#sMSHealthCheck) | **GET** /messages/sms/healthcheck | SMS Health Check *MessagingApi* | [**sMSMulti**](docs/MessagingApi.md#sMSMulti) | **POST** /messages/sms/multi | Send Multiple SMS *MessagingApi* | [**sendMMS**](docs/MessagingApi.md#sendMMS) | **POST** /messages/mms | Send MMS *MessagingApi* | [**sendSMS**](docs/MessagingApi.md#sendSMS) | **POST** /messages/sms | Send SMS diff --git a/docs/MessagingApi.md b/docs/MessagingApi.md index a21978f..d90d677 100755 --- a/docs/MessagingApi.md +++ b/docs/MessagingApi.md @@ -6,10 +6,10 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**getMMSStatus**](MessagingApi.md#getMMSStatus) | **GET** /messages/mms/{messageid}/status | Get MMS Status [**getSMSStatus**](MessagingApi.md#getSMSStatus) | **GET** /messages/sms/{messageId}/status | Get SMS Status -[**mMSHealthCheck**](MessagingApi.md#mMSHealthCheck) | **GET** /messages/mms/heathcheck | MMS Health Check +[**mMSHealthCheck**](MessagingApi.md#mMSHealthCheck) | **GET** /messages/mms/healthcheck | MMS Health Check [**retrieveMMSReplies**](MessagingApi.md#retrieveMMSReplies) | **GET** /messages/mms | Retrieve MMS Replies [**retrieveSMSReplies**](MessagingApi.md#retrieveSMSReplies) | **GET** /messages/sms | Retrieve SMS Replies -[**sMSHealthCheck**](MessagingApi.md#sMSHealthCheck) | **GET** /messages/sms/heathcheck | SMS Health Check +[**sMSHealthCheck**](MessagingApi.md#sMSHealthCheck) | **GET** /messages/sms/healthcheck | SMS Health Check [**sMSMulti**](MessagingApi.md#sMSMulti) | **POST** /messages/sms/multi | Send Multiple SMS [**sendMMS**](MessagingApi.md#sendMMS) | **POST** /messages/mms | Send MMS [**sendSMS**](MessagingApi.md#sendSMS) | **POST** /messages/sms | Send SMS @@ -457,6 +457,7 @@ Send multiple SMS in one API call. import com.telstra.ApiClient; import com.telstra.ApiException; import com.telstra.Configuration; +import com.telstra.auth.*; import com.telstra.models.*; import com.telstra.messaging.MessagingApi; @@ -464,6 +465,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://tapi.telstra.com/v2"); + + // Configure OAuth2 access token for authorization: auth + OAuth auth = (OAuth) defaultClient.getAuthentication("auth"); + auth.setAccessToken("YOUR ACCESS TOKEN"); MessagingApi apiInstance = new MessagingApi(defaultClient); SendSmsMultiRequest payload = new SendSmsMultiRequest(); // SendSmsMultiRequest | A JSON 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. @@ -493,7 +498,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[auth](../README.md#auth) ### HTTP request headers @@ -504,7 +509,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | -**400** | Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when receiptOff is missing or receiptOff=false but notifyURL is missing | - | +**400** | Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"` but notifyURL is missing | - | **500** | Technical error : Unable to route the message to a Target Endpoint : An error has occurred while processing your request, please refer to API Docs for summary on the issue | - | **501** | The HTTP method being used has not yet been implemented for the requested resource | - | **503** | The service requested is currently unavailable | - | diff --git a/docs/SendSmsMultiRequest.md b/docs/SendSmsMultiRequest.md index 81f99d4..d986866 100644 --- a/docs/SendSmsMultiRequest.md +++ b/docs/SendSmsMultiRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **smsMulti** | [**List<MessageMulti>**](MessageMulti.md) | Multiple SMS. Up to 10 messages can be sent in one API call. | [optional] -**notiyURL** | **String** | Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). | [optional] +**notifyURL** | **String** | Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). This is required when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"`. | [optional] diff --git a/src/main/java/com/telstra/ApiCallback.java b/src/main/java/com/telstra/ApiCallback.java index 490cc07..70d3ab9 100755 --- a/src/main/java/com/telstra/ApiCallback.java +++ b/src/main/java/com/telstra/ApiCallback.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ApiClient.java b/src/main/java/com/telstra/ApiClient.java index 0597f58..10d0c3f 100755 --- a/src/main/java/com/telstra/ApiClient.java +++ b/src/main/java/com/telstra/ApiClient.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ApiException.java b/src/main/java/com/telstra/ApiException.java index 3a1e389..e82a455 100755 --- a/src/main/java/com/telstra/ApiException.java +++ b/src/main/java/com/telstra/ApiException.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ApiResponse.java b/src/main/java/com/telstra/ApiResponse.java index 883dd96..9045fe7 100755 --- a/src/main/java/com/telstra/ApiResponse.java +++ b/src/main/java/com/telstra/ApiResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/Configuration.java b/src/main/java/com/telstra/Configuration.java index 7e094c0..30e098c 100755 --- a/src/main/java/com/telstra/Configuration.java +++ b/src/main/java/com/telstra/Configuration.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/GzipRequestInterceptor.java b/src/main/java/com/telstra/GzipRequestInterceptor.java index 42d93fe..15163ce 100755 --- a/src/main/java/com/telstra/GzipRequestInterceptor.java +++ b/src/main/java/com/telstra/GzipRequestInterceptor.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/JSON.java b/src/main/java/com/telstra/JSON.java index dcbc55f..430b836 100755 --- a/src/main/java/com/telstra/JSON.java +++ b/src/main/java/com/telstra/JSON.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/Pair.java b/src/main/java/com/telstra/Pair.java index cd39848..5279ef6 100755 --- a/src/main/java/com/telstra/Pair.java +++ b/src/main/java/com/telstra/Pair.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ProgressRequestBody.java b/src/main/java/com/telstra/ProgressRequestBody.java index 70b0b62..bd868e5 100755 --- a/src/main/java/com/telstra/ProgressRequestBody.java +++ b/src/main/java/com/telstra/ProgressRequestBody.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/ProgressResponseBody.java b/src/main/java/com/telstra/ProgressResponseBody.java index 0f16275..bc6697b 100755 --- a/src/main/java/com/telstra/ProgressResponseBody.java +++ b/src/main/java/com/telstra/ProgressResponseBody.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/StringUtil.java b/src/main/java/com/telstra/StringUtil.java index 9d2bd71..b9150b7 100755 --- a/src/main/java/com/telstra/StringUtil.java +++ b/src/main/java/com/telstra/StringUtil.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/ApiKeyAuth.java b/src/main/java/com/telstra/auth/ApiKeyAuth.java index d270720..b134410 100755 --- a/src/main/java/com/telstra/auth/ApiKeyAuth.java +++ b/src/main/java/com/telstra/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/Authentication.java b/src/main/java/com/telstra/auth/Authentication.java index cdac669..66a5832 100755 --- a/src/main/java/com/telstra/auth/Authentication.java +++ b/src/main/java/com/telstra/auth/Authentication.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/HttpBasicAuth.java b/src/main/java/com/telstra/auth/HttpBasicAuth.java index bf481bd..c4c142b 100755 --- a/src/main/java/com/telstra/auth/HttpBasicAuth.java +++ b/src/main/java/com/telstra/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/HttpBearerAuth.java b/src/main/java/com/telstra/auth/HttpBearerAuth.java index aecb459..15316ea 100644 --- a/src/main/java/com/telstra/auth/HttpBearerAuth.java +++ b/src/main/java/com/telstra/auth/HttpBearerAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/OAuth.java b/src/main/java/com/telstra/auth/OAuth.java index 79fb178..a6fab86 100755 --- a/src/main/java/com/telstra/auth/OAuth.java +++ b/src/main/java/com/telstra/auth/OAuth.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/auth/OAuthFlow.java b/src/main/java/com/telstra/auth/OAuthFlow.java index 15ddc67..cc9f221 100755 --- a/src/main/java/com/telstra/auth/OAuthFlow.java +++ b/src/main/java/com/telstra/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/messaging/AuthenticationApi.java b/src/main/java/com/telstra/messaging/AuthenticationApi.java index 3a93098..8cd88dc 100755 --- a/src/main/java/com/telstra/messaging/AuthenticationApi.java +++ b/src/main/java/com/telstra/messaging/AuthenticationApi.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/messaging/MessagingApi.java b/src/main/java/com/telstra/messaging/MessagingApi.java index 78198d7..88a49a3 100755 --- a/src/main/java/com/telstra/messaging/MessagingApi.java +++ b/src/main/java/com/telstra/messaging/MessagingApi.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * @@ -391,7 +391,7 @@ public okhttp3.Call mMSHealthCheckCall(final ApiCallback _callback) throws ApiEx Object localVarPostBody = null; // create path and map variables - String localVarPath = "/messages/mms/heathcheck"; + String localVarPath = "/messages/mms/healthcheck"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -798,7 +798,7 @@ public okhttp3.Call sMSHealthCheckCall(final ApiCallback _callback) throws ApiEx Object localVarPostBody = null; // create path and map variables - String localVarPath = "/messages/sms/heathcheck"; + String localVarPath = "/messages/sms/healthcheck"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -906,7 +906,7 @@ public okhttp3.Call sMSHealthCheckAsync(final ApiCallback _ - + @@ -938,7 +938,7 @@ public okhttp3.Call sMSMultiCall(SendSmsMultiRequest payload, final ApiCallback final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] { "auth" }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -966,7 +966,7 @@ private okhttp3.Call sMSMultiValidateBeforeCall(SendSmsMultiRequest payload, fin
Status Code Description Response Headers
200 Success -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when receiptOff is missing or receiptOff=false but notifyURL is missing -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"` but notifyURL is missing -
500 Technical error : Unable to route the message to a Target Endpoint : An error has occurred while processing your request, please refer to API Docs for summary on the issue -
501 The HTTP method being used has not yet been implemented for the requested resource -
503 The service requested is currently unavailable -
- + @@ -988,7 +988,7 @@ public MessageSentResponseSms sMSMulti(SendSmsMultiRequest payload) throws ApiEx
Status Code Description Response Headers
200 Success -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when receiptOff is missing or receiptOff=false but notifyURL is missing -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"` but notifyURL is missing -
500 Technical error : Unable to route the message to a Target Endpoint : An error has occurred while processing your request, please refer to API Docs for summary on the issue -
501 The HTTP method being used has not yet been implemented for the requested resource -
503 The service requested is currently unavailable -
- + @@ -1012,7 +1012,7 @@ public ApiResponse sMSMultiWithHttpInfo(SendSmsMultiRequ
Status Code Description Response Headers
200 Success -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when receiptOff is missing or receiptOff=false but notifyURL is missing -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"` but notifyURL is missing -
500 Technical error : Unable to route the message to a Target Endpoint : An error has occurred while processing your request, please refer to API Docs for summary on the issue -
501 The HTTP method being used has not yet been implemented for the requested resource -
503 The service requested is currently unavailable -
- + diff --git a/src/main/java/com/telstra/messaging/ProvisioningApi.java b/src/main/java/com/telstra/messaging/ProvisioningApi.java index 27128b5..9cf1e1e 100755 --- a/src/main/java/com/telstra/messaging/ProvisioningApi.java +++ b/src/main/java/com/telstra/messaging/ProvisioningApi.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/DeleteNumberRequest.java b/src/main/java/com/telstra/models/DeleteNumberRequest.java index e8d087f..9c6b156 100644 --- a/src/main/java/com/telstra/models/DeleteNumberRequest.java +++ b/src/main/java/com/telstra/models/DeleteNumberRequest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/GetMmsResponse.java b/src/main/java/com/telstra/models/GetMmsResponse.java index 50d2500..b632079 100644 --- a/src/main/java/com/telstra/models/GetMmsResponse.java +++ b/src/main/java/com/telstra/models/GetMmsResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/GetSubscriptionResponse.java b/src/main/java/com/telstra/models/GetSubscriptionResponse.java index 11d2494..a0feacf 100644 --- a/src/main/java/com/telstra/models/GetSubscriptionResponse.java +++ b/src/main/java/com/telstra/models/GetSubscriptionResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/HealthCheckResponse.java b/src/main/java/com/telstra/models/HealthCheckResponse.java index 585f740..513195a 100644 --- a/src/main/java/com/telstra/models/HealthCheckResponse.java +++ b/src/main/java/com/telstra/models/HealthCheckResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/InboundPollResponse.java b/src/main/java/com/telstra/models/InboundPollResponse.java index 5b57214..bad6786 100644 --- a/src/main/java/com/telstra/models/InboundPollResponse.java +++ b/src/main/java/com/telstra/models/InboundPollResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/MMSContent.java b/src/main/java/com/telstra/models/MMSContent.java index 2449f5d..3a41f82 100644 --- a/src/main/java/com/telstra/models/MMSContent.java +++ b/src/main/java/com/telstra/models/MMSContent.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/Message.java b/src/main/java/com/telstra/models/Message.java index ad4a346..b249a74 100644 --- a/src/main/java/com/telstra/models/Message.java +++ b/src/main/java/com/telstra/models/Message.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/MessageMulti.java b/src/main/java/com/telstra/models/MessageMulti.java index be816be..99d4672 100644 --- a/src/main/java/com/telstra/models/MessageMulti.java +++ b/src/main/java/com/telstra/models/MessageMulti.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/MessageSentResponseMms.java b/src/main/java/com/telstra/models/MessageSentResponseMms.java index b6f7920..3d9a86f 100644 --- a/src/main/java/com/telstra/models/MessageSentResponseMms.java +++ b/src/main/java/com/telstra/models/MessageSentResponseMms.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/MessageSentResponseSms.java b/src/main/java/com/telstra/models/MessageSentResponseSms.java index 6946156..5bdf9dd 100644 --- a/src/main/java/com/telstra/models/MessageSentResponseSms.java +++ b/src/main/java/com/telstra/models/MessageSentResponseSms.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/OAuthResponse.java b/src/main/java/com/telstra/models/OAuthResponse.java index 60b64a0..94a84e6 100644 --- a/src/main/java/com/telstra/models/OAuthResponse.java +++ b/src/main/java/com/telstra/models/OAuthResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/OutboundPollResponse.java b/src/main/java/com/telstra/models/OutboundPollResponse.java index 13aa6c9..dfc7d22 100644 --- a/src/main/java/com/telstra/models/OutboundPollResponse.java +++ b/src/main/java/com/telstra/models/OutboundPollResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/ProvisionNumberRequest.java b/src/main/java/com/telstra/models/ProvisionNumberRequest.java index 81a359d..14a8313 100644 --- a/src/main/java/com/telstra/models/ProvisionNumberRequest.java +++ b/src/main/java/com/telstra/models/ProvisionNumberRequest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/ProvisionNumberResponse.java b/src/main/java/com/telstra/models/ProvisionNumberResponse.java index 9816983..c83a7de 100644 --- a/src/main/java/com/telstra/models/ProvisionNumberResponse.java +++ b/src/main/java/com/telstra/models/ProvisionNumberResponse.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/SendMmsRequest.java b/src/main/java/com/telstra/models/SendMmsRequest.java index 8d89d5a..54346e4 100644 --- a/src/main/java/com/telstra/models/SendMmsRequest.java +++ b/src/main/java/com/telstra/models/SendMmsRequest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/SendSMSRequest.java b/src/main/java/com/telstra/models/SendSMSRequest.java index cdc8af2..3d1beff 100644 --- a/src/main/java/com/telstra/models/SendSMSRequest.java +++ b/src/main/java/com/telstra/models/SendSMSRequest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/main/java/com/telstra/models/SendSmsMultiRequest.java b/src/main/java/com/telstra/models/SendSmsMultiRequest.java index c5c2b0b..65f39de 100644 --- a/src/main/java/com/telstra/models/SendSmsMultiRequest.java +++ b/src/main/java/com/telstra/models/SendSmsMultiRequest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * @@ -36,9 +36,9 @@ public class SendSmsMultiRequest { @SerializedName(SERIALIZED_NAME_SMS_MULTI) private List smsMulti = null; - public static final String SERIALIZED_NAME_NOTIY_U_R_L = "notiyURL"; - @SerializedName(SERIALIZED_NAME_NOTIY_U_R_L) - private String notiyURL; + public static final String SERIALIZED_NAME_NOTIFY_U_R_L = "notifyURL"; + @SerializedName(SERIALIZED_NAME_NOTIFY_U_R_L) + private String notifyURL; public SendSmsMultiRequest smsMulti(List smsMulti) { @@ -72,26 +72,26 @@ public void setSmsMulti(List smsMulti) { } - public SendSmsMultiRequest notiyURL(String notiyURL) { + public SendSmsMultiRequest notifyURL(String notifyURL) { - this.notiyURL = notiyURL; + this.notifyURL = notifyURL; return this; } /** - * Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). - * @return notiyURL + * Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). This is required when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"`. + * @return notifyURL **/ @javax.annotation.Nullable - @ApiModelProperty(example = "http://www.example.com/", value = "Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). ") + @ApiModelProperty(example = "http://www.example.com/", value = "Contains a URL that will be called once your message has been processed. The status may be delivered, expired, deleted, etc. Please refer to the Delivery Status section for more information. If you are using a domain URL you must include the forward slash at the end of the URL (e.g. http://www.example.com/). This is required when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"`. ") - public String getNotiyURL() { - return notiyURL; + public String getNotifyURL() { + return notifyURL; } - public void setNotiyURL(String notiyURL) { - this.notiyURL = notiyURL; + public void setNotifyURL(String notifyURL) { + this.notifyURL = notifyURL; } @@ -105,12 +105,12 @@ public boolean equals(java.lang.Object o) { } SendSmsMultiRequest sendSmsMultiRequest = (SendSmsMultiRequest) o; return Objects.equals(this.smsMulti, sendSmsMultiRequest.smsMulti) && - Objects.equals(this.notiyURL, sendSmsMultiRequest.notiyURL); + Objects.equals(this.notifyURL, sendSmsMultiRequest.notifyURL); } @Override public int hashCode() { - return Objects.hash(smsMulti, notiyURL); + return Objects.hash(smsMulti, notifyURL); } @@ -119,7 +119,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SendSmsMultiRequest {\n"); sb.append(" smsMulti: ").append(toIndentedString(smsMulti)).append("\n"); - sb.append(" notiyURL: ").append(toIndentedString(notiyURL)).append("\n"); + sb.append(" notifyURL: ").append(toIndentedString(notifyURL)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/telstra/models/Status.java b/src/main/java/com/telstra/models/Status.java index 6c77235..35f7b9f 100644 --- a/src/main/java/com/telstra/models/Status.java +++ b/src/main/java/com/telstra/models/Status.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/messaging/AuthenticationApiTest.java b/src/test/java/com/telstra/messaging/AuthenticationApiTest.java index 4447162..a586d96 100755 --- a/src/test/java/com/telstra/messaging/AuthenticationApiTest.java +++ b/src/test/java/com/telstra/messaging/AuthenticationApiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/messaging/MessagingApiTest.java b/src/test/java/com/telstra/messaging/MessagingApiTest.java index b240d70..9711bdd 100755 --- a/src/test/java/com/telstra/messaging/MessagingApiTest.java +++ b/src/test/java/com/telstra/messaging/MessagingApiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/messaging/ProvisioningApiTest.java b/src/test/java/com/telstra/messaging/ProvisioningApiTest.java index f1de444..0bdc8d8 100755 --- a/src/test/java/com/telstra/messaging/ProvisioningApiTest.java +++ b/src/test/java/com/telstra/messaging/ProvisioningApiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/DeleteNumberRequestTest.java b/src/test/java/com/telstra/models/DeleteNumberRequestTest.java index 4cf3709..a0a8470 100644 --- a/src/test/java/com/telstra/models/DeleteNumberRequestTest.java +++ b/src/test/java/com/telstra/models/DeleteNumberRequestTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/GetMmsResponseTest.java b/src/test/java/com/telstra/models/GetMmsResponseTest.java index 1273759..1d6b03f 100644 --- a/src/test/java/com/telstra/models/GetMmsResponseTest.java +++ b/src/test/java/com/telstra/models/GetMmsResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java b/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java index e4afb98..c790c39 100644 --- a/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java +++ b/src/test/java/com/telstra/models/GetSubscriptionResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/HealthCheckResponseTest.java b/src/test/java/com/telstra/models/HealthCheckResponseTest.java index 883c01d..f1f6110 100644 --- a/src/test/java/com/telstra/models/HealthCheckResponseTest.java +++ b/src/test/java/com/telstra/models/HealthCheckResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/InboundPollResponseTest.java b/src/test/java/com/telstra/models/InboundPollResponseTest.java index c5e241a..8b10d61 100644 --- a/src/test/java/com/telstra/models/InboundPollResponseTest.java +++ b/src/test/java/com/telstra/models/InboundPollResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/MMSContentTest.java b/src/test/java/com/telstra/models/MMSContentTest.java index 978f853..8c41dfe 100644 --- a/src/test/java/com/telstra/models/MMSContentTest.java +++ b/src/test/java/com/telstra/models/MMSContentTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/MessageMultiTest.java b/src/test/java/com/telstra/models/MessageMultiTest.java index 2be480b..2797468 100644 --- a/src/test/java/com/telstra/models/MessageMultiTest.java +++ b/src/test/java/com/telstra/models/MessageMultiTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java b/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java index 491c9f5..808957f 100644 --- a/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java +++ b/src/test/java/com/telstra/models/MessageSentResponseMmsTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java b/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java index f81a3b8..120ec35 100644 --- a/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java +++ b/src/test/java/com/telstra/models/MessageSentResponseSmsTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/MessageTest.java b/src/test/java/com/telstra/models/MessageTest.java index a0c471d..af88663 100644 --- a/src/test/java/com/telstra/models/MessageTest.java +++ b/src/test/java/com/telstra/models/MessageTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/OAuthResponseTest.java b/src/test/java/com/telstra/models/OAuthResponseTest.java index c098a05..cc73753 100644 --- a/src/test/java/com/telstra/models/OAuthResponseTest.java +++ b/src/test/java/com/telstra/models/OAuthResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/OutboundPollResponseTest.java b/src/test/java/com/telstra/models/OutboundPollResponseTest.java index e35689f..a8c2908 100644 --- a/src/test/java/com/telstra/models/OutboundPollResponseTest.java +++ b/src/test/java/com/telstra/models/OutboundPollResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java b/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java index 68d6433..6842fd2 100644 --- a/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java +++ b/src/test/java/com/telstra/models/ProvisionNumberRequestTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java b/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java index e2171c7..271f1ac 100644 --- a/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java +++ b/src/test/java/com/telstra/models/ProvisionNumberResponseTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/SendMmsRequestTest.java b/src/test/java/com/telstra/models/SendMmsRequestTest.java index 45a6796..ff33b4b 100644 --- a/src/test/java/com/telstra/models/SendMmsRequestTest.java +++ b/src/test/java/com/telstra/models/SendMmsRequestTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/SendSMSRequestTest.java b/src/test/java/com/telstra/models/SendSMSRequestTest.java index 272c382..dba58a9 100644 --- a/src/test/java/com/telstra/models/SendSMSRequestTest.java +++ b/src/test/java/com/telstra/models/SendSMSRequestTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * diff --git a/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java b/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java index 9421681..4ff6f32 100644 --- a/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java +++ b/src/test/java/com/telstra/models/SendSmsMultiRequestTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 * @@ -52,11 +52,11 @@ public void smsMultiTest() { } /** - * Test the property 'notiyURL' + * Test the property 'notifyURL' */ @Test - public void notiyURLTest() { - // TODO: test notiyURL + public void notifyURLTest() { + // TODO: test notifyURL } } diff --git a/src/test/java/com/telstra/models/StatusTest.java b/src/test/java/com/telstra/models/StatusTest.java index 02c6184..e39d686 100644 --- a/src/test/java/com/telstra/models/StatusTest.java +++ b/src/test/java/com/telstra/models/StatusTest.java @@ -1,6 +1,6 @@ /* * Telstra Messaging API - * The API specification for Telstra Messaging API + * The Telstra Messaging API specification * * The version of the OpenAPI document: 2.2.9 *
Status Code Description Response Headers
200 Success -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when receiptOff is missing or receiptOff=false but notifyURL is missing -
400 Invalid or missing request parameters * DR-NOTIFY-URL-MISSING : when `\"receiptOff\"` is missing or `\"receiptOff\":\"false\"` but notifyURL is missing -
500 Technical error : Unable to route the message to a Target Endpoint : An error has occurred while processing your request, please refer to API Docs for summary on the issue -
501 The HTTP method being used has not yet been implemented for the requested resource -
503 The service requested is currently unavailable -