Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

API_DEVICE

API_DEVICE = 'https://api.weixin.qq.com/shakearound/statistics/device'

API_DEVICE_LIST

API_DEVICE_LIST = 'https://api.weixin.qq.com/shakearound/statistics/devicelist'

API_PAGE

API_PAGE = 'https://api.weixin.qq.com/shakearound/statistics/page'

API_PAGE_LIST

API_PAGE_LIST = 'https://api.weixin.qq.com/shakearound/statistics/pagelist'

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

deviceSummary()

deviceSummary(array  $deviceIdentifier, integer  $beginDate, integer  $endDate) : \EasyWeChat\Support\Collection

Fetch statistics data by deviceId.

Parameters

array $deviceIdentifier
integer $beginDate

(Unix timestamp)

integer $endDate

(Unix timestamp)

Returns

\EasyWeChat\Support\Collection

batchDeviceSummary()

batchDeviceSummary(integer  $timestamp, integer  $pageIndex) : \EasyWeChat\Support\Collection

Fetch all devices statistics data by date.

Parameters

integer $timestamp
integer $pageIndex

Returns

\EasyWeChat\Support\Collection

pageSummary()

pageSummary(integer  $pageId, integer  $beginDate, integer  $endDate) : \EasyWeChat\Support\Collection

Fetch statistics data by pageId.

Parameters

integer $pageId
integer $beginDate

(Unix timestamp)

integer $endDate

(Unix timestamp)

Returns

\EasyWeChat\Support\Collection

batchPageSummary()

batchPageSummary(integer  $timestamp, integer  $pageIndex) : \EasyWeChat\Support\Collection

Fetch all pages statistics data by date.

Parameters

integer $timestamp
integer $pageIndex

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