Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_ADD

API_ADD = 'https://api.weixin.qq.com/shakearound/device/group/add'

API_UPDATE

API_UPDATE = 'https://api.weixin.qq.com/shakearound/device/group/update'

API_DELETE

API_DELETE = 'https://api.weixin.qq.com/shakearound/device/group/delete'

API_GET_LIST

API_GET_LIST = 'https://api.weixin.qq.com/shakearound/device/group/getlist'

API_GET_DETAIL

API_GET_DETAIL = 'https://api.weixin.qq.com/shakearound/device/group/getdetail'

API_ADD_DEVICE

API_ADD_DEVICE = 'https://api.weixin.qq.com/shakearound/device/group/adddevice'

API_DELETE_DEVICE

API_DELETE_DEVICE = 'https://api.weixin.qq.com/shakearound/device/group/deletedevice'

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 device group name.

Parameters

integer $groupId
string $name

Returns

\EasyWeChat\Support\Collection

delete()

delete(integer  $groupId) : \EasyWeChat\Support\Collection

Delete device group.

Parameters

integer $groupId

Returns

\EasyWeChat\Support\Collection

lists()

lists(integer  $begin, integer  $count) : \EasyWeChat\Support\Collection

List all device groups.

Parameters

integer $begin
integer $count

Returns

\EasyWeChat\Support\Collection

getDetails()

getDetails(integer  $groupId, integer  $begin, integer  $count) : \EasyWeChat\Support\Collection

Get details of a device group.

Parameters

integer $groupId
integer $begin
integer $count

Returns

\EasyWeChat\Support\Collection

addDevice()

addDevice(integer  $groupId, array  $deviceIdentifiers) : \EasyWeChat\Support\Collection

Add one or more devices to a device group.

Parameters

integer $groupId
array $deviceIdentifiers

Returns

\EasyWeChat\Support\Collection

removeDevice()

removeDevice(integer  $groupId, array  $deviceIdentifiers) : \EasyWeChat\Support\Collection

Remove one or more devices from a device group.

Parameters

integer $groupId
array $deviceIdentifiers

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