Module

api

API

View Source api.js, line 1

Members

object

# inner constant api

Container object for API call methods

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

See:
  • HTTP_METHODS for more information

View Source api.js, line 162

Methods

# protected inner apiCall(httpMethod, options, callback)

Makes a call to the RewardOps API

Parameters:
Name Type Attributes Description
httpMethod string

The name of the HTTP method

options object

API request options.

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

View Source api.js, line 47

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.

View Source api.js, line 184