This post cover how to send transactional SMS using the Alibaba Cloud Short Message Service API.
Transactional SMS usually come with One Time PIN (OTP) to verify the user identity who is using your app. It is considered as one of the common two factor authentication method. The OTP is unique and bind to a specific account and it is generated using hash algorithm. The hash algorithm I would recommend is HMAC based one time password, for more details please refer to this Wiki: https://en.wikipedia.org/wiki/HMAC-based_One-Time_Password. You may also find a lot sample code library available from Google.
Prior in calling the Short Message Service API from your system, you need to create an Access Key first. You need the access key to get authorized to invoke the API method to send SMS.
After creating an Access Key, you can go to the Developer Guide to check out the sample code. I find that Alibaba Cloud have done a very good job in online documentation and even provide a real time interpreter to test the source code on the fly which actually help improving the learning curve of the developer. It allow the developer perform code modification directly from the browser and test the code and monitor the difference.
The highlighted yellow text below from the sample source code is the place where you need to modify base on the Access Key that you had generated earlier. The aqua text below is where you put your HMAC One Time Password.
The following link contain all the possible error codes which is useful for you to troubleshoot any issue when you attempt to send SMS.