获取素材列表
<h5>简要描述</h5>
<ul>
<li>在企微宝云端版收录的素材列表,可用于发送消息。使用举例:1、在web端素材库打开手机端上传开关;2、通过手机端登录的企微号把小程序发给企微号自身,该小程序会被自动收录到素材库;3、通过此处素材列表可请求到该小程序的具体参数;4、再参照文档“<a href='<a href="https://www.showdoc.com.cn/qybopen/7988142920476637'>发送消息/公告</a>”可将该小程序发给其他客户或客户群">https://www.showdoc.com.cn/qybopen/7988142920476637'>发送消息/公告</a>”可将该小程序发给其他客户或客户群</a>。</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>https://oapi-yzj.miaokol.com/index/mediaList</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET </li>
</ul>
<h5>请求参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">app_id</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>APP ID</td>
</tr>
<tr>
<td style="text-align: left;">access_token</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>Access Token</td>
</tr>
<tr>
<td style="text-align: left;">page</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>页码,默认1</td>
</tr>
<tr>
<td style="text-align: left;">page_size</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>每页条数,默认10,最大100</td>
</tr>
<tr>
<td style="text-align: left;">search</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">string</td>
<td>关键词搜索标题或内容</td>
</tr>
<tr>
<td style="text-align: left;">is_personal</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>是否个人素材:0否;1是。默认-1表示全部素材(包含企业和个人收录的全部素材)</td>
</tr>
<tr>
<td style="text-align: left;">sub_user_id</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>仅当is_personal传1时该参数有效,传0表示获取主账号收录的个人素材;传其他子账号ID表示获取其他子账号收录的个人素材</td>
</tr>
<tr>
<td style="text-align: left;">type</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">string</td>
<td>素材类型(文字:text、图片:picture、视频:video、文件:file、链接:link、小程序:program、视频号:channel、语音:voice)</td>
</tr>
<tr>
<td style="text-align: left;">id</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>素材ID,可使用该字段只请求单条素材</td>
</tr>
</tbody>
</table>
<h5>请求示例</h5>
<pre><code>GET /index/mediaList?app_id=xxx&amp;access_token=xxxx&amp;page=1&amp;page_size=10 HTTP/1.1
Host:oapi-yzj.miaokol.com
content-type: application/x-www-form-urlencoded
</code></pre>
<h5>响应示例</h5>
<pre><code>HTTP/1.1 200 OK
{
&quot;data&quot;:[
{
&quot;id&quot;:235,
&quot;user_id&quot;:21,
&quot;sub_user_id&quot;:0,
&quot;corp_id&quot;:0,
&quot;title&quot;:&quot;我的测试素材啊!&quot;,
&quot;items&quot;:[
{
&quot;id&quot;:&quot;16408312888405230&quot;,
&quot;msg_type&quot;:&quot;text&quot;,
&quot;content&quot;:{
&quot;items&quot;:[
{
&quot;type&quot;:&quot;text&quot;,
&quot;text&quot;:&quot;测试!&quot;
}
]
}
},
{
&quot;id&quot;:&quot;16408313975526876&quot;,
&quot;msg_type&quot;:&quot;picture&quot;,
&quot;content&quot;:{
&quot;url&quot;:&quot;https:\/\/qiyunbao.oss-cn-hangzhou.aliyuncs.com\/u\/21\/20211230\/85f6bd58f1cb65366ba2d09ccfde72b2.jfif&quot;
}
},
{
&quot;id&quot;:&quot;16408314020915051&quot;,
&quot;msg_type&quot;:&quot;file&quot;,
&quot;content&quot;:{
&quot;url&quot;:&quot;https:\/\/qiyunbao.oss-cn-hangzhou.aliyuncs.com\/u\/21\/20211230\/eff24e17030353a56167b9f9137c2638.html&quot;,
&quot;title&quot;:&quot;话术库 - 企云宝.html&quot;,
&quot;name&quot;:&quot;话术库 - 企云宝.html&quot;,
&quot;size&quot;:&quot;150.38 kB&quot;
}
},
{
&quot;id&quot;:&quot;16408314801042533&quot;,
&quot;msg_type&quot;:&quot;link&quot;,
&quot;content&quot;:{
&quot;url&quot;:&quot;https:\/\/www.jd.com&quot;,
&quot;title&quot;:&quot;这是应该测试京东的连接&quot;,
&quot;cover&quot;:&quot;https:\/\/qiyunbao.oss-cn-hangzhou.aliyuncs.com\/u\/21\/20211230\/85f6bd58f1cb65366ba2d09ccfde72b2.jfif&quot;,
&quot;desc&quot;:&quot;打开京东open brower www.jd.com gc!&quot;
}
},
{
&quot;client_id&quot;:&quot;CAMQm+SfiwYYt+Pgi5qAgAMgjpb6swc=&quot;,
&quot;content&quot;:{
&quot;appid&quot;:&quot;wxece3a9a4c82f58c9&quot;,
&quot;cover&quot;:&quot;\/\/qiyunbao.oss-cn-hangzhou.aliyuncs.com\/media\/public\/wechatdata\/21\/1688856864240055\/pic\/880bf000a850eabeccbb5c9c06b50253.jpg&quot;,
&quot;name&quot;:&quot;饿了么 l 外卖美食超市买菜水果&quot;,
&quot;org_content&quot;:{
&quot;author&quot;:&quot;gh_6506303a12bb@app&quot;,
&quot;headimgheight&quot;:416,
&quot;headimgkey&quot;:&quot;d80e8a6663cc4dad8da0a72f6e4b6582&quot;,
&quot;headimgsize&quot;:61424,
&quot;headimgwidth&quot;:520,
&quot;md5&quot;:&quot;880bf000a850eabeccbb5c9c06b50253&quot;,
&quot;page&quot;:&quot;pages\/index\/index.html?qrcode=weixin-share&quot;,
&quot;wxurl&quot;:&quot;3069020102046230600201000204a17831b702030f4df90204d0136071020461640327042462393366336636662d343035642d343637332d626131642d636636393333653366646338020100020300f0000410880bf000a850eabeccbb5c9c06b502530201010201000400&quot;
},
&quot;title&quot;:&quot;饿了么小程序,红包天天领&quot;,
&quot;weapp_iconurl&quot;:&quot;http:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/uLzlOotx1RIyCXe9C6fuk5GUUnzFUTRQmIMcL8lWftU48U9BiaN1Y3kScbSibBaxVnp5ULCiahpic3PWlMjz2QpjWA\/640?wx_fmt=png&amp;wxfrom=200&quot;
},
&quot;msg_hash&quot;:&quot;8efc9b74eba76c437c2b5d2596c4f8e5ef0c1a12&quot;,
&quot;msg_time&quot;:1634202139000,
&quot;msg_type&quot;:&quot;program&quot;,
&quot;wx_msgid&quot;:&quot;0&quot;,
&quot;wx_svrid&quot;:&quot;1017434&quot;,
&quot;user_id&quot;:21,
&quot;sub_user_id&quot;:0,
&quot;corp_id&quot;:2,
&quot;svrid&quot;:&quot;1688856864240055,1688856864240055,8efc9b74eba76c437c2b5d2596c4f8e5ef0c1a12&quot;,
&quot;chat_wxid&quot;:&quot;1688856864240055&quot;,
&quot;chat_type&quot;:1,
&quot;bucket&quot;:&quot;qiyunbao&quot;,
&quot;id&quot;:&quot;16408314954187701&quot;
},
{
&quot;client_id&quot;:&quot;CAMQjOOfiwYYt+Pgi5qAgAMgpur9xAE=&quot;,
&quot;content&quot;:{
&quot;avatar&quot;:&quot;http:\/\/wx.qlogo.cn\/finderhead\/iaRlzG8zy7Bu2kAlKuibj9nXqT6RcNavr0JOoqKHKJhyiaguVaOXpDzcQ\/132&quot;,
&quot;cover&quot;:&quot;\/\/qiyunbao.oss-cn-hangzhou.aliyuncs.com\/media\/public\/wechatdata\/21\/1688856864240055\/pic\/633ed10acf15b0214ec87f0adb48f6fb.jpg&quot;,
&quot;desc&quot;:&quot;努力才是女孩子们的标配!@宫园薰漫剪 #同好集结##励志##治愈##热门##动漫#&quot;,
&quot;org_content&quot;:{
&quot;key&quot;:&quot;CAEoAaoGaQpnZXhwb3J0L1V6RmZBZ3RnZWtJRUFRQUFBQUFBdm1zNVRxOUNfd0FBQUFzdFF5NnViYUxYNEtIV3ZMRVpnQlBFd29NQVZpY3ZPYm4tek5QZ01JRGEyMzZ3TUdSc1hrdGhYZGlVZGFZMA==&quot;,
&quot;wxurl&quot;:&quot;http:\/\/wxapp.tc.qq.com\/251\/20350\/stodownload?encfilekey=XGocBFxVWK5dcyOOqpEU47RpBHQIvlhn9TIjoywiaVcH1h0yKAprTcfz6lRaVXHwFPRhhbBzgNgWnZkHwVVCJ3BibBPrRxAsaXCPuyqlWSkjOJiaGMDs9GibSRjBA30ibg3pxKk2YicWXiabTpOFaM5zCEj4TKJEvicJVwhiaiaoz3DlukYvwOFzqNWPeiaeQ&amp;adaptivelytrans=0&amp;bizid=1023&amp;dotrans=0&amp;hy=SH&amp;idx=1&amp;m=633ed10acf15b0214ec87f0adb48f6fb&amp;token=x5Y29zUxcibBVldHPqdg3yicmNmicMgHCASrY3NqzqZbiccbsyic5BzDy4vpKP6q6aILRejINmsEpnkg&amp;finder_expire_time=1634806757&amp;finder_eid=export%2FUzFfAgtgekIEAQAAAAAAvms5Tq9C_wAAAAstQy6ubaLX4KHWvLEZgBPEwoMAVicvObn-zNPgMIDa236wMGRsXkthXdiUdaY0&quot;
},
&quot;title&quot;:&quot;宫园薰漫剪&quot;,
&quot;url&quot;:&quot;https:\/\/channels.weixin.qq.com\/web\/pages\/feed?eid=export%2FUzFfAgtgekIEAQAAAAAAvms5Tq9C_wAAAAstQy6ubaLX4KHWvLEZgBPEwoMAVicvObn-zNPgMIDa236wMGRsXkthXdiUdaY0&quot;
},
&quot;msg_hash&quot;:&quot;2c6983205fa4ddd6d1de86eff7a34e030b5725f0&quot;,
&quot;msg_time&quot;:1634201996000,
&quot;msg_type&quot;:&quot;channel&quot;,
&quot;wx_msgid&quot;:&quot;0&quot;,
&quot;wx_svrid&quot;:&quot;1017432&quot;,
&quot;user_id&quot;:21,
&quot;sub_user_id&quot;:0,
&quot;corp_id&quot;:2,
&quot;svrid&quot;:&quot;1688856864240055,1688856864240055,2c6983205fa4ddd6d1de86eff7a34e030b5725f0&quot;,
&quot;chat_wxid&quot;:&quot;1688856864240055&quot;,
&quot;chat_type&quot;:1,
&quot;bucket&quot;:&quot;qiyunbao&quot;,
&quot;id&quot;:&quot;16408315051352464&quot;
}
],
&quot;types&quot;:[
&quot;text&quot;,
&quot;picture&quot;,
&quot;file&quot;,
&quot;link&quot;,
&quot;program&quot;,
&quot;channel&quot;
],
&quot;type_info&quot;:{
&quot;text&quot;:1,
&quot;picture&quot;:1,
&quot;file&quot;:1,
&quot;link&quot;:1,
&quot;program&quot;:1,
&quot;channel&quot;:1
},
&quot;extra&quot;:null,
&quot;ctime&quot;:1640831520,
&quot;utime&quot;:1640831545,
&quot;source_type&quot;:1,
&quot;is_personal&quot;:0,
&quot;tags&quot;:[
{
&quot;id&quot;:9964,
&quot;name&quot;:&quot;企云宝&quot;
}
]
}
],
&quot;pager&quot;:{
&quot;page&quot;:1,
&quot;perPage&quot;:10,
&quot;numRecords&quot;:1,
&quot;numPages&quot;:1,
&quot;firstRecord&quot;:0,
&quot;lastRecord&quot;:0
},
&quot;msg_type_map&quot;:{
&quot;text&quot;:&quot;文本&quot;,
&quot;picture&quot;:&quot;图片&quot;,
&quot;voice&quot;:&quot;音频&quot;,
&quot;link&quot;:&quot;链接&quot;,
&quot;video&quot;:&quot;视频&quot;,
&quot;file&quot;:&quot;文件&quot;,
&quot;program&quot;:&quot;小程序&quot;,
&quot;card&quot;:&quot;名片&quot;,
&quot;system&quot;:&quot;系统消息&quot;,
&quot;channel&quot;:&quot;视频号&quot;,
&quot;announcement&quot;:&quot;公告&quot;,
&quot;qrcode&quot;:&quot;二维码&quot;
},
&quot;errcode&quot;:0
}
</code></pre>
<h5>响应说明</h5>
<ul>
<li>数组项格式说明如下</li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">object []</td>
<td>数据项</td>
</tr>
<tr>
<td style="text-align: left;">data[0].id</td>
<td style="text-align: left;">int</td>
<td>素材ID</td>
</tr>
<tr>
<td style="text-align: left;">data[0].title</td>
<td style="text-align: left;">string</td>
<td>素材标题</td>
</tr>
<tr>
<td style="text-align: left;">data[0].items</td>
<td style="text-align: left;">object[]</td>
<td>素材中包含的消息列表,结构及字段详见说明-<a href="<a href="https://www.showdoc.com.cn/qybopen/7990161805486320">聊天消息</a>">https://www.showdoc.com.cn/qybopen/7990161805486320">聊天消息</a></a>;</td>
</tr>
<tr>
<td style="text-align: left;">data[0].types</td>
<td style="text-align: left;">array</td>
<td>素材中包含的消息类型(文字:text、图片:picture、视频:video、文件:file、链接:link、小程序:program、视频号:channel、语音:voice)</td>
</tr>
<tr>
<td style="text-align: left;">data[0].type_info</td>
<td style="text-align: left;">object</td>
<td>素材中各种消息类型的数量</td>
</tr>
<tr>
<td style="text-align: left;">data[0].source_type</td>
<td style="text-align: left;">int</td>
<td>创建来源(1:云端创建;2:手机端;3:客户端;4:云端聊天)</td>
</tr>
<tr>
<td style="text-align: left;">data[0].tags</td>
<td style="text-align: left;">object []</td>
<td>素材中各种消息类型的数量</td>
</tr>
<tr>
<td style="text-align: left;">pager</td>
<td style="text-align: left;">object</td>
<td>分页信息,总数:pager.numRecords</td>
</tr>
<tr>
<td style="text-align: left;">msg_type_map</td>
<td style="text-align: left;">object</td>
<td>消息类型映射关系</td>
</tr>
</tbody>
</table>