Java project uses Alibaba Cloud platform to send SMS instructions

I. Introduction

It is very convenient to send text messages through the Alibaba Cloud SMS platform API on the project, mainly because its official website is easy to use and the documentation is comprehensive and complete. Therefore, the focus of this article is not to explain how to access and use it. Now each SMS platform has strengthened the review, resulting in many restrictions on the application and use of the service, and this article focuses on explaining the details of the application and use.

The general usage process of the SMS platform is: 1. Purchase SMS service; 2. Apply for signature; 3. Apply for SMS template according to the signature; 4. Integrate API to send SMS.

2. Preliminary application work

2.1. Trial and cost issues

For new SMS service users, Alibaba Cloud sent 100 free text messages for testing and debugging, which can be seen directly on the interface for purchasing SMS services.

At present, the nominal price of platform SMS is 0.045 yuan/piece, and other platforms are also equivalent. In fact, SMS is charged according to the number of characters. About 67 characters count as one message (including numbers, letters, and punctuation marks).

2.2. Signature Application Instructions

The SMS signature is the text enclosed by "【】" at the beginning of the SMS.

At present, all major platforms have stepped up SMS review. Individual users can only apply for a test signature for their own use, and the test signature can send text messages such as verification codes, and its functions are limited. It is best to apply for SMS signature directly from the enterprise account, or become an enterprise employee.

If an individual developer needs to apply for a signature due to a project, he needs to prepare materials such as the project address, project business-related screenshots (coded), enterprise business license, and enterprise authorization application (the official website has a template). Otherwise, it is basically impossible to apply.

2.3. Template application

The template application is relatively simple without too many problems. It should be noted that all application reviews will take about 2 hours.

3. The use of SMS platform API

3.1, Access Key and Secret

AccessKey and AccessSecret are necessary parameters for calling SMS API. One account allows multiple accesses to be created. This information is very important and should be kept confidential.

You can either choose to recreate or use the previous one, see Secret.

3.2. API documentation

Click to call the API to send a text message, and the corresponding demo is generated, which is very simple, just copy and paste.

Guess you like

Origin blog.csdn.net/qq_41057885/article/details/128901760