推送消息

Notification

post
sendmessage

https://api.st.link/angelia/sendmessage/:code/:token/:message/:yesheartbeat
推送消息(简易模式)
Request
Response
Path Parameters
code
required
string
机器码
token
required
string
令牌
message
required
string
文本消息(需要进行URL编码)
yesheartbeat
optional
string
启用心跳检测(如无需检测,忽略此参数即可)
Headers
Content-Type
required
string
application/json
200: OK
Cake successfully retrieved.
{
"errcode": 0,
"timestamp": 1560163033,
"noheartbeat": "禁用心跳检测"
}
CURL
curl -X POST \
https://api.st.link/angelia/sendmessage/xxxxxx/xxxxxx/%E6%B5%8B%E8%AF%95 \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache'
Demo - Python 3.6
import requests
code = 'xxxxx'
token = 'xxxxx'
message = '%E6%B5%8B%E8%AF%95'
# 推送消息 - 默认关闭心跳检测
# requests.post('https://api.st.link/angelia/sendmessage/{}/{}/{}'.format(code, token, message))
# 推送消息 - 开启心跳检测
# requests.post('https://api.st.link/angelia/sendmessage/{}/{}/{}/yesheartbeat'.format(code, token, message))

post
botpublish

https://api.st.link/angelia/botpublish
发送消息(普通模式)
Request
Response
Body Parameters
code
required
string
机器码
token
required
string
令牌
message
required
string
消息文本
link
required
string
消息链接
noheartbeat
required
boolean
是否关闭心跳检测
200: OK
{
"errcode": 0,
"timestamp": 1560104611,
"noheartbeat": "禁用心跳检测"
}
CURL
curl -X POST \
https://api.st.link/angelia/botpublish \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"code": "xxxxxx",
"token": "xxxxxx",
"message": "Test100002",
"link": "https://angelia.codeeer.com",
"noheartbeat": true
}'
Demo - Python 3.6
import requests
import json
param = {}
param['code'] = 'xxxxxx'
param['token'] = 'xxxxxx'
param['message'] = 'Hi, there!'
param['link'] = 'https://angelia.codeeer.com'
param['noheartbeat'] = True
requests.post('https://api.st.link/angelia/botpublish',
headers={'Content-Type': 'application/json'},
json=param,
timeout=10)