Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_DEVICE_APPLYID

API_DEVICE_APPLYID = 'https://api.weixin.qq.com/shakearound/device/applyid'

API_DEVICE_APPLYSTATUS

API_DEVICE_APPLYSTATUS = 'https://api.weixin.qq.com/shakearound/device/applystatus'

API_DEVICE_UPDATE

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

API_DEVICE_BINDLOCATION

API_DEVICE_BINDLOCATION = 'https://api.weixin.qq.com/shakearound/device/bindlocation'

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

apply()

apply(integer  $quantity, string  $reason, string  $comment = '', integer  $poiId = null) : \EasyWeChat\Support\Collection

Apply device ids.

Parameters

integer $quantity
string $reason
string $comment
integer $poiId

Returns

\EasyWeChat\Support\Collection

getStatus()

getStatus(integer  $applyId) : \EasyWeChat\Support\Collection

Get audit status.

Parameters

integer $applyId

Returns

\EasyWeChat\Support\Collection

update()

update(array  $deviceIdentifier, string  $comment) : \EasyWeChat\Support\Collection

Update a device comment.

Parameters

array $deviceIdentifier
string $comment

Returns

\EasyWeChat\Support\Collection

bindLocation()

bindLocation(array  $deviceIdentifier, integer  $poiId, integer  $type = 1, string  $poiAppid = null) : \EasyWeChat\Support\Collection

Bind location for device.

Parameters

array $deviceIdentifier
integer $poiId
integer $type
string $poiAppid

Throws

\EasyWeChat\Core\Exceptions\InvalidArgumentException

Returns

\EasyWeChat\Support\Collection

fetchByIds()

fetchByIds(array  $deviceIdentifiers) : \EasyWeChat\Support\Collection

Fetch batch of devices by deviceIds.

Parameters

array $deviceIdentifiers

Returns

\EasyWeChat\Support\Collection

pagination()

pagination(integer  $lastSeen, integer  $count) : \EasyWeChat\Support\Collection

Pagination to fetch batch of devices.

Parameters

integer $lastSeen
integer $count

Returns

\EasyWeChat\Support\Collection

fetchByApplyId()

fetchByApplyId(integer  $applyId, integer  $lastSeen, integer  $count) : \EasyWeChat\Support\Collection

Fetch batch of devices by applyId.

Parameters

integer $applyId
integer $lastSeen
integer $count

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

fetch()

fetch(array  $params) : \EasyWeChat\Support\Collection

Fetch batch of devices.

Parameters

array $params

Returns

\EasyWeChat\Support\Collection