The API function in the Javascript SDK makes it easy to call Oauth based APIs. By using it, auth tokens will be handled automatically. To make a API call, an Y8 Account user must first be logged in.

Alternately, if you need to access an Y8 Account API for a guest, there is the apiGuest function.

See the API reference for a list of calls available.


ID.api('API url', 'METHOD', arguments, callback);


ID.apiGuest('API url', 'METHOD', arguments, callback);
  • Url is everything after
  • Method is usually POST or GET
  • The argument is usually null but can be a JS object. Ex. {key: value}
  • Callback function with response argument


<script type="text/javascript">
ID.api('links/pending', 'GET', null, function(response){