Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_GET

API_GET = 'https://api.weixin.qq.com/cgi-bin/groups/get'

API_CREATE

API_CREATE = 'https://api.weixin.qq.com/cgi-bin/groups/create'

API_UPDATE

API_UPDATE = 'https://api.weixin.qq.com/cgi-bin/groups/update'

API_DELETE

API_DELETE = 'https://api.weixin.qq.com/cgi-bin/groups/delete'

API_USER_GROUP_ID

API_USER_GROUP_ID = 'https://api.weixin.qq.com/cgi-bin/groups/getid'

API_MEMBER_UPDATE

API_MEMBER_UPDATE = 'https://api.weixin.qq.com/cgi-bin/groups/members/update'

API_MEMBER_BATCH_UPDATE

API_MEMBER_BATCH_UPDATE = 'https://api.weixin.qq.com/cgi-bin/groups/members/batchupdate'

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

update()

update(integer  $groupId, string  $name) : \EasyWeChat\Support\Collection

Update a group name.

Parameters

integer $groupId
string $name

Returns

\EasyWeChat\Support\Collection

userGroup()

userGroup(string  $openId) : \EasyWeChat\Support\Collection

Get user group.

Parameters

string $openId

Returns

\EasyWeChat\Support\Collection

moveUser()

moveUser(string  $openId, integer  $groupId) : \EasyWeChat\Support\Collection

Move user to a group.

Parameters

string $openId
integer $groupId

Returns

\EasyWeChat\Support\Collection

moveUsers()

moveUsers(array  $openIds, integer  $groupId) : \EasyWeChat\Support\Collection

Batch move users to a group.

Parameters

array $openIds
integer $groupId

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