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

About this method # A

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 # A

Perform a custom request:#

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

Parameters # A

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 # A

No response

Did you find this page helpful?
PHP v3