Return whether directory uses password protection

This function confirms whether a directory uses password protection.

SecurityBasicAuth
Request
query Parameters
dir
required
string <path>

The absolute directory path on the cPanel account to check for password protection.

Example: dir=/home/example/example.com
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/DirectoryPrivacy/is_directory_protected
Request samples
uapi --output=jsonpretty \
  --user=username \
  DirectoryPrivacy \
  is_directory_protected \
  dir='/home/example/example.com'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "is_directory_protected",
  • "module": "DirectoryPrivacy",
  • "result": {
    • "data": {
      • "auth_name": "Protected 'example.com'",
      • "auth_type": "Basic",
      • "passwd_file": "/home/example/.htpasswds/example.com/passwd",
      • "protected": 1
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}