docs: function requestPromise(options) {
      options = options || {};
      var headers = {'User-Agent': options.userAgent || 'request'};
  
      if (options.oauthKey) {
          headers.Authorization = 'token ' + options.oauthKey;
      }
  
      return new Promise(function (resolve, reject) {
          request({
              url: options.url,
              json: true,
              headers: headers
          }, function (error, response, body) {
              if (error) {
                  return reject(error);
              }
  
              // Check response headers for pagination links
              var links = response.headers.link,
                  nextPageUrl = '';
  
              if (links && _.includes(links, 'next')) {
                  nextPageUrl = links.substring(1, links.indexOf('>; rel="next'));
              }
  
              if (error) {
                  return reject(error);
              }
  
              function decorateError(error) {
                  if (!error) {
                      throw new Error('error is required.');
                  }
  
                  error.url = options.url;
                  error.http_status = response.statusCode;
                  error.ratelimit_limit = response.headers['x-ratelimit-limit'];
                  error.ratelimit_remaining = response.headers['x-ratelimit-remaining'];
                  error.ratelimit_reset = parseInt(response.headers['x-ratelimit-reset'], 10);
  
                  return error;
              }
  
              if (response.statusCode >= 500) {
                  return reject(decorateError(new Error('Server error on url ' + options.url)));
              }
              if (response.statusCode >= 400) {
                  return reject(decorateError(new Error('Client error on url ' + options.url)));
              }
              if (response.statusCode === 202) {
                  if (!options.retry || options.retryCount > 4) {
                      return reject(decorateError(new Error('API returned status 202. Try again in a few moments.')));
                  }
  
                  var retryCount = parseInt(options.retryCount, 10) || 0,
                      retryPromise = Promise.delay(retryDelay(retryCount)).then(function () {
                      return requestPromise({
                          url: options.url,
                          userAgent: options.userAgent || 'request',
                          oauthKey: options.oauthKey,
                          retry: true,
                          retryCount: retryCount + 1
                      });
                  });
  
                  return resolve(retryPromise);
              }
              return resolve([body, nextPageUrl]);
          });
      });
  }