\duncan3dc\Sonos\Cloud\InterfacesApiInterface

Summary

Methods
Constants
getUrl()
getAccessToken()
request()
getUser()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getUrl()

getUrl() : string

Get the authorisation URL for the API.

Returns

string

getAccessToken()

getAccessToken(string  $code) : \League\OAuth2\Client\Token\AccessToken

Generate an access token for the API.

Parameters

string $code

Returns

\League\OAuth2\Client\Token\AccessToken

request()

request(string  $method, string  $url, array  $data, \League\OAuth2\Client\Token\AccessToken  $token) : \stdClass

Send a request and return the response.

Parameters

string $method

The HTTP verb to use for the request

string $url

The url to issue the request to (https://api.ws.sonos.com/control/api/v1/ is optional)

array $data

The parameters to send with the request

\League\OAuth2\Client\Token\AccessToken $token

The access token for authorisation

Returns

\stdClass

getUser()

getUser(string  $username, \Psr\SimpleCache\CacheInterface|null  $cache = null) : \duncan3dc\Sonos\Cloud\Interfaces\UserInterface

Get a user instance.

Parameters

string $username
\Psr\SimpleCache\CacheInterface|null $cache

Returns

\duncan3dc\Sonos\Cloud\Interfaces\UserInterface