API client / Methods / Advanced
Required API Key:
Method signature
$client->custom(
  string $method,
  string $path,
  array $requestOptions,
  array $hosts
);

We released a new version of the PHP API client in public beta. Read the beta documentation for more information.

We released a new version of the JavaScript API client in public beta. Read the beta documentation for more information.

We released a new version of the Java API client in public beta. Read the beta documentation for more information.

You’re currently reading the JavaScript API client v4 documentation. Check the migration guide to learn how to upgrade from v3 to v4. You can still access the v3 documentation.

You’re currently reading the Ruby API client v2 documentation. Check the migration guide to learn how to upgrade from v1 to v2. You can still access the v1 documentation.

About this method

Perform a custom request

Perform a request from the given parameters and send it through the requester, making use of the underlying retry strategy.

Examples

Read the Algolia CLI documentation for more information.

Perform a custom request:

1
2
3
4
$res = $client->custom(
  'GET',
  api_path('/1/custom/endpoint')
);

Parameters

path
type: string
Required

The path of the API endpoint to call, as exposed in the documentation.

method
type: string
Required

REST HTTP method to send with the query, can be one of: GET, POST, PUT, DELETE.

callType
Required

Indicate whether the HTTP call performed is of type [read] (GET) or [write] (POST, PUT ..). Used to determine which timeout duration to use.

requestOptions
type: list
default: No requestOptions
Optional

A mapping of requestOptions to send along with the request.

Response

This method doesn't return a response.

Did you find this page helpful?