WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_service_config_key
- A server running WHM.
https://whm-server.tld:2087/json-api/get_service_config_key
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_service_config_key?key=mail_process_size&service=dovecot'{ "data": { "key name": "512", "mail_process_size": null }, "metadata": { "command": "get_service_config_key", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_service_proxy_backends
- A server running WHM.
https://whm-server.tld:2087/json-api/get_service_proxy_backends
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_service_proxy_backends?username=example'{ "data": { "payload": [ … ] }, "metadata": { "command": "get_service_proxy_backends", "reason": "OK", "result": 1, "version": 1 } }
Request
This function restarts a service, or daemon, on a server.
Note:
If the user only possesses the clustering Access Control List (ACL) then this function can only act on the named service.
The service to restart. For a list of possible values, read our Access Control List (ACL) documentation.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restartservice
- A server running WHM.
https://whm-server.tld:2087/json-api/restartservice
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restartservice?service=exim&queue_task=0'{ "data": { "output": "Waiting for httpd to restart..............finished.\\n\\nhttpd (/usr/local/apache/bin/httpd -k start -DSSL) running as root with PID 21379\\nhttpd (/usr/local/apache/bin/httpd -k start -DSSL) running as root with PID 21385\\n\\nhttpd started ok\\n", "service": "exim" }, "metadata": { "command": "restartservice", "reason": "OK", "result": 1, "version": 1 } }