Child pages
  • WHM API 1 Functions - edit_hook
Skip to end of metadata
Go to start of metadata

 

Description

This function edits a script hook.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/edit_hook?api.version=1&id=HzEpGvT6QGUYwxuX3hWB8AUq&enabled=1&description=TestHook&notes=Note
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/edit_hook?api.version=1&id=HzEpGvT6QGUYwxuX3hWB8AUq&enabled=1&description=TestHook&notes=Note
 Command Line
whmapi1 edit_hook id=HzEpGvT6QGUYwxuX3hWB8AUq enabled=1 description=TestHook notes=Note


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
 "metadata": {
    "result": 1,
    "reason": "OK",
    "version": 1,
    "command": "edit_hook"
  }
}
 Output (XML)
    <metadata>
        <reason>OK</reason>
        <result>1</result>
        <version>1</version>
        <command>edit_hook</command>
    </metadata>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

 

Parameters

ParameterTypeDescriptionPossible valuesExample

id

string

Required

The script hook's ID.

Note:

To retrieve a hook's ID, use the list_hooks function.

A valid string.

HzEpGvT6QGUYwxuX3hWB8AUq
enabledBoolean

Required

Whether the hook is enabled.

  • 1 — Enabled.
  • 0 — Disabled.
1
descriptionstring

Required

The script hook's description.

A valid string.
TestHook
notesstringThe script hook's notes.A valid string.
Note

Returns

This function only returns metadata.