跳到主要内容

Rest接口服务端发送 - PubSub(Websocket)

RESTful API

URL:

POST http(s)://rest-hz.goeasy.io/v2/pubsub/publish    //新加坡区域host为: rest-singapore.goeasy.io

JSON格式请求体

    {
appkey: "您的appkey", //必填,您的appkey
channel: "test_channel", //必填,channel
content: "hello, GoEasy!", //必填,您要发送的消息内容
}

参数:

名称必要描述
appkey您的appkey
channelchannel
content您要发送的消息内容

请求示例


curl -X POST https://rest-hz.goeasy.io/v2/pubsub/publish \\
-H "Content-Type: application/json" \\
-d "{
'appkey':'您的appkey',
'channel':'test_channel',
'content':'Hello, GoEasy!'
}"

返回值:

{
"code" : 200,
"content" : "OK"
}