Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
Jim Nicholls edited this page Dec 10, 2017 · 4 revisions

sierra-api-as-promised

sierra-api-as-promised implements access to Sierra API versions 4 and 5.

Sierra API version 4

Sierra API version 5

API design

See API design

Authentication and bearer tokens

sierra-api-as-promised will take care of authenicating using SIERRA_API_KEY and SIERRA_API_SECRET and obtaining a bearer token on your behalf. It will do this when you make the first API call. It will reuse the bearer token until it expires, typically after 1 hour. After the bearer token expires, the next API call will reauthenticate and obtain a new bearer token.

Promises

sierra-api-as-promised uses request-promise-any to make the Sierra API requests. request-promise-any in turn uses promise-any to control which Promise library will be used. By default, the native ES6 promise library is used. By other Promise libraries, such as bluebird can be used. The promise-any documentation shows how to use a specific Promise library.