Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Documentation (Alibaba SMS)

Description

This document explains the Alibaba SMS service and the guidelines for the integration through the API.

Credentials

There are two methods for signing in to the Alibaba console, using the Alibaba Cloud account or using the RAM user.

A Resource Access Management (RAM) user is a physical identity. You can create RAM users for an Alibaba Cloud account and authorize the RAM users to access different resources. URL: https://account.alibabacloud.com/login/login.htm

Alibaba Cloud Account

- email: surasit@hungryhub.com
- password: )B$fwd6gYRht*kx123

RAM user

email: firman@5684639719423093.onaliyun.com
password: 7!|gyLn(zxj2TYPJ9YAbMEgCbb4sl&LH

API References

[

Developer Reference - Short Message Service - Alibaba Cloud Documentation Center

Developer Reference,Short Message Service:

https://www.alibabacloud.com/help/en/sms/developer-reference/

](https://www.alibabacloud.com/help/en/sms/developer-reference/)

https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/download%2Fpdf%2F159880%2FAPI_Reference_intl_en-US.pdf There are two methods for integrating with Alibaba SMS service:

  1. API or SDKs - https://www.alibabacloud.com/help/en/sms/getting-started/use-sms-api-or-sdks-1
  2. SMS console - https://www.alibabacloud.com/help/en/sms/getting-started/use-sms-console

This diagram shows the flow how to configure the SMS service

Dialing Codes

Alibaba Cloud Short Message Service (SMS) is available in more than 200 countries and regions. A dialing code indicates the destination country or region to which you send messages.

[

Dialing codes - Short Message Service - Alibaba Cloud Documentation Center

Dialing codes,Short Message Service:Alibaba Cloud Short Message Service (SMS) is available in more than 200 countries and regions. A dialing code indicates the destination country or region to which you send messages.

https://www.alibabacloud.com/help/en/sms/product-overview/dialing-codes

](https://www.alibabacloud.com/help/en/sms/product-overview/dialing-codes)

Endpoints (Base URLs)

There are different endpoint or base URL for each country

[

Endpoints - Short Message Service - Alibaba Cloud Documentation Center

Endpoints,Short Message Service:Asia PacificRegion nameRegion IDPublic network access addressVPC access addressChina (Beijing)cn-beijingdysmsapi.aliyuncs.comChina (Zhangjiakou)cn-zhangjiakoudysmsapi.aliyuncs.comChina (Hohhot)cn-huhe...

https://www.alibabacloud.com/help/en/sms/developer-reference/api-dysmsapi-2018-05-01-endpoint

](https://www.alibabacloud.com/help/en/sms/developer-reference/api-dysmsapi-2018-05-01-endpoint)

Test messages

If you have not published your application or service, you can use the Alibaba Cloud SMS console to send test messages.

[

Send a test message - - Alibaba Cloud Documentation Center

Send a test message,:This topic describes how to send a test message by using the test feature in the Alibaba Cloud Short Message Service (SMS) console. For information about the video tutorial, see Send test messages.

https://www.alibabacloud.com/help/en/sms/send-test-messages-2#topic954

](https://www.alibabacloud.com/help/en/sms/send-test-messages-2#topic954)

You can use the temporary number for test sending the SMS for specific country, for example, you can use this website:

[

Receive SMS online | Temporary Phone Number | Thailand Phone Number

receive-smss.com is a free website to receive SMS and voice mail online. You can use it from all the countries and for Gmail,Facebook,Linked and more

https://receive-smss.com/sms/66993592971/

](https://receive-smss.com/sms/66993592971/)

Error Codes

[

Error codes - Short Message Service - Alibaba Cloud Documentation Center

Error codes,Short Message Service:This topic aims to provide a comprehensive list of error codes and response status that you may come across when using Alibaba Cloud Short Message Service (SMS) API. This page serves as a comprehensiv...

https://www.alibabacloud.com/help/en/sms/developer-reference/error-codes

](https://www.alibabacloud.com/help/en/sms/developer-reference/error-codes)

Authentication and Authorization

You can obtain the AccessKey ID and AccessKey secret on the AccessKey Management page in the Alibaba Cloud Management Console. The AccessKey ID is used to verify the identity of the user, while the AccessKey secret is used to encrypt and verify the signature string. You must keep your AccessKey secret strictly confidential.

API Credentials

AccessKeyID: LTAI5tBHQhLVfQ6fb52VrQST
AccessKeySecret: hcC9PKocbH3RcEyDwGDNC1aHkhjznE 

Here is the documentation about how to generate the signature for authentication and authorization

[

Signature method - - Alibaba Cloud Documentation Center

Signature method,:This topic describes how requests are signed. You must sign all HTTP or HTTPS API requests to ensure security. Alibaba Cloud uses the request signature to verify the identity of the request sender. Al...

https://www.alibabacloud.com/help/en/sms/signature-method#concept-2084170

](https://www.alibabacloud.com/help/en/sms/signature-method#concept-2084170)

Sending the SMS

SendMessageToGlobe

We will use the SendMessageToGlobe endpoint for sending the SMS through Alibaba SMS. SendMessageToGlobe is for sending a message to regions outside the Chinese mainland. Before sending the SMS, first we need to register the sender and the Alibaba team will verify the identity submitted. We can submit the sender registrations here

[

阿里云登录 - 欢迎登录阿里云,安全稳定的云计算服务平台

欢迎登录阿里云,全球领先的云计算及人工智能科技公司,阿里云为200多个国家和地区的企业、开发者和政府机构提供云计算基础服务及解决方案。阿里云云计算、安全、大数据、人工智能、企业应用、物联网等云计算服务。

https://sms-intl.console.aliyun.com/senderid/apply

](https://sms-intl.console.aliyun.com/senderid/apply)

You cannot call the SendMessageToGlobe operation to send messages to the Chinese mainland. Here is the complete documentation about SendMessageToGlobe

[

SendMessageToGlobe - Short Message Service - Alibaba Cloud Documentation Center

SendMessageToGlobe,Short Message Service:Sends a message to regions outside the Chinese mainland. You cannot call the SendMessageToGlobe operation to send messages to the Chinese mainland.

https://www.alibabacloud.com/help/en/sms/developer-reference/api-dysmsapi-2018-05-01-sendmessagetoglobe

](https://www.alibabacloud.com/help/en/sms/developer-reference/api-dysmsapi-2018-05-01-sendmessagetoglobe)

Notes for Quota Per Second (QPS):

You may call this operation up to 300 times per second. If the number of calls per second exceeds this limit, throttling will be triggered. This can potentially impact your business operations. Therefore, we recommend that you take note of this limit when making calls to this operation.

QueryMessage

We will use the QueryMessage endpoint for checking the delivery of the SMS.

You can call this operation up to 300 times per second. If the number of the calls per second exceeds a limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limits when you call this operation.

[

QueryMessage - Short Message Service - Alibaba Cloud Documentation Center

QueryMessage,Short Message Service:Queries the delivery report of a message. You can call this operation up to 300 times per second. If the number of the calls per second exceeds a limit, throttling is triggered. As a result, your busi...

https://www.alibabacloud.com/help/en/sms/developer-reference/api-dysmsapi-2018-05-01-querymessage

](https://www.alibabacloud.com/help/en/sms/developer-reference/api-dysmsapi-2018-05-01-querymessage)

SMS Webhook

We can configure an MNS queue or HTTP URL to receive receipt messages or MO messages based on our needs.

  1. MNS queues
  • You can configure an MNS queue to receive delivery receipts from a specified region. MNS queues support all message types of Alibaba Cloud Short Message Service (SMS). After you enable MNS to subscribe to a specified message type in the SMS console, MNS automatically generates a queue. You can call SMS SDKs to pull delivery receipts by message type and queue name.
  1. HTTP URLs
  • You can set up an HTTP URL to receive delivery receipts or MO messages for SMS. To achieve this, SMS utilizes the HTTP POST method to push delivery receipts or MO messages to the specified HTTP URL. You can configure the HTTP callback URL in the Alibaba Cloud SMS console. When a service message is generated, the system sends an HTTP POST request containing the delivery receipt to the designated callback URL. This allows you to receive the message directly.

[

Configure delivery receipts - Short Message Service - Alibaba Cloud Documentation Center

Configure delivery receipts,Short Message Service:By configuring a Message Service (MNS) queue or an HTTP URL, you can receive delivery receipts after you send your messages. This enables you to monitor the delivery status of your messages and deploy...

https://www.alibabacloud.com/help/en/sms/developer-reference/configure-delivery-receipts-2

](https://www.alibabacloud.com/help/en/sms/developer-reference/configure-delivery-receipts-2)

References