应用管理
获取应用
获取指令的应用详情
agentID := 100003
WeComApp.Agent.Get(ctx,agentID)
获取access_token对应的应用列表
WeComApp.Agent.List(ctx)
设置应用
options := &request.RequestAgentSet{
AgentID: 100003,
ReportLocationFlag: 0,
LogoMediaID: "j5Y8X5yocspvBHcgXMSS6z1Cn9RQKREEJr4ecgLHi4YHOYP-plvom-yD9zNI0vEl",
Name: "财经助手",
Description: "内部财经服务平台",
RedirectDomain: "open.work.weixin.qq.com",
IsReportEnter: 0,
HomeUrl: "https://open.work.weixin.qq.com",
}
WeComApp.Agent.Set(ctx,options)
自定义菜单
创建菜单
options := &request.RequestMenuSet{
Button: []request.RequestMenuSetButton{
{
Type: "click",
Name: "今日歌曲",
Key: "V1001_TODAY_MUSIC",
},
{
Name: "菜单",
SubButton: []request.RequestMenuSetButton{
{
Type: "view",
Name: "搜索",
Url: "http://www.soso.com/",
},
{
Type: "click",
Name: "赞一下我们",
Key: "V1001_GOOD",
},
},
},
},
}
WeComApp.Menu.Create(ctx,options)
获取菜单
WeComApp.Menu.Get(ctx)
删除菜单
agentID := 100003
WeComApp.Menu.Delete(ctx,agentID)
设置工作台自定义展示
设置应用在工作台展示的模版
options := &request.RequestSetWorkbenchTemplate{
AgentID: agentID,
Type: "image",
Image: request.WorkBenchImage{
Url: "xxxx",
JumpUrl: "http://www.qq.com",
PagePath: "pages/index",
},
ReplaceUserData: true,
}
WeComApp.AgentWorkbench.SetWorkbenchTemplate(ctx,options)
获取应用在工作台展示的模版
agentID := 1000005
WeComApp.AgentWorkbench.GetWorkbenchTemplate(ctx,agentID)
设置应用在用户工作台展示的数据
options := &request.RequestSetWorkBenchData{
AgentID: 1000005,
UserID: "test",
Type: "keydata",
KeyData: request.WorkBenchKeyData{
Items: []request.WorkBenchKeyDataItem{
{
Key: "待审批",
Data: "2",
JumpUrl: "http://www.qq.com",
PagePath: "pages/index",
},
{
Key: "带批阅作业",
Data: "4",
JumpUrl: "http://www.qq.com",
PagePath: "pages/index",
},
{
Key: "成绩录入",
Data: "45",
JumpUrl: "http://www.qq.com",
PagePath: "pages/index",
},
{
Key: "综合评价",
Data: "98",
JumpUrl: "http://www.qq.com",
PagePath: "pages/index",
},
},
},
}
WeComApp.AgentWorkbench.SetWorkbenchData(ctx,options)
修改设置工作台自定义开关事件推送
管理员在管理端应用详情页的自定义工作台页面启用或者停用自定义工作台模式时,会推送接收修改设置工作台自定义开关事件推送到应用的回调url上(如果是第三方应用为数据回调url)。事件推送处理过程详见接收消息与事件。(TODO:需要修改成docs url)
使用示例
当前内容版权归 ArtisanCloud 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ArtisanCloud .