ClientCredentialsFlowApi class

Implements client credentials flow.

Client credentials flow is the most easy way to start access KKBOX's Open API. Just create a new instance of ClientCredentialsFlowApi, pass your client ID and client secret contained in a ClientConfiguration object, and then call run.

For example:

final config =
    ClientConfiguration(clientId: YOUR_CLIENT_ID, clientSecret: SECRET);
final flow = ClientCredentialsFlow(configuration: config);
final accessToken = await flow.run();

See https://docs-en.kkbox.codes/v1.1/reference#client-credentials-flow and https://docs.kkbox.codes/docs/client-credentials-flow .

Constructors

ClientCredentialsFlowApi({@required ClientConfiguration configuration})
Creates a new instance.

Properties

configuration ClientConfiguration
A configuration object including client ID, client secret and environment setting.
final
contentType → ContentType
Content type of the API call. [...]
read-only, inherited
customGetParameters Map<String, String>
A list of custom GET parameters. [...]
read-only, inherited
customHTTPHeaders Map<String, String>
Custom HTTP headers. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
httpMethod → HTTPMethod
HTTP method used in the API. [...]
read-only
postData Map
Data for doing POST calls.Subclasses should override it.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
url String
Endpoint of the API. [...]
read-only

Methods

handleResponse(Response response) Future<AccessToken>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
parseResult(String body) AccessToken
How an API convert HTTP responses to model objects. [...]
run() Future<AccessToken>
Fire the API call.
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited