企业内部开发 服务端API 消息推送 接收消息与事件 被动回复消息格式
被动回复消息格式
最后更新:2021/11/08
可联系渠道经理采购或代理智慧硬件接口已支持设备 联系渠道经理
被动回复消息格式
最后更新:2021/11/08

目录

  • 文本消息
  • 图片消息
  • 语音消息
  • 视频消息
  • 图文消息
  • 任务卡片更新消息
  • 模板卡片更新消息
  •       更新点击用户的按钮文案
  •       更新点击用户的整张卡片
  •             文本通知型
  •             图文展示型
  •             按钮交互型
  •             投票选择型
  •             多项选择型
  • 当企业后台收到推送过来的普通消息或事件消息后,可以在响应里带上被动回复消息
    如何被动回复消息在使用接收消息已经说明,本小节是对回复消息的结构体的说明

    注:以下出现的xml包仅是发送的消息包中的Encrypt参数加密前的内容说明

    文本消息

    明文XML结构:

    <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结构:

    <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结构:

    <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结构:

    <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结构:

    <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消息创建时间(整型) 
    MsgTypeupdate_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>
    		</ImageTextArea>
    	</TemplateCard>
    </xml>

    参数说明

    参数说明 
    ToUserName成员UserID 
    FromUserName企业微信CorpID 
    CreateTime消息创建时间(整型) 
    MsgTypeupdate_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>
    		<ButtonSelection>
    			<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>
    		</ButtonSelection>
    	</TemplateCard>
    </xml>

    参数说明

    参数说明 
    ToUserName成员UserID 
    FromUserName企业微信CorpID 
    CreateTime消息创建时间(整型) 
    MsgTypeupdate_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消息创建时间(整型)
    MsgTypeupdate_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消息创建时间(整型)
    MsgTypeupdate_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按钮替换文案,填写本字段后会展现灰色不可点击按钮
    上一篇
    事件格式
    下一篇
    概述