信使接口文档
创建信使项目
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | create_messenger_project |
| actionid | 否 | string | |
| name | 是 | string | 名称 |
| alias | 是 | string | 别名 |
| description | 否 | string | 描述 |
| config | 是 | object | 项目配置 |
| service_provider | 是 | string | 服务商类型 |
响应参数:
{
"resp": "create_messenger_project",
"code": 200,
"msg": "成功",
"result": {
"id": 7,
"uid": "MSP3983774700010"
},
"actionid": ""
}编辑信使项目
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | update_messenger_project |
| actionid | 否 | string | |
| Id | 是 | int | ID |
| uid | 是 | string | 编号 |
| name | 是 | string | 名称 |
| alias | 是 | string | 别名 |
| description | 否 | string | 描述 |
| config | 是 | object | 项目配置 |
| service_provider | 是 | string | 服务商类型 |
响应参数:
{
"resp": "update_messenger_project",
"code": 200,
"msg": "成功",
"result": {
"id": 7,
"uid": "MSP3983774700010"
},
"actionid": ""
}删除信使项目
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | delete_messenger_project |
| actionid | 否 | string | |
| Id | 是 | int | ID |
响应参数:
{
"resp": "delete_messenger_project",
"code": 200,
"msg": "成功",
"result": {
"id": 7,
"uid": "MSP3983774700010"
},
"actionid": ""
}启动信使项目
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | start_messenger_project |
| actionid | 否 | string | |
| Id | 是 | int | ID |
响应参数:
{
"resp": "start_messenger_project",
"code": 200,
"msg": "成功",
"result": {
"id": 7,
"uid": "MSP3983774700010"
},
"actionid": ""
}停止信使项目
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | stop_messenger_project |
| actionid | 否 | string | |
| Id | 是 | int | ID |
响应参数:
{
"resp": "stop_messenger_project",
"code": 200,
"msg": "成功",
"result": {
"id": 7,
"uid": "MSP3983774700010"
},
"actionid": ""
}获取信使项目详情
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | get_messenger_project_item |
| actionid | 否 | string | |
| Id | 是 | int | ID |
响应参数:
{
"resp": "get_messenger_project_item",
"code": 200,
"msg": "成功",
"result": {
"id": 7,
"uid": "MSP3983774700010",
"name": "tttt",
"organization_id": "ORGANIZATION1658222117234135",
"description": "",
"send_mode": 1,
"route": 4,
"service_provider": "smtp",
"class_id": "email",
"is_active": 0,
"create_at": "2023-09-08 16:15:37",
"update_at": "2023-09-08 16:15:37",
"save_history_to_db": 0
},
"actionid": ""
}获取信使项目列表
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | 指令:get_messenger_project_list |
| actionid | 否 | string | 指令编号 |
| page_index | 否 | int | 当前页 |
| page_size | 否 | int | 每页数 |
| where_and | 否 | string | and 条件 |
| where_in | 否 | string | in 条件 |
| where_or | 否 | string | or 条件 |
响应参数:
{
"resp": "get_messenger_project_list",
"code": 200,
"msg": "成功",
"result": {
"page_index": 1,
"page_size": 20,
"total_pages": 1,
"total_records": 7,
"data": [
{
"id": 1,
"uid": "MSP3664769700003",
"name": "邮箱推送",
"organization_id": "ORGANIZATION1658222117234136",
"description": "",
"send_mode": 1,
"route": 1,
"service_provider": "smtp",
"class_id": "email",
"is_active": 1,
"create_at": "2023-06-06 11:26:47",
"update_at": "2023-07-10 18:06:03",
"save_history_to_db": 0
}
]
},
"actionid": ""
}Email(发送邮件)
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | send-email |
| actionid | 否 | string | |
| project_id | 是 | int | 信使项目主键ID |
| email_group | 是 | object | 消息体 |
| + EmailSubject | 是 | string | 主题 |
| + EmailContent | 是 | string | 内容 |
| + EmailFile | 否 | string | 主题 |
| send_user_group | 是 | array | 接受消息的邮箱 |
响应参数:
{
"code": 200,
"msg": "success",
"info": "",
"result": "发送成功"
}SMS(发送短信)
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | send-sms |
| actionid | 否 | string | |
| project_id | 是 | int | 信使项目主键ID |
| tpl_params | 否 | array | 华为短信模板中定义的变量组 |
| sms_group | 否 | object | 消息体 ,使用 tpl_params还是sms_group取决于华为云短信模板 |
| + msgdata | 是 | string | 消息内容 |
| send_user_group | 是 | array | 接受消息的手机号 |
响应参数:
{
"code": 200,
"msg": "success",
"info": "",
"result": "发送成功"
}
APP(app推送)
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | send-app-push |
| actionid | 否 | string | |
| project_id | 是 | int | 信使项目主键ID |
| title | 是 | string | 消息标题 |
| content | 是 | string | 消息内容 |
| payload | 是 | string | 消息附加信息 |
| send_user_group | 是 | array | 接受消息的设备标识 |
响应参数:
{
"code": 200,
"msg": "success",
"info": "",
"result": "发送成功"
}
钉钉应用消息/钉钉机器人
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | send-ding-talk/send-ding-robot |
| actionid | 否 | string | |
| project_id | 是 | int | 信使项目主键ID |
| title | 是 | string | 消息标题 |
| content | 是 | string | 消息内容 |
| payload | 是 | string | 消息附加信息 |
| send_user_group | 是 | array | 接受消息的手机号 |
响应参数:
{
"code": 200,
"msg": "success",
"info": "",
"result": "发送成功"
}企业微信应用消息/企业微信机器人
请求参数:
| 参数名称 | 是否必选 | 数据类型 | 描述 |
|---|---|---|---|
| action | 是 | string | send-corp-wechat/send-corp-wechat-robot |
| actionid | 否 | string | |
| project_id | 是 | int | 信使项目主键ID |
| title | 是 | string | 消息标题 |
| content | 是 | string | 消息内容 |
| payload | 是 | string | 消息附加信息 |
| send_user_group | 是 | array | 接受消息的手机号 |
响应参数:
{
"code": 200,
"msg": "success",
"info": "",
"result": "发送成功"
}文档更新时间: 2024-08-09 12:26 作者:技术支持