Skip to content

通过传播通接口进行消息推送

一、获取用户组

  • URL:/openapi/chuanbo/group_list
  • 请求方式:GET

请求参数

序号参数名称类型必传说明
1connectNoStringconnectNo(线下获取)
2sizeInteger页码 - 默认10
3currentInteger页数 - 默认 1

请求示例-系统通知

Plain
curl --location --request GET 'https://precms.tmuyun.com/openapi/chuanbo/group_list' \
--form 'connectNo="e000b5743a866438"' \
--form 'size="5"' \
--form 'current="1"'

返回参数

编号字段类型说明
1codeint返回编码
2messageString响应消息
3dataobject
编号字段类型说明
1idint用户组id
2titleString用户组名称
3typeint类型 1-导入用户 2-标签组
4departmentString所属部门
5statusint
6operate_timeString操作时间
7operatorString操作人

返回示例

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

请求参数

序号参数名称类型必传说明
1connectNoStringconnectNo(线下获取)
2nameString推送名字
3section_idlong部门id (线下获取)
4chuanbo_type_idlong消息类型 (线下获取)
5
6
7chuanbo_directive_idlong传播指令id
8notify_wayint推送类型 1-系统通知 2-短信推送 3-语音消息
9task_tagString标签,最多8个字符
10link_typeint链接类型 ~~ 0-不跳转 1-外链~~ 2-稿件id 4通知
11link_contentString链接内容
12chuanbo_groupString推送用户组id,多个以逗号隔开
13
14push_iconString消息图标
15push_titleString推送标题,如果是系统通知则必填
16push_contentString推送内容,如果是系统通知则必填
17
18msg_sign_idlong短信签名id,如果是短信推送则必填 (线下获取)
19msg_templateString短信模板,如果是短信推送则必填,最多70字符
20
21voice_contentString语音模板,如果是语音消息则必传,最多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="标签标签标签标签标签标签标签标签"'

返回参数

编号字段类型说明
1codeint返回编码
2messageString响应消息
3dataobject

返回示例

json
{
    "code": 0,
    "message": "success"
}

注意事项

💡 成功返回code是0,非0时均为失败。