Scheduled SMS Sending API
Last updated:2021-12-15
Expand all
Scheduled SMS Sending API
- Supports submitting, modifying, querying, and deleting scheduled template SMS sending tasks
HTTP Authentication
Access authorization is performed through HTTP Basic Authentication. In this way, the entire API request can be completed using common HTTP tools such as curl and browser plugins.
Add a field (Key/Value pair) to the HTTP Header:
Authorization: Basic base64_auth_string
Authorization: Basic base64_auth_string
This code block is shown in the floating window
The generation algorithm of base64_auth_string is: base64(appKey:masterSecret), that is, concatenate appKey, a colon, and masterSecret, and then perform base64 conversion. appKey and masterSecret can be viewed in [Jiguang Workbench] - [Application Management] - [Settings & Keys].



Single Scheduled SMS Submission API
Function Description
- Submit a single scheduled template SMS sending task.
Call Address
Request Example
curl --insecure -X POST -v https://api.sms.jpush.cn/v1/schedule -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"mobile": "13812345678",
"sign_id": *,
"temp_id": 1250,
"temp_para": {
"number": "741627"
}
}'
curl --insecure -X POST -v https://api.sms.jpush.cn/v1/schedule -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"mobile": "13812345678",
"sign_id": *,
"temp_id": 1250,
"temp_para": {
"number": "741627"
}
}'
This code block is shown in the floating window
Parameters
| KEY | REQUIRE | DESCRIPTION |
|---|---|---|
| send_time | TRUE | Sending time, in yyyy-MM-dd HH:mm:ss format |
| mobile | TRUE | Mobile number |
| sign_id | FALSE | Signature ID. If this parameter is empty, the app's default signature is used. Note: after the signature passes review, it can be set as the default signature in the console. |
| temp_id | TRUE | Template ID |
| temp_para | FALSE | Template parameters, key-value pairs of parameter names and values to replace |
Response Example
Request Successful
{ "schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e" }
{ "schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e" }
This code block is shown in the floating window
Request Failed
{
"error": {
"code": *****,
"message": "*****"
}
}
{
"error": {
"code": *****,
"message": "*****"
}
}
This code block is shown in the floating window
Batch Scheduled SMS Submission API
Function Description
- Submit a batch scheduled template SMS sending task.
Call Address
Request Example
curl --insecure -X POST -v https://api.sms.jpush.cn/v1/schedule/batch -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"sign_id": *,
"temp_id": 1250,
"tag":"标签",
"recipients": [
{
"mobile": "13812345678",
"temp_para": {
"number": "741627"
}
},
{
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}'
curl --insecure -X POST -v https://api.sms.jpush.cn/v1/schedule/batch -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"sign_id": *,
"temp_id": 1250,
"tag":"标签",
"recipients": [
{
"mobile": "13812345678",
"temp_para": {
"number": "741627"
}
},
{
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}'
This code block is shown in the floating window
Parameters
| KEY | REQUIRE | DESCRIPTION |
|---|---|---|
| send_time | TRUE | Sending time, in yyyy-MM-dd HH:mm:ss format |
| sign_id | FALSE | Signature ID. If this parameter is empty, the app's default signature is used. Note: after the signature passes review, it can be set as the default signature in the console. |
| temp_id | TRUE | Template ID |
| tag | FALSE | Tag, used only as an alias to identify this SMS and not displayed in the SMS. No more than 10 characters. |
| recipients | TRUE | SMS recipient list |
| recipients.mobile | TRUE | Mobile number, up to 1000 |
| recipients.temp_para | FALSE | Template parameters, key-value pairs of parameter names and values to replace |
Response Example
Request Successful
{
"schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e",
"success_count": 1,
"failure_count": 1,
"failure_recipients": [
{
"error_code": "50006",
"error_message": "invalid mobile",
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}
{
"schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e",
"success_count": 1,
"failure_count": 1,
"failure_recipients": [
{
"error_code": "50006",
"error_message": "invalid mobile",
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}
This code block is shown in the floating window
Request Failed
{
"error": {
"code": *****,
"message": "*****"
}
}
{
"error": {
"code": *****,
"message": "*****"
}
}
This code block is shown in the floating window
Single Scheduled SMS Modification API
Function Description
- Modify a single scheduled template SMS sending task.
Call Address
Request Example
curl --insecure -X PUT -v https://api.sms.jpush.cn/v1/schedule/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"mobile": "13812345678",
"sign_id": *,
"temp_id": 1250,
"temp_para": {
"number": "741627"
}
}'
curl --insecure -X PUT -v https://api.sms.jpush.cn/v1/schedule/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"mobile": "13812345678",
"sign_id": *,
"temp_id": 1250,
"temp_para": {
"number": "741627"
}
}'
This code block is shown in the floating window
Parameters
| KEY | REQUIRE | DESCRIPTION |
|---|---|---|
| send_time | TRUE | Sending time, in yyyy-MM-dd HH:mm:ss format |
| mobile | TRUE | Mobile number |
| sign_id | FALSE | Signature ID. If this parameter is empty, the app's default signature is used. Note: after the signature passes review, it can be set as the default signature in the console. |
| temp_id | TRUE | Template ID |
| temp_para | FALSE | Template parameters, key-value pairs of parameter names and values to replace |
Response Example
Request Successful
{ "schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e" }
{ "schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e" }
This code block is shown in the floating window
Request Failed
{
"error": {
"code": *****,
"message": "*****"
}
}
{
"error": {
"code": *****,
"message": "*****"
}
}
This code block is shown in the floating window
Batch Scheduled SMS Modification API
Function Description
- Modify a batch scheduled template SMS sending task.
Call Address
Request Example
curl --insecure -X PUT -v https://api.sms.jpush.cn/v1/schedule/batch/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"sign_id": *,
"temp_id": 1250,
"recipients": [
{
"mobile": "13812345678",
"temp_para": {
"number": "741627"
}
},
{
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}'
curl --insecure -X PUT -v https://api.sms.jpush.cn/v1/schedule/batch/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1" -d \
'{
"send_time": "2017-07-01 09:00:00",
"sign_id": *,
"temp_id": 1250,
"recipients": [
{
"mobile": "13812345678",
"temp_para": {
"number": "741627"
}
},
{
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}'
This code block is shown in the floating window
Parameters
| KEY | REQUIRE | DESCRIPTION |
|---|---|---|
| send_time | TRUE | Sending time, in yyyy-MM-dd HH:mm:ss format |
| sign_id | FALSE | Signature ID. If this parameter is empty, the app's default signature is used. Note: after the signature passes review, it can be set as the default signature in the console. |
| temp_id | TRUE | Template ID |
| recipients | TRUE | SMS recipient list |
| recipients.mobile | TRUE | Mobile number, up to 1000 |
| recipients.temp_para | FALSE | Template parameters, key-value pairs of parameter names and values to replace |
Response Example
Request Successful
{
"schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e",
"success_count": 1,
"failure_count": 1,
"failure_recipients": [
{
"error_code": "50006",
"error_message": "invalid mobile",
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}
{
"schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e",
"success_count": 1,
"failure_count": 1,
"failure_recipients": [
{
"error_code": "50006",
"error_message": "invalid mobile",
"mobile": "18603050709",
"temp_para": {
"number": "147721"
}
}
]
}
This code block is shown in the floating window
Request Failed
{
"error": {
"code": *****,
"message": "*****"
}
}
{
"error": {
"code": *****,
"message": "*****"
}
}
This code block is shown in the floating window
Scheduled SMS Query API
Function Description
- Query a scheduled template SMS sending task.
Call Address
Request Example
curl --insecure -X GET -v https://api.sms.jpush.cn/v1/schedule/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1"
curl --insecure -X GET -v https://api.sms.jpush.cn/v1/schedule/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1"
This code block is shown in the floating window
Response Example
Request Successful
{
"schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e",
"send_time": "2017-07-01 09:00:00",
"temp_id": 1250,
"recipients": [
{
"msg_id": "274887115920",
"mobile": "13812345678",
"temp_para": {
"number": "741627"
}
}
]
}
{
"schedule_id": "1a886e7c-a267-49e6-9970-0d396ca5bb1e",
"send_time": "2017-07-01 09:00:00",
"temp_id": 1250,
"recipients": [
{
"msg_id": "274887115920",
"mobile": "13812345678",
"temp_para": {
"number": "741627"
}
}
]
}
This code block is shown in the floating window
Request Failed
{
"error": {
"code": *****,
"message": "*****"
}
}
{
"error": {
"code": *****,
"message": "*****"
}
}
This code block is shown in the floating window
Scheduled SMS Deletion API
Function Description
- Delete a scheduled template SMS sending task.
Call Address
Request Example
curl --insecure -X DELETE -v https://api.sms.jpush.cn/v1/schedule/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1"
curl --insecure -X DELETE -v https://api.sms.jpush.cn/v1/schedule/1a886e7c-a267-49e6-9970-0d396ca5bb1e -H "Content-Type: application/json" -u "7d431e42dfa6a6d693ac2d04:5e987ac6d2e04d95a9d8f0d1"
This code block is shown in the floating window
Response Example
Request Successful
HTTP/1.0 200
Content-Type: application/json
Content-Length: 0
HTTP/1.0 200
Content-Type: application/json
Content-Length: 0
This code block is shown in the floating window
Request Failed
{
"error": {
"code": *****,
"message": "*****"
}
}
{
"error": {
"code": *****,
"message": "*****"
}
}
This code block is shown in the floating window
Response Codes
Was this document helpful?