【发布时间】:2018-02-24 12:58:57
【问题描述】:
我想在 Spring Boot 应用程序中使用第三方 REST 服务向用户手机号码发送短信。 API如下:
http://cloud.smsindiahub.in/vendorsms/pushsms.aspx?user=abc&password=xyz&msisdn=919898xxxxxx&sid=SenderId&msg=test%20message&fl=0&gwid=2
user: Your login username.
password: Your login password.
msisdn: Single mobile number
sid: Approved sender id(Only 6 characters).
msg: Your message content(Minimum 459 characters/3 messages). Note: If you are using template then edit only the dynamic part which is in ##Field##.
fl: if flash message then 1 or else 0
gwid: 2 (its for Transactions route.)
Note: Only 100 mobile numbers are allowed.
所以我想问我可以在 Spring Boot 中使用RestTemplate 或其他更好的方式吗?
我还想保存如下响应,即 josn 响应:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"381a8090-b230-42fa-ac04-157cc2142bfa","MessageData":[{"MobileNumber":"919898xxxxxx ","MessageParts":[{"MessageId": "919898xxxxxx -67e3765cdf034f438a432eacb88d0c14","MessagePartId":1,"MessageText":"test message"}]}]}
对于 REST API 用户名和密码保存 application.xml 是安全的吗?还有如何在课堂上保存和访问。
如果有任何相同的例子,请给我发送链接。
谢谢。
【问题讨论】:
-
任何人请回复
标签: spring rest spring-boot spring-rest