Appearance
通过传播通接口进行消息推送
一、获取用户组
- URL:/openapi/chuanbo/group_list
- 请求方式:GET
请求参数
序号 | 参数名称 | 类型 | 必传 | 说明 |
---|---|---|---|---|
1 | connectNo | String | 是 | connectNo(线下获取) |
2 | size | Integer | 否 | 页码 - 默认10 |
3 | current | Integer | 否 | 页数 - 默认 1 |
请求示例-系统通知
Plain
curl --location --request GET 'https://precms.tmuyun.com/openapi/chuanbo/group_list' \
--form 'connectNo="e000b5743a866438"' \
--form 'size="5"' \
--form 'current="1"'
返回参数
编号 | 字段 | 类型 | 说明 |
---|---|---|---|
1 | code | int | 返回编码 |
2 | message | String | 响应消息 |
3 | data | object |
编号 | 字段 | 类型 | 说明 |
---|---|---|---|
1 | id | int | 用户组id |
2 | title | String | 用户组名称 |
3 | type | int | 类型 1-导入用户 2-标签组 |
4 | department | String | 所属部门 |
5 | status | int | |
6 | operate_time | String | 操作时间 |
7 | operator | String | 操作人 |
返回示例
json
{
"code": 0,
"message": "success",
"data": {
"list": {
"records": [
{
"id": 144,
"title": "xx选择标签",
"type": "2",
"department": "xxx",
"status": "1",
"operate_time": "2024-06-06 15:19:04",
"operator": "demo6",
"tags": [
{
"created_at": 1718075918000,
"created_by": "5bf6694083c7664d036e16f2",
"updated_at": 1718075918000,
"updated_by": "5bf6694083c7664d036e16f2",
"group_id": 144,
"tag_code": "work_unit",
"tag_name": "工作单位",
"tenant_id": 6,
"relational_symbols": "value",
"value1": "太平街道"
}
],
"pnum": 0
}
],
"total": 77,
"size": 1,
"current": 4,
"pages": 77
}
}
}
注意事项
💡 成功返回code是0,非0时均为失败。
二、创建推送
- URL:/openapi/chuanbo/push_create
- 请求方式:POST
请求参数
序号 | 参数名称 | 类型 | 必传 | 说明 |
---|---|---|---|---|
1 | connectNo | String | 是 | connectNo(线下获取) |
2 | name | String | 是 | 推送名字 |
3 | section_id | long | 是 | 部门id (线下获取) |
4 | chuanbo_type_id | long | 否 | 消息类型 (线下获取) |
5 | ||||
6 | ||||
7 | ||||
8 | notify_way | int | 是 | 推送类型 1-系统通知 2-短信推送 3-语音消息 |
9 | task_tag | String | 否 | 标签,最多8个字符 |
10 | link_type | int | 是 | 链接类型 ~~ 0-不跳转 1-外链~~ 2-稿件id 4通知 |
11 | link_content | String | 是 | 链接内容 |
12 | chuanbo_group | String | 是 | 推送用户组id,多个以逗号隔开 |
13 | ||||
14 | push_icon | String | 否 | 消息图标 |
15 | push_title | String | 否 | 推送标题,如果是系统通知则必填 |
16 | push_content | String | 否 | 推送内容,如果是系统通知则必填 |
17 | ||||
18 | msg_sign_id | long | 否 | 短信签名id,如果是短信推送则必填 (线下获取) |
19 | msg_template | String | 否 | 短信模板,如果是短信推送则必填,最多70字符 |
20 | ||||
21 | voice_content | String | 否 | 语音模板,如果是语音消息则必传,最多500字符 |
请求示例-系统通知
Plain
curl --location 'https://precms.tmuyun.com/openapi/chuanbo/push_create' \
--header 'accept: */*' \
--header 'accept-language: zh-CN,zh;q=0.9,en;q=0.8' \
--header 'cookie: _ga=GA1.1.271463132.1704942389; _ga_1MSMD2CRQ5=GS1.1.1704942389.1.1.1704942397.0.0.0; _ga_3EMB6JL0XV=GS1.1.1704942389.1.1.1704942399.50.0.0; JSESSIONID=b0bdafd6-7b83-415f-9d96-7c21b4d62af0' \
--header 'origin: https://testcms.tmuyun.com' \
--header 'priority: u=1, i' \
--header 'sec-ch-ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36' \
--header 'x-request-id: 934f972e-aa53-4fd9-9d92-6bbe2d321b08' \
--header 'x-signature: 65e8478888b93613e08b927ff12f3caeadc0c27f9e6b9b407f8473a0e2fc7306' \
--header 'x-tenant-id: 6' \
--header 'x-timestamp: 1725870195030' \
--form 'name="gateway-系统通知"' \
--form 'section_id="90"' \
--form 'chuanbo_type_id="38"' \
--form 'connectNo="e000b5743a866438"' \
--form 'notify_way="1"' \
--form 'chuanbo_group="123"' \
--form 'tag="标签标签标签标签标签标签标签标签"' \
--form 'push_icon="https://preimg.tmuyun.com/assets/20240910/1725947597162_66dfdecd37fa3d4d774fc6f8.png"' \
--form 'push_title="1111"' \
--form 'push_content="2222"'
请求示例-推送短信
Plain
curl --location 'https://precms.tmuyun.com/openapi/chuanbo/push_create' \
--header 'accept: */*' \
--header 'accept-language: zh-CN,zh;q=0.9,en;q=0.8' \
--header 'cookie: _ga=GA1.1.271463132.1704942389; _ga_1MSMD2CRQ5=GS1.1.1704942389.1.1.1704942397.0.0.0; _ga_3EMB6JL0XV=GS1.1.1704942389.1.1.1704942399.50.0.0; JSESSIONID=b0bdafd6-7b83-415f-9d96-7c21b4d62af0' \
--header 'origin: https://testcms.tmuyun.com' \
--header 'priority: u=1, i' \
--header 'sec-ch-ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36' \
--header 'x-request-id: 934f972e-aa53-4fd9-9d92-6bbe2d321b08' \
--header 'x-signature: 65e8478888b93613e08b927ff12f3caeadc0c27f9e6b9b407f8473a0e2fc7306' \
--header 'x-tenant-id: 6' \
--header 'x-timestamp: 1725870195030' \
--form 'name="gateway-短信通知"' \
--form 'section_id="90"' \
--form 'chuanbo_type_id="38"' \
--form 'connectNo="e000b5743a866438"' \
--form 'notify_way="2"' \
--form 'chuanbo_group="123"' \
--form 'tag="标签标签标签标签标签标签标签标签"' \
--form 'msg_sign_id="50"' \
--form 'msg_template="123123"'
请求示例-推送语音
Plain
curl --location 'https://precms.tmuyun.com/openapi/chuanbo/push_create' \
--header 'accept: */*' \
--header 'accept-language: zh-CN,zh;q=0.9,en;q=0.8' \
--header 'cookie: _ga=GA1.1.271463132.1704942389; _ga_1MSMD2CRQ5=GS1.1.1704942389.1.1.1704942397.0.0.0; _ga_3EMB6JL0XV=GS1.1.1704942389.1.1.1704942399.50.0.0; JSESSIONID=b0bdafd6-7b83-415f-9d96-7c21b4d62af0' \
--header 'origin: https://testcms.tmuyun.com' \
--header 'priority: u=1, i' \
--header 'sec-ch-ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36' \
--header 'x-request-id: 934f972e-aa53-4fd9-9d92-6bbe2d321b08' \
--header 'x-signature: 65e8478888b93613e08b927ff12f3caeadc0c27f9e6b9b407f8473a0e2fc7306' \
--header 'x-tenant-id: 6' \
--header 'x-timestamp: 1725870195030' \
--form 'name="gateway-语音消息"' \
--form 'section_id="90"' \
--form 'chuanbo_type_id="38"' \
--form 'connectNo="e000b5743a866438"' \
--form 'notify_way="3"' \
--form 'voice_content="333333"' \
--form 'chuanbo_group="123"' \
--form 'tag="标签标签标签标签标签标签标签标签"'
返回参数
编号 | 字段 | 类型 | 说明 |
---|---|---|---|
1 | code | int | 返回编码 |
2 | message | String | 响应消息 |
3 | data | object |
返回示例
json
{
"code": 0,
"message": "success"
}
注意事项
💡 成功返回code是0,非0时均为失败。