For the complete documentation index, see llms.txt. This page is also available as Markdown.

redivis.makeApiRequest

redivis.makeApiRequest({ method, path, query, payload, headers, parseResponse, signal }) → Promise<any>

Makes a request to the Redivis REST API, authenticating as needed and retrying transient failures. Useful for functionality that isn't otherwise exposed by this library.

const { results } = await redivis.makeApiRequest({
  path: '/organizations/demo/datasets',
  query: { maxResults: 10 },
});

Parameters:

method : string, default 'GET' The HTTP method.

path : string The path, relative to the API root (e.g. /users/me).

query : object, optional Query parameters. Array values are sent as repeated parameters.

payload : object, optional The request body, which is sent as JSON.

headers : object, optional Additional request headers.

parseResponse : boolean, default true Whether to parse the response body (as JSON, if it's JSON, and as text otherwise). If false, the raw Response is returned.

signal : AbortSignal, optional

Returns: the parsed response body, or a Response if parseResponse is false.

Was this helpful?