Making API Calls

API calls are made by using NIKEPLUS.api. The first argument is the endpoint (see API documentation for available endpoints), the second argument is an object of options.

Possible NIKEPLUS.api options

Option Values Default Description
success Function   Called when the API call succeeds. It receives the result of the API call.
error Function   Called when the API call results in an error. It receives information about the error.
data Object   An object of the data to be sent with the API request.
method HTTP method
GET The HTTP method of the API call.
cache Boolean true If false, a timestamp will be added to get requests so the browser does not serve a cached response.