LaneWeChat\Core\Media::getmateriallist PHP Метод

getmateriallist() публичный статический Метод

获取素材列表
Автор: : 正朴 ([email protected])
public static getmateriallist ( $type, $offset, $count )
$type 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news)
$offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
$count 返回素材的数量,取值在1到20之间
    public static function getmateriallist($type, $offset, $count)
    {
        //获取ACCESS_TOKEN
        $accessToken = AccessToken::getAccessToken();
        $queryUrl = 'https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=' . $accessToken;
        $template = array('type' => $type, 'offset' => $offset, 'count' => $count);
        $template = json_encode($template, JSON_UNESCAPED_UNICODE);
        return Curl::callWebServer($queryUrl, $template, 'POST', 1, 0);
    }