Interface WxWorkReqParams

interface WxWorkReqParams {
    file?: { media_id: string };
    image?: { base64: string; md5: string };
    markdown?: { content: string };
    msgtype: string;
    news?: {
        articles: {
            description: string;
            picurl?: string;
            title: string;
            url: string;
        }[];
    };
    template_card?: {
        card_action?: {
            appid?: string;
            pagepath?: string;
            type: number;
            url?: string;
        };
        card_image?: { aspect_ratio?: number; url: string };
        card_type: "news_notice" | "text_notice";
        emphasis_content?: { desc: string; title: string };
        horizontal_content_list?: {
            keyname: string;
            media_id?: string;
            type?: number;
            url?: string;
            value: string;
        }[];
        image_text_area?: {
            appid?: string;
            desc?: string;
            image_url?: string;
            title?: string;
            type?: number;
            url?: string;
        };
        jump_list: {
            appid?: string;
            pagepath?: string;
            title: string;
            type: number;
            url?: string;
        }[];
        main_title: { desc?: string; title: string };
        quote_area?: {
            appid: string;
            pagepath: string;
            quote_text: string;
            title: string;
            type: number;
            url: string;
        };
        source?: { desc?: string; desc_color?: number; icon_url?: string };
        sub_title_text: string;
        vertical_content_list?: { desc?: string; title: string };
    };
    text?: {
        content: string;
        mentioned_list?: string[];
        mentioned_mobile_list?: string[];
    };
}

Properties

file?: { media_id: string }

Type declaration

  • media_id: string

    通过文件上传接口返回的文件id

image?: { base64: string; md5: string }

Type declaration

  • base64: string

    图片 base64,最大不超过2M(编码前,jpg/png 格式)

  • md5: string
markdown?: { content: string }
msgtype: string
news?: {
    articles: {
        description: string;
        picurl?: string;
        title: string;
        url: string;
    }[];
}
template_card?: {
    card_action?: {
        appid?: string;
        pagepath?: string;
        type: number;
        url?: string;
    };
    card_image?: { aspect_ratio?: number; url: string };
    card_type: "news_notice" | "text_notice";
    emphasis_content?: { desc: string; title: string };
    horizontal_content_list?: {
        keyname: string;
        media_id?: string;
        type?: number;
        url?: string;
        value: string;
    }[];
    image_text_area?: {
        appid?: string;
        desc?: string;
        image_url?: string;
        title?: string;
        type?: number;
        url?: string;
    };
    jump_list: {
        appid?: string;
        pagepath?: string;
        title: string;
        type: number;
        url?: string;
    }[];
    main_title: { desc?: string; title: string };
    quote_area?: {
        appid: string;
        pagepath: string;
        quote_text: string;
        title: string;
        type: number;
        url: string;
    };
    source?: { desc?: string; desc_color?: number; icon_url?: string };
    sub_title_text: string;
    vertical_content_list?: { desc?: string; title: string };
}

Type declaration

  • Optionalcard_action?: { appid?: string; pagepath?: string; type: number; url?: string }

    整体卡片的点击跳转事件,news_notice模版卡片中该字段为必填项

  • Optionalcard_image?: { aspect_ratio?: number; url: string }

    图片样式

  • card_type: "news_notice" | "text_notice"

    模板类型。文本通知模板卡片的类型为: text_notice

  • Optionalemphasis_content?: { desc: string; title: string }

    text_notice

  • Optionalhorizontal_content_list?: {
        keyname: string;
        media_id?: string;
        type?: number;
        url?: string;
        value: string;
    }[]
  • Optionalimage_text_area?: {
        appid?: string;
        desc?: string;
        image_url?: string;
        title?: string;
        type?: number;
        url?: string;
    }

    左图右文样式

  • jump_list: { appid?: string; pagepath?: string; title: string; type: number; url?: string }[]
  • main_title: { desc?: string; title: string }

    模版卡片的主要内容,包括一级标题和标题辅助信息

    • Optionaldesc?: string

      标题辅助信息,建议不超过30个字

    • title: string

      一级标题,建议不超过26个字

  • Optionalquote_area?: {
        appid: string;
        pagepath: string;
        quote_text: string;
        title: string;
        type: number;
        url: string;
    }
  • Optionalsource?: { desc?: string; desc_color?: number; icon_url?: string }

    卡片来源样式信息

  • sub_title_text: string
  • Optionalvertical_content_list?: { desc?: string; title: string }
text?: {
    content: string;
    mentioned_list?: string[];
    mentioned_mobile_list?: string[];
}