src/wootric/wootric-feeder.js
/**
   * Send a request to Wootric API for an oAuth Token.
   *
   * @return {Promise}
   *
   */
Send a request to Wootric API for an oAuth Token.
@return {Promise}
Send a request to Wootric API for an oAuth Token . @return { Promise }
async requestWootricForToken() {
    try {
      const {
        body,
      } = await request
        .post(Config.wootric.authUrl)
        .send({
          'grant_type': Config.wootric.grantType,
        })
        .send({
          'client_id': Config.wootric.clientId,
        })
        .send({
          'client_secret': Config.wootric.clientSecret,
        });
      this.cache_.store(Util.hashCode(KEY_TOKEN_FOR_WOOTRIC), body, {
        'in': Number.parseInt(body.expires_in, 10),
      });
      return body;
    } catch (e) {
      Logger.error(e);
    }
  }
async requestWootricForToken ( ) { try { const { body , } = await request . post ( Config . wootric . authUrl ) . send ( { 'grant_type' : Config . wootric . grantType , } ) . send ( { 'client_id' : Config . wootric . clientId , } ) . send ( { 'client_secret' : Config . wootric . clientSecret , } ) ; this . cache_ . store ( Util . hashCode ( KEY_TOKEN_FOR_WOOTRIC ) , body , { 'in' : Number . parseInt ( body . expires_in , 10 ) , } ) ; return body ; } catch ( e ) { Logger . error ( e ) ; } }
Send a request to Wootric API for an oAuth Token.
Send a request to Wootric API for an oAuth Token .