Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_GET

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

API_CREATE

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

API_UPDATE

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

API_DELETE

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

API_USER_TAGS

API_USER_TAGS = 'https://api.weixin.qq.com/cgi-bin/tags/getidlist'

API_MEMBER_BATCH_TAG

API_MEMBER_BATCH_TAG = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging'

API_MEMBER_BATCH_UNTAG

API_MEMBER_BATCH_UNTAG = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging'

API_USERS_OF_TAG

API_USERS_OF_TAG = 'https://api.weixin.qq.com/cgi-bin/user/tag/get'

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

Throws

\EasyWeChat\Core\Exceptions\HttpException

Returns

\EasyWeChat\Support\Collection

| null

update()

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

Update a tag name.

Parameters

integer $tagId
string $name

Returns

\EasyWeChat\Support\Collection

userTags()

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

Get user tags.

Parameters

string $openId

Returns

\EasyWeChat\Support\Collection

usersOfTag()

usersOfTag(string  $tagId, string  $nextOpenId = '') : \EasyWeChat\Support\Collection

Get users from a tag.

Parameters

string $tagId
string $nextOpenId

Returns

\EasyWeChat\Support\Collection

batchTagUsers()

batchTagUsers(array  $openIds, integer  $tagId) : \EasyWeChat\Support\Collection

Batch tag users.

Parameters

array $openIds
integer $tagId

Returns

\EasyWeChat\Support\Collection

batchUntagUsers()

batchUntagUsers(array  $openIds, integer  $tagId) : \EasyWeChat\Support\Collection

Untag users from a tag.

Parameters

array $openIds
integer $tagId

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