GET
GET = 'get'
Class Material.
$http : \EasyWeChat\Core\Http
Http instance.
$accessToken : \EasyWeChat\Core\AccessToken
The request token.
__construct(\EasyWeChat\Core\AccessToken $accessToken)
Constructor.
\EasyWeChat\Core\AccessToken | $accessToken |
getHttp() : \EasyWeChat\Core\Http
Return the http instance.
setHttp(\EasyWeChat\Core\Http $http) : $this
Set the http instance.
\EasyWeChat\Core\Http | $http |
getAccessToken() : \EasyWeChat\Core\AccessToken
Return the current accessToken.
setAccessToken(\EasyWeChat\Core\AccessToken $accessToken) : $this
Set the request token.
\EasyWeChat\Core\AccessToken | $accessToken |
parseJSON(string $method, array $args) : \EasyWeChat\Support\Collection
Parse JSON from response and check error.
string | $method | |
array | $args |
uploadImage(string $path) : \EasyWeChat\Support\Collection
Upload image.
string | $path |
uploadVoice(string $path) : \EasyWeChat\Support\Collection
Upload voice.
string | $path |
uploadThumb(string $path) : \EasyWeChat\Support\Collection
Upload thumb.
string | $path |
uploadVideo(string $path, string $title, string $description) : \EasyWeChat\Support\Collection
Upload video.
string | $path | |
string | $title | |
string | $description |
uploadArticle(array|\EasyWeChat\Message\Article $articles) : \EasyWeChat\Support\Collection
Upload articles.
array|\EasyWeChat\Message\Article | $articles |
updateArticle(string $mediaId, array $article, integer $index) : \EasyWeChat\Support\Collection
Update article.
string | $mediaId | |
array | $article | |
integer | $index |
uploadArticleImage(string $path) : \EasyWeChat\Support\Collection
Upload image for article.
string | $path |
delete(string $mediaId) : \EasyWeChat\Support\Collection
Delete material by media ID.
string | $mediaId |
lists(string $type, integer $offset, integer $count = 20) : array
List materials.
example:
{ "total_count": TOTAL_COUNT, "item_count": ITEM_COUNT, "item": [{ "media_id": MEDIA_ID, "name": NAME, "update_time": UPDATE_TIME }, // more... ] }
string | $type | |
integer | $offset | |
integer | $count |
uploadMedia(string $type, string $path, array $form = array()) : \EasyWeChat\Support\Collection
Upload material.
string | $type | |
string | $path | |
array | $form |