batch

This function combines calls for multiple WHM API 1 functions.

Authorizations:
query Parameters
command
required
string
Example: command=version

The WHM API 1 function to call.

Important:

Specify a command parameter for each function.

Note:

Include the function's input parameters as a URI-encoded list after the function name. For example, to call the killdns function with a domain parameter value of example.com directly you would use:

killdns?domain=example.com

To call this function using the batch function, URI-encode the command and pass it as part of the batch function:

/json-api/batch?api.version=1&command=killdns%3Fdomain%3Dexample.com

You can call the same function multiple times within a single batch API call. For example:

/json-api/batch?api.version=1&command=version&command=version&command=version

abort_on_error
integer
Default: 0
Enum: 0 1
Example: abort_on_error=0

Whether to stop processing remaining commands in the batch when a command returns an error.

  • 1 — Do not process remaining commands in the batch when an error occurs.
  • 0 — When an error occurs, process the remaining commands in the batch.

Responses

Response Schema: application/json
object
object

Request samples

whmapi1 batch command='version'

Response samples

Content type
application/json
{
  • "data": {
    • "result": [
      • {
        • "data": {
          • "hostname": "example-hosting.com"
          },
        • "metadata": {
          • "command": "gethostname",
          • "reason": "OK",
          • "result": 1,
          • "version": 1
          }
        },
      • {
        • "data": {
          • "version": "11.88.0.1"
          },
        • "metadata": {
          • "command": "version",
          • "reason": "OK",
          • "result": 1,
          • "version": 1
          }
        }
      ]
    },
  • "metadata": {
    • "command": "batch",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}