Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_OPEN_COMMENT

API_OPEN_COMMENT = 'https://api.weixin.qq.com/cgi-bin/comment/open'

API_CLOSE_COMMENT

API_CLOSE_COMMENT = 'https://api.weixin.qq.com/cgi-bin/comment/close'

API_LIST_COMMENT

API_LIST_COMMENT = 'https://api.weixin.qq.com/cgi-bin/comment/list'

API_MARK_ELECT

API_MARK_ELECT = 'https://api.weixin.qq.com/cgi-bin/comment/markelect'

API_UNMARK_ELECT

API_UNMARK_ELECT = 'https://api.weixin.qq.com/cgi-bin/comment/unmarkelect'

API_DELETE_COMMENT

API_DELETE_COMMENT = 'https://api.weixin.qq.com/cgi-bin/comment/delete'

API_REPLY_COMMENT

API_REPLY_COMMENT = 'https://api.weixin.qq.com/cgi-bin/comment/reply/add'

API_DELETE_REPLY

API_DELETE_REPLY = 'https://api.weixin.qq.com/cgi-bin/comment/reply/delete'

Properties

$maxRetries

$maxRetries : integer

Type

integer

Methods

setHttp()

setHttp(\EasyWeChat\Core\Http  $http) : $this

Set the http instance.

Parameters

\EasyWeChat\Core\Http $http

Returns

$this

setAccessToken()

setAccessToken(\EasyWeChat\Core\AccessToken  $accessToken) : $this

Set the request token.

Parameters

\EasyWeChat\Core\AccessToken $accessToken

Returns

$this

maxRetries()

maxRetries(integer  $retries) 

Parameters

integer $retries

parseJSON()

parseJSON(string  $method, array  $args) : \EasyWeChat\Support\Collection

Parse JSON from response and check error.

Parameters

string $method
array $args

Returns

\EasyWeChat\Support\Collection

open()

open(string  $msgId, integer  $index) : \EasyWeChat\Support\Collection

Open article comment.

Parameters

string $msgId
integer $index

Returns

\EasyWeChat\Support\Collection

close()

close(string  $msgId, integer  $index) : \EasyWeChat\Support\Collection

Close comment.

Parameters

string $msgId
integer $index

Returns

\EasyWeChat\Support\Collection

lists()

lists(string  $msgId, integer  $index, integer  $begin, integer  $count, integer  $type) : \EasyWeChat\Support\Collection

Get article comments.

Parameters

string $msgId
integer $index
integer $begin
integer $count
integer $type

Returns

\EasyWeChat\Support\Collection

markElect()

markElect(string  $msgId, integer  $index, integer  $commentId) : \EasyWeChat\Support\Collection

Mark elect comment.

Parameters

string $msgId
integer $index
integer $commentId

Returns

\EasyWeChat\Support\Collection

unmarkElect()

unmarkElect(string  $msgId, integer  $index, integer  $commentId) : \EasyWeChat\Support\Collection

Unmark elect comment.

Parameters

string $msgId
integer $index
integer $commentId

Returns

\EasyWeChat\Support\Collection

delete()

delete(string  $msgId, integer  $index, integer  $commentId) : \EasyWeChat\Support\Collection

Delete comment.

Parameters

string $msgId
integer $index
integer $commentId

Returns

\EasyWeChat\Support\Collection

reply()

reply(string  $msgId, integer  $index, integer  $commentId, string  $content) : \EasyWeChat\Support\Collection

Reply to a comment.

Parameters

string $msgId
integer $index
integer $commentId
string $content

Returns

\EasyWeChat\Support\Collection

deleteReply()

deleteReply(string  $msgId, integer  $index, integer  $commentId) : \EasyWeChat\Support\Collection

Delete a reply.

Parameters

string $msgId
integer $index
integer $commentId

Returns

\EasyWeChat\Support\Collection

registerHttpMiddlewares()

registerHttpMiddlewares() 

Register Guzzle middlewares.

accessTokenMiddleware()

accessTokenMiddleware() : \Closure

Attache access token to request query.

Returns

\Closure

logMiddleware()

logMiddleware() : \Closure

Log the request.

Returns

\Closure

retryMiddleware()

retryMiddleware() : \Closure

Return retry middleware.

Returns

\Closure

checkAndThrow()

checkAndThrow(array  $contents) 

Check the array data errors, and Throw exception when the contents contains error.

Parameters

array $contents

Throws

\EasyWeChat\Core\Exceptions\HttpException