Module: api

API

Source:

Members

(inner, constant) api :object

Container object for API call methods

Type:
  • object
Properties:
Name Type Description
get module:api~apiCall

GET API call method

post module:api~apiCall

POST API call method

patch module:api~apiCall

PATCH API call method

delete module:api~apiCall

DELETE API call method

Source:
See:
  • HTTP_METHODS for more information

Methods

(protected, inner) apiCall(httpMethod, options, callback)

Makes a call to the RewardOps API

Parameters:
Name Type Description
httpMethod string

The name of the HTTP method

options object

API request options.

Properties
Name Type Attributes Description
path string

The relative path to the API endpoint.

config object

The config object to use in the API request (usually the result of RO.config.getAll()).

params object <optional>

A params object to send with the API request. For GET requests these are sent as query params. For other requests they are sent as a JSON body.

callback module:api~requestCallback

Callback that handles the response

Source:

Type Definitions

requestCallback(error, responseBody, response, reqopt)

Callbacks follow the Node.js error-first callback pattern.

Parameters:
Name Type Attributes Description
error Error | null

Either an Error object or null if there's no error

responseBody object

The 'result' object from the API response body

response object

The full body of the response from the API. This includes pagination details, if present

req object <optional>

The full request object from the request library.

Source: