|
|
Posted on 9/27/2021 9:22:26 AM
|
|
|
|

In the past, .NET/C# was used to send SMS, but today we use Java language to call Alibaba Cloud's SDK to realize the function of sending SMS verification codes.
Official documentation:The hyperlink login is visible.
Review:
Let's take a look at the renderings of successfully sending verification code SMS as follows:
First, you need to apply for accessKeyId and accessKeySecret in the Alibaba Cloud backend.
I Java is a maven project, which can be installed by POM file ingestion, as follows:
If you are using the upgraded SDK (dysmsapi20170525)
Initialize the client with the following code:
I call the SendBatchSms interface to send SMS messages in batches, which supports sending SMS messages with different signatures to multiple different mobile phone numbers in a single request. Mobile phone number and other parameters are in JSON format, the number of fields is the same, one by one, the SMS service judges the signature sent to the specified mobile phone number according to the order of the fields in JSON, in a request,You can send up to 100 mobile numbersSend text messages separately.
API documentation:The hyperlink login is visible.
The code is as follows:
The call returns something successful:
{"headers":{"access-control-allow-origin":"*","date":"Mon, 27 Sep 2021 01:06:36 GMT","content-length":"110","access-control-max-age":"172800","x-acs-request-id":"xxx"," access-control-allow-headers":"X-Requested-With, X-Sequence, _aop_secret, _aop_signature","connection":"keep-alive","content-type":"application/json; charset=utf-8","access-control-allow-methods":"POST, GET, OPTIONS"},"body":{"code":"OK","message":"OK","bizId":"xxx^0","requestId":"xxx"}}
(End)
|
Previous:The difference between Expression<Func<T, bool>> and Func<T, bool> in EFNext:The difference between VSphere, ESXi, and VCenter
|