被动回复消息格式
如何被动回复消息在使用接收消息已经说明,本小节是对回复消息的结构体的说明
文本消息
<xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>1348831860</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[this is a test]]></Content></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | 消息类型,此时固定为:text |
Content | 文本消息内容,最长不超过2048个字节,超过将截断 |
图片消息
<xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>1348831860</CreateTime> <MsgType><![CDATA[image]]></MsgType> <Image> <MediaId><![CDATA[media_id]]></MediaId> </Image></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | 消息类型,此时固定为:image |
MediaId | 图片媒体文件id,可以调用获取媒体文件接口拉取 |
语音消息
<xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[voice]]></MsgType> <Voice> <MediaId><![CDATA[media_id]]></MediaId> </Voice></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | 消息类型,此时固定为:voice |
MediaId | 语音文件id,可以调用获取媒体文件接口拉取 |
视频消息
<xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[video]]></MsgType> <Video> <MediaId><![CDATA[media_id]]></MediaId> <Title><![CDATA[title]]></Title> <Description><![CDATA[description]]></Description> </Video></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | 消息类型,此时固定为:video |
MediaId | 视频文件id,可以调用获取媒体文件接口拉取 |
Title | 视频消息的标题,不超过128个字节,超过会自动截断 |
Description | 视频消息的描述,不超过512个字节,超过会自动截断 |
图文消息
<xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>12345678</CreateTime> <MsgType><![CDATA[news]]></MsgType> <ArticleCount>2</ArticleCount> <Articles> <item> <Title><![CDATA[title1]]></Title> <Description><![CDATA[description1]]></Description> <PicUrl><![CDATA[picurl]]></PicUrl> <Url><![CDATA[url]]></Url> </item> <item> <Title><![CDATA[title]]></Title> <Description><![CDATA[description]]></Description> <PicUrl><![CDATA[picurl]]></PicUrl> <Url><![CDATA[url]]></Url> </item> </Articles></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | 消息类型,此时固定为:news |
ArticleCount | 图文消息的数量 |
Title | 标题,不超过128个字节,超过会自动截断 |
Description | 描述,不超过512个字节,超过会自动截断 |
Url | 点击后跳转的链接。 |
PicUrl | 图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图640320,小图8080。 |
模板卡片更新消息
更新点击用户的按钮文案
更新按钮的文案,同时按钮自动变更为不可点击的状态
仅原卡片为按钮交互型、投票选择型、多项选择型的卡片支持更新点击用户的按钮文案
<xml> <ToUserName><![CDATA[toUser]]></ToUserName> <FromUserName><![CDATA[fromUser]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[update_button]]></MsgType> <Button> <ReplaceName><![CDATA[ReplaceName]]></ReplaceName> </Button></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | 消息类型,此时固定为:update_button |
Button.ReplaceName | 点击卡片按钮后显示的按钮名称 |
更新点击用户的整张卡片
应用可更新点击者本人的整张消息卡片,消息卡片有5种类型的选择,卡片的表现与发送应用消息中的模板卡片消息一致。
文本通知型
<xml> <ToUserName><![CDATA[ToUserName]]></ToUserName> <FromUserName><![CDATA[FromUserName]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[update_template_card]]></MsgType> <TemplateCard> <CardType><![CDATA[text_notice]]></CardType> <Source> <IconUrl><![CDATA[source_url]]></IconUrl> <Desc><![CDATA[更新后的卡片]]></Desc> <DescColor>2</DescColor> </Source> <MainTitle> <Title><![CDATA[更新后的卡片标题]]></Title> <Desc><![CDATA[更新后的卡片副标题]]></Desc> </MainTitle> <SubTitleText><![CDATA[更新后的卡片二级标题]]></SubTitleText> <HorizontalContentList> <KeyName><![CDATA[应用名称]]></KeyName> <Value><![CDATA[企业微信]]></Value> </HorizontalContentList> <HorizontalContentList> <KeyName><![CDATA[跳转企业微信]]></KeyName> <Value><![CDATA[跳转企业微信]]></Value> <Type>1</Type> <Url><![CDATA[url]]></Url> </HorizontalContentList> <JumpList> <Title><![CDATA[跳转企业微信]]></Title> <Type>1</Type> <Url><![CDATA[jump_url]]></Url> </JumpList> <CardAction> <Title><![CDATA[跳转企业微信]]></Title> <Type>1</Type> <Url><![CDATA[jump_url]]></Url> </CardAction> <EmphasisContent> <Title><![CDATA[100万]]></Title> <Desc><![CDATA[核心数据实例]]></Desc> </EmphasisContent> <ActionMenu> <Desc><![CDATA[您可以使用以下功能]]></Desc> <ActionList> <Text><![CDATA[您将收到A回调]]></Text> <Key><![CDATA[A]]></Key> </ActionList> <ActionList> <Text><![CDATA[您将收到B回调]]></Text> <Key><![CDATA[B]]></Key> </ActionList> </ActionMenu> <QuoteArea> <Type>1</Type> <Url><![CDATA[quote_area_url]]></Url> <Title><![CDATA[企业微信]]></Title> <QuoteText><![CDATA[企业微信真好用呀]]></QuoteText> </QuoteArea> </TemplateCard></xml>
参数 | 说明 | |
---|---|---|
ToUserName | 成员UserID | |
FromUserName | 企业微信CorpID | |
CreateTime | 消息创建时间(整型) | |
MsgType | update_template_card | |
TemplateCard.CardType | 模板卡片类型,文本通知型填写 “text_notice” | |
TemplateCard.Source | 卡片来源样式信息,不需要来源样式可不填写 | |
TemplateCard.Source.IconUrl | 来源图片的url | |
TemplateCard.Source.Desc | 来源图片的描述 | |
TemplateCard.Source.DescColor | 来源文字的颜色,目前支持:0(默认) 灰色,1 黑色,2 红色,3 绿色 | |
TemplateCard.MainTitle.Title | 一级标题,文本通知型卡片本字段非必填,但不可本字段和sub_title_text都不填 | |
TemplateCard.MainTitle.Desc | 标题辅助信息 | |
TemplateCard.SubTitleText | 二级普通文本 | |
TemplateCard.HorizontalContentList | 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 | |
TemplateCard.HorizontalContentList.Type | 链接类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表下载附件,3 代表点击跳转成员详情 | |
TemplateCard.HorizontalContentList.KeyName | 二级标题,必填 | |
TemplateCard.HorizontalContentList.Value | 二级文本 ,如果HorizontalContentList.Type是2,该字段代表文件名称(要包含文件类型) | |
TemplateCard.HorizontalContentList.Url | 链接跳转的url,HorizontalContentList.Type是1时必填 | |
TemplateCard.HorizontalContentList.MediaId | 附件的media_id,HorizontalContentList.Type是2时必填 | |
TemplateCard.HorizontalContentList.UserId | 成员详情的userid,HorizontalContentList.Type是3时必填 | |
TemplateCard.JumpList | 跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3 | |
TemplateCard.JumpList.Type | 跳转链接类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表跳转小程序 | |
TemplateCard.JumpList.Title | 跳转链接样式的文案内容,必填 | |
TemplateCard.JumpList.Url | 跳转链接的url,JumpList.Type是1时必填 | |
TemplateCard.JumpList.AppId | 跳转链接的小程序的appid,JumpList.Type是2时必填 | |
TemplateCard.JumpList.PagePath | 跳转链接的小程序的pagepath,JumpList.Type是2时选填 | |
TemplateCard.CardAction | 整体卡片的点击跳转事件,必填 | |
TemplateCard.CardAction.Type | 跳转事件类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表下载附件 | |
TemplateCard.CardAction.Url | 跳转事件的url,CardAction.Type是1时必填 | |
TemplateCard.CardAction.AppId | 跳转事件的小程序的appid,CardAction.Type是2时必填 | |
TemplateCard.CardAction.PagePath | 跳转事件的小程序的pagepath,CardAction.Type是2时选填 | |
TemplateCard.EmphasisContent.Title | 关键数据样式的数据内容 | |
TemplateCard.EmphasisContent.Desc | 关键数据样式的数据描述内容 | |
TemplateCard.ActionMenu | 卡片右上角更多操作按钮容 | |
TemplateCard.ActionMenu.Desc | 更多操作界面的描述 | |
TemplateCard.ActionMenu.ActionList | 操作列表,列表长度取值范围为 [1, 10] | |
TemplateCard.ActionMenu.ActionList.Text | 操作的描述文案 | |
TemplateCard.ActionMenu.ActionList.Key | 操作key值,用户点击后,会产生回调事件将本参数作为EventKey回调,最长支持1024字节,不可重复,必填 | |
TemplateCard.QuoteArea | 引用文献样式 | |
TemplateCard.QuoteArea.Type | 引用文献样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 | |
TemplateCard.QuoteArea.Url | 点击跳转的url,QuoteArea.Type是1时必填 | |
TemplateCard.QuoteArea.Appid | 点击跳转的小程序的appid,必须是与当前应用关联的小程序,QuoteArea.Type是2时必填 | |
TemplateCard.QuoteArea.PagePath | 点击跳转的小程序的pagepath,QuoteArea.Type是2时选填 | |
TemplateCard.QuoteArea.Title | 引用文献样式的标题 | |
TemplateCard.QuoteArea.QuoteText | 引用文献样式的引用文案 |
图文展示型
<xml> <ToUserName><![CDATA[ToUserName]]></ToUserName> <FromUserName><![CDATA[FromUserName]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[update_template_card]]></MsgType> <TemplateCard> <CardType><![CDATA[news_notice]]></CardType> <Source> <IconUrl><![CDATA[source_url]]></IconUrl> <Desc><![CDATA[更新后的卡片]]></Desc> <DescColor>2</DescColor> </Source> <MainTitle> <Title><![CDATA[更新后的卡片标题]]></Title> <Desc><![CDATA[更新后的卡片副标题]]></Desc> </MainTitle> <HorizontalContentList> <KeyName><![CDATA[应用名称]]></KeyName> <Value><![CDATA[企业微信]]></Value> </HorizontalContentList> <HorizontalContentList> <KeyName><![CDATA[跳转企业微信]]></KeyName> <Value><![CDATA[跳转企业微信]]></Value> <Type>1</Type> <Url><![CDATA[url]]></Url> </HorizontalContentList> <JumpList> <Title><![CDATA[跳转企业微信]]></Title> <Type>1</Type> <Url><![CDATA[jump_url]]></Url> </JumpList> <CardAction> <Title><![CDATA[跳转企业微信]]></Title> <Type>1</Type> <Url><![CDATA[jump_url]]></Url> </CardAction> <CardImage> <Url><![CDATA[image_url]]></Url> <AspectRatio>1.3</AspectRatio> </CardImage> <VerticalContentList> <Title><![CDATA[卡片二级标题1]]></Title> <Desc><![CDATA[卡片二级内容1]]></Desc> </VerticalContentList> <VerticalContentList> <Title><![CDATA[卡片二级标题2]]></Title> <Desc><![CDATA[卡片二级内容2]]></Desc> </VerticalContentList> <ActionMenu> <Desc><![CDATA[您可以使用以下功能]]></Desc> <ActionList> <Text><![CDATA[您将收到A回调]]></Text> <Key><![CDATA[A]]></Key> </ActionList> <ActionList> <Text><![CDATA[您将收到B回调]]></Text> <Key><![CDATA[B]]></Key> </ActionList> </ActionMenu> <QuoteArea> <Type>1</Type> <Url><![CDATA[quote_area_url]]></Url> <Title><![CDATA[企业微信]]></Title> <QuoteText><![CDATA[企业微信真好用呀]]></QuoteText> </QuoteArea> <ImageTextArea> <Type>1</Type> <Url><![CDATA[image_text_area_url]]></Url> <Title><![CDATA[企业微信]]></Title> <Desc><![CDATA[企业微信真好用呀]]></Desc> <ImageUrl><![CDATA[image_url]]></ImageUrl> </QuoteArea> </TemplateCard></xml>
参数 | 说明 | |
---|---|---|
ToUserName | 成员UserID | |
FromUserName | 企业微信CorpID | |
CreateTime | 消息创建时间(整型) | |
MsgType | update_template_card | |
TemplateCard.CardType | 模板卡片类型,文本通知型填写 “news_notice” | |
TemplateCard.Source | 卡片来源样式信息,不需要来源样式可不填写 | |
TemplateCard.Source.IconUrl | 来源图片的url | |
TemplateCard.Source.Desc | 来源图片的描述 | |
TemplateCard.MainTitle.Title | 一级标题 | |
TemplateCard.MainTitle.Desc | 标题辅助信息 | |
TemplateCard.HorizontalContentList | 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 | |
TemplateCard.HorizontalContentList.Type | 链接类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表下载附件,3 代表点击跳转成员详情 | |
TemplateCard.HorizontalContentList.KeyName | 二级标题,必填 | |
TemplateCard.HorizontalContentList.Value | 二级文本,如果HorizontalContentList.Type是2,该字段代表文件名称(要包含文件类型) | |
TemplateCard.HorizontalContentList.Url | 链接跳转的url,HorizontalContentList.Type是1时必填 | |
TemplateCard.HorizontalContentList.MediaId | 附件的media_id,HorizontalContentList.Type是2时必填 | |
TemplateCard.HorizontalContentList.UserId | 成员详情的userid,HorizontalContentList.Type是3时必填 | |
TemplateCard.JumpList | 跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3 | |
TemplateCard.JumpList.Type | 跳转链接类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表跳转小程序 | |
TemplateCard.JumpList.Title | 跳转链接样式的文案内容,必填 | |
TemplateCard.JumpList.Url | 跳转链接的url,JumpList.Type是1时必填 | |
TemplateCard.JumpList.AppId | 跳转链接的小程序的appid,JumpList.Type是2时必填 | |
TemplateCard.JumpList.PagePath | 跳转链接的小程序的pagepath,JumpList.Type是2时选填 | |
TemplateCard.CardAction | 整体卡片的点击跳转事件,必填 | |
TemplateCard.CardAction.Type | 跳转事件类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表下载附件 | |
TemplateCard.CardAction.Url | 跳转事件的url,CardAction.Type是1时必填 | |
TemplateCard.CardAction.AppId | 跳转事件的小程序的appid,CardAction.Type是2时必填 | |
TemplateCard.CardAction.PagePath | 跳转事件的小程序的pagepath,CardAction.Type是2时选填 | |
TemplateCard.CardImage | 图片展示样式,news_notice类型的卡片,CardImage和ImageTextArea两者必填一个字段,不可都不填 | |
TemplateCard.CardImage.Url | 图片的url | |
TemplateCard.CardImage.AspectRatio | 图片的宽高比,宽高比要小于2.25,大于1.3,不填该参数默认1.3 | |
TemplateCard.VerticalContentList | 卡片二级内容,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过4 | |
TemplateCard.VerticalContentList.Title | 卡片二级标题 | |
TemplateCard.VerticalContentList.Desc | 卡片二级内容 | |
TemplateCard.ActionMenu | 卡片右上角更多操作按钮容 | |
TemplateCard.ActionMenu.Desc | 更多操作界面的描述 | |
TemplateCard.ActionMenu.ActionList | 操作列表,列表长度取值范围为 [1, 10] | |
TemplateCard.ActionMenu.ActionList.Text | 操作的描述文案 | |
TemplateCard.ActionMenu.ActionList.Key | 操作key值,用户点击后,会产生回调事件将本参数作为EventKey回调,最长支持1024字节,不可重复,必填 | |
TemplateCard.QuoteArea | 引用文献样式 | |
TemplateCard.QuoteArea.Type | 引用文献样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 | |
TemplateCard.QuoteArea.Url | 点击跳转的url,QuoteArea.Type是1时必填 | |
TemplateCard.QuoteArea.Appid | 点击跳转的小程序的appid,必须是与当前应用关联的小程序,QuoteArea.Type是2时必填 | |
TemplateCard.QuoteArea.PagePath | 点击跳转的小程序的pagepath,QuoteArea.Type是2时选填 | |
TemplateCard.QuoteArea.Title | 引用文献样式的标题 | |
TemplateCard.QuoteArea.QuoteText | 引用文献样式的引用文案 | |
TemplateCard.ImageTextArea | 左图右文样式,news_notice类型的卡片,CardImage和ImageTextArea两者必填一个字段,不可都不填 | |
TemplateCard.ImageTextArea.Type | 左图右文样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 | |
TemplateCard.ImageTextArea.Url | 点击跳转的url,ImageTextArea.Type是1时必填 | |
TemplateCard.ImageTextArea.Appid | 点击跳转的小程序的appid,必须是与当前应用关联的小程序,ImageTextArea.Type是2时必填 | |
TemplateCard.ImageTextArea.PagePath | 点击跳转的小程序的pagepath,ImageTextArea.Type是2时选填 | |
TemplateCard.ImageTextArea.Title | 左图右文样式的标题 | |
TemplateCard.ImageTextArea.Desc | 左图右文样式的描述 | |
TemplateCard.ImageTextArea.ImageUrl | 左图右文样式的图片url |
按钮交互型
<xml> <ToUserName><![CDATA[ToUserName]]></ToUserName> <FromUserName><![CDATA[FromUserName]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[update_template_card]]></MsgType> <TemplateCard> <CardType><![CDATA[button_interaction]]></CardType> <Source> <IconUrl><![CDATA[source_url]]></IconUrl> <Desc><![CDATA[更新后的卡片]]></Desc> <DescColor>2</DescColor> </Source> <MainTitle> <Title><![CDATA[更新后的卡片标题]]></Title> <Desc><![CDATA[更新后的卡片副标题]]></Desc> </MainTitle> <SubTitleText><![CDATA[更新后的卡片二级标题]]></SubTitleText> <HorizontalContentList> <KeyName><![CDATA[应用名称]]></KeyName> <Value><![CDATA[企业微信]]></Value> </HorizontalContentList> <HorizontalContentList> <KeyName><![CDATA[跳转企业微信]]></KeyName> <Value><![CDATA[跳转企业微信]]></Value> <Type>1</Type> <Url><![CDATA[url]]></Url> </HorizontalContentList> <JumpList> <Title><![CDATA[跳转企业微信]]></Title> <Type>1</Type> <Url><![CDATA[jump_url]]></Url> </JumpList> <CardAction> <Title><![CDATA[跳转企业微信]]></Title> <Type>1</Type> <Url><![CDATA[jump_url]]></Url> </CardAction> <ButtonList> <Text><![CDATA[按钮1]]></Text> <Style>1</Style> <Key><![CDATA[button_key_1]]></Key> </ButtonList> <ButtonList> <Text><![CDATA[按钮2]]></Text> <Style>2</Style> <Key><![CDATA[button_key_2]]></Key> </ButtonList> <ReplaceText><![CDATA[已提交]]></ReplaceText> <ActionMenu> <Desc><![CDATA[您可以使用以下功能]]></Desc> <ActionList> <Text><![CDATA[您将收到A回调]]></Text> <Key><![CDATA[A]]></Key> </ActionList> <ActionList> <Text><![CDATA[您将收到B回调]]></Text> <Key><![CDATA[B]]></Key> </ActionList> </ActionMenu> <QuoteArea> <Type>1</Type> <Url><![CDATA[quote_area_url]]></Url> <Title><![CDATA[企业微信]]></Title> <QuoteText><![CDATA[企业微信真好用呀]]></QuoteText> </QuoteArea> <BtnSelection> <QuestionKey><![CDATA[QuestionKey1]]></QuestionKey> <Title><![CDATA[下拉式选择器]]></Title> <SelectedId><![CDATA[option_id2]]></SelectedId> <Disable>false</Disable> <OptionList> <Id><![CDATA[option_id2]]></Id> <Text><![CDATA[选择题选项2]]></Text> </OptionList> <OptionList> <Id><![CDATA[option_id2]]></Id> <Text><![CDATA[选择题选项2]]></Text> </OptionList> </BtnSelection> </TemplateCard></xml>
参数 | 说明 | |
---|---|---|
ToUserName | 成员UserID | |
FromUserName | 企业微信CorpID | |
CreateTime | 消息创建时间(整型) | |
MsgType | update_template_card | |
TemplateCard.CardType | 模板卡片类型,文本通知型填写 “button_interaction” | |
TemplateCard.Source | 卡片来源样式信息,不需要来源样式可不填写 | |
TemplateCard.Source.IconUrl | 来源图片的url | |
TemplateCard.Source.Desc | 来源图片的描述 | |
TemplateCard.MainTitle.Title | 一级标题 | |
TemplateCard.MainTitle.Desc | 标题辅助信息 | |
TemplateCard.SubTitleText | 二级普通文本 | |
TemplateCard.HorizontalContentList | 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 | |
TemplateCard.HorizontalContentList.Type | 链接类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表下载附件,3 代表点击跳转成员详情 | |
TemplateCard.HorizontalContentList.KeyName | 二级标题,必填 | |
TemplateCard.HorizontalContentList.Value | 二级文本,如果HorizontalContentList.Type是2,该字段代表文件名称(要包含文件类型) | |
TemplateCard.HorizontalContentList.Url | 链接跳转的url,HorizontalContentList.Type是1时必填 | |
TemplateCard.HorizontalContentList.MediaId | 附件的media_id,HorizontalContentList.Type是2时必填 | |
TemplateCard.HorizontalContentList.UserId | 成员详情的userid,HorizontalContentList.Type是3时必填 | |
TemplateCard.CardAction | 整体卡片的点击跳转事件 | |
TemplateCard.CardAction.Type | 跳转事件类型,0或不填或错填代表不是链接,1 代表跳转url,2 代表下载附件 | |
TemplateCard.CardAction.Url | 跳转事件的url,CardAction.Type是1时必填 | |
TemplateCard.CardAction.AppId | 跳转事件的小程序的appid,CardAction.Type是2时必填 | |
TemplateCard.CardAction.PagePath | 跳转事件的小程序的pagepath,CardAction.Type是2时选填 | |
TemplateCard.ButtonList | 按钮列表,列表长度不超过6 | |
TemplateCard.ButtonList.Text | 按钮文案 | |
TemplateCard.ButtonList.Style | 按钮样式,目前可填1~4,不填或错填默认1 | |
TemplateCard.ButtonList.Key | 按钮key值,用户点击后,会产生回调事件,回调事件会带上该key值,最长支持1024字节 | |
TemplateCard.ReplaceText | 按钮替换文案,填写本字段后会展现灰色不可点击按钮 | |
TemplateCard.ActionMenu | 卡片右上角更多操作按钮容 | |
TemplateCard.ActionMenu.Desc | 更多操作界面的描述 | |
TemplateCard.ActionMenu.ActionList | 操作列表,列表长度取值范围为 [1, 10] | |
TemplateCard.ActionMenu.ActionList.Text | 操作的描述文案 | |
TemplateCard.ActionMenu.ActionList.Key | 操作key值,用户点击后,会产生回调事件将本参数作为EventKey回调,最长支持1024字节,不可重复,必填 | |
TemplateCard.QuoteArea | 引用文献样式 | |
TemplateCard.QuoteArea.Type | 引用文献样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 | |
TemplateCard.QuoteArea.Url | 点击跳转的url,QuoteArea.Type是1时必填 | |
TemplateCard.QuoteArea.Appid | 点击跳转的小程序的appid,必须是与当前应用关联的小程序,QuoteArea.Type是2时必填 | |
TemplateCard.QuoteArea.PagePath | 点击跳转的小程序的pagepath,QuoteArea.Type是2时选填 | |
TemplateCard.QuoteArea.Title | 引用文献样式的标题 | |
TemplateCard.QuoteArea.QuoteText | 引用文献样式的引用文案 | |
TemplateCard.ButtonSelection | 下拉式的选择器 | |
TemplateCard.ButtonSelection.QuestionKey | 下拉式的选择器题目的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节 | |
TemplateCard.ButtonSelection.Title | 下拉式的选择器左边的Title | |
TemplateCard.ButtonSelection.SelectedId | 下拉式的选择器默认选定的选项 | |
TemplateCard.ButtonSelection.OptionList | 选项列表,下拉选项不超过 10 个 | |
TemplateCard.ButtonSelection.Disable | 是否可以选择状态 | |
TemplateCard.ButtonSelection.OptionList.Id | 下拉式的选 择器选项的id,用户提交选项后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节 | |
TemplateCard.ButtonSelection.OptionList.Text | 下拉式的选择器选项的文案 |
投票选择型
<xml> <ToUserName><![CDATA[ToUserName]]></ToUserName> <FromUserName><![CDATA[FromUserName]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[update_template_card]]></MsgType> <TemplateCard> <CardType><![CDATA[vote_interaction]]></CardType> <Source> <IconUrl><![CDATA[source_url]]></IconUrl> <Desc><![CDATA[更新后的卡片]]></Desc> </Source> <MainTitle> <Title><![CDATA[更新后的卡片标题]]></Title> <Desc><![CDATA[更新后的卡片副标题]]></Desc> </MainTitle> <CheckBox> <QuestionKey><![CDATA[QuestionKey1]]></QuestionKey> <OptionList> <Id><![CDATA[option_id1]]></Id> <Text><![CDATA[选择题选项1]]></Text> <IsChecked>true</IsChecked> </OptionList> <OptionList> <Id><![CDATA[option_id2]]></Id> <Text><![CDATA[选择题选项2]]></Text> <IsChecked>false</IsChecked> </OptionList> <Disable>false</Disable> <Mode>1</Mode> </CheckBox> <SubmitButton> <Text><![CDATA[提交]]></Text> <Key><![CDATA[Key]]></Key> </SubmitButton> <ReplaceText><![CDATA[已提交]]></ReplaceText> </TemplateCard></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | update_template_card |
TemplateCard.CardType | 模板卡片类型,文本通知型填写 “vote_interaction” |
TemplateCard.Source | 卡片来源样式信息,不需要来源样式可不填写 |
TemplateCard.Source.IconUrl | 来源图片的url |
TemplateCard.Source.Desc | 来源图片的描述 |
TemplateCard.MainTitle.Title | 一级标题 |
TemplateCard.MainTitle.Desc | 标题辅助信息 |
TemplateCard.CheckBox | 选择题样式,仅”vote_interaction”要填该字段 |
TemplateCard.CheckBox.QuestionKey | 选择题key值,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节 |
TemplateCard.CheckBox.Disable | 是否可以选择状态 |
TemplateCard.CheckBox.Mode | 选择题模式,单选:0,多选:1,不填或错填默认0 |
TemplateCard.CheckBox.OptionList | 选项list,选项个数不超过 20 个 |
TemplateCard.CheckBox.OptionList.Id | 选项id,用户提交选项后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节 |
TemplateCard.CheckBox.OptionList.Text | 选项文案描述 |
TemplateCard.CheckBox.OptionList.IsChecked | 该选项是否要默选中 |
TemplateCard.SubmitButton | 提交按钮样式 |
TemplateCard.SubmitButton.Text | 按钮文案,建议不超过10个字,不填默认为提交 |
TemplateCard.SubmitButton.Key | 提交按钮的key,会产生回调事件将本参数作为EventKey返回,最长支持1024字节,必填 |
TemplateCard.ReplaceText | 按钮替换文案,填写本字段后会展现灰色不可点击按钮 |
多项选择型
<xml> <ToUserName><![CDATA[ToUserName]]></ToUserName> <FromUserName><![CDATA[FromUserName]]></FromUserName> <CreateTime>1357290913</CreateTime> <MsgType><![CDATA[update_template_card]]></MsgType> <TemplateCard> <CardType><![CDATA[multiple_interaction]]></CardType> <Source> <IconUrl><![CDATA[source_url]]></IconUrl> <Desc><![CDATA[更新后的卡片]]></Desc> </Source> <MainTitle> <Title><![CDATA[更新后的卡片标题]]></Title> <Desc><![CDATA[更新后的卡片副标题]]></Desc> </MainTitle> <SelectList> <QuestionKey><![CDATA[QuestionKey1]]></QuestionKey> <Title><![CDATA[下拉式选择器]]></Title> <SelectedId><![CDATA[option_id2]]></SelectedId> <Disable>false</Disable> <OptionList> <Id><![CDATA[option_id2]]></Id> <Text><![CDATA[选择题选项2]]></Text> </OptionList> <OptionList> <Id><![CDATA[option_id2]]></Id> <Text><![CDATA[选择题选项2]]></Text> </OptionList> </SelectList> <SubmitButton> <Text><![CDATA[提交]]></Text> <Key><![CDATA[Key]]></Key> </SubmitButton> <ReplaceText><![CDATA[已提交]]></ReplaceText> </TemplateCard></xml>
参数 | 说明 |
---|---|
ToUserName | 成员UserID |
FromUserName | 企业微信CorpID |
CreateTime | 消息创建时间(整型) |
MsgType | update_template_card |
TemplateCard.CardType | 模板卡片类型,文本通知型填写 “multiple_interaction” |
TemplateCard.Source | 卡片来源样式信息,不需要来源样式可不填写 |
TemplateCard.Source.IconUrl | 来源图片的url |
TemplateCard.Source.Desc | 来源图片的描述 |
TemplateCard.MainTitle.Title | 一级标题 |
TemplateCard.MainTitle.Desc | 标题辅助信息 |
TemplateCard.SelectList | 下拉式的选择器列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,一个消息最多支持 3 个选择器 |
TemplateCard.SelectList.QuestionKey | 下拉式的选择器题目的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节 |
TemplateCard.SelectList.Title | 下拉式的选择器上面的Title |
TemplateCard.SelectList.SelectedId | 下拉式的选择器默认选定的选项 |
TemplateCard.SelectList.OptionList | 选项列表,下拉选项不超过 10 个 |
TemplateCard.SelectList.Disable | 是否可以选择状态 |
TemplateCard.SelectList.OptionList.Id | 下拉式的选择器选项的id,用户提交选项后,会产生回调事件,回调事件会带上该id值 表示该选项,最长支持128字节 |
TemplateCard.SelectList.OptionList.Text | 下拉式的选择器选项的文案 |
TemplateCard.SubmitButton | 提交按钮样式 |
TemplateCard.SubmitButton.Text | 按钮文案,建议不超过10个字,不填默认为提交 |
TemplateCard.SubmitButton.Key | 提交按钮的key,会产生回调事件将本参数作为EventKey返回,最长支持1024字节,必填 |
TemplateCard.ReplaceText | 按钮替换文案,填写本字段后会展现灰色不可点击按钮 |
修改于 2022-01-14 04:26:04