Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Retrieve Documentation about a Specified Key — fetch_doc_key

This function call allows you to retrieve documentation about a key referenced within a specified module.

Calling Functions

Using the XML API

To use the XML API to perform the fetch_doc_key function from within your custom script:

  • Append the /xml-api/fetch_doc_key function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/fetch_doc_key

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the fetch_doc_key function from within your custom script:

  • Append the /json-api/fetch_doc_key function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/fetch_doc_key

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The following variables are required:

  • module (string) — The module that contains the key corresponding to the documentation to retrieve. (e.g. Exim)
  • key (string) — The key corresponding to the documentation to return. (e.g. acl_smtp_expn or openssl_options)

The following variable is optional:

  • section (string) — A particular section of the documentation to retrieve.

Output

  • fetch_doc_key — The function's results container.
    • doc — The documentation's results container.
      • name (string) — The name of the requested key.
      • default (string) — The key's default value.
      • description (string) — An HTML-formatted description of the requested key.
      • type (string) — The variable type of the requested key.

Examples

XML API

Calling the URL https://example.com:2087/xml-api/fetch_doc_key?module=Exim&key=acl_smtp_expn in WebHost Manager will produce output similar to:

<fetch_doc_key>
	<doc>
		<name>acl_smtp_expn</name>
		<default>unset</default>
		<description>
			<p> This option defines the ACL that is run when an SMTP EXPN command is received. See chapter <a href="http://www.exim.org/exim-html-current/doc/html/spec_html/ch40.html" target="_blank" title="40. Access control lists">40</a> for further details. </p>
		</description>
		<type>string</type>
	</doc>
</fetch_doc_key>

JSON API

Calling the URL https://example.com:2087/json-api/fetch_doc_key?module=Exim&key=acl_smtp_expn in WebHost Manager will produce output similar to:

{
   "doc":{
      "name":"acl_smtp_expn",
      "type":"string",
      "default":"unset",
      "description":"<p>\n\nThis option defines the ACL that is run when an SMTP EXPN command is\nreceived. See chapter <a href=\"http://www.exim.org/exim-html-current/doc/html/spec_html/ch40.html\" target=\"_blank\" title=\"40. Access control lists\">40</a> for further details.\n</p>"
   }
}

Topic revision: r1 - 14 Feb 2012 - 18:15:21 - Main.JustinSchaefer