UAPI Functions - Mime::list_hotlinks

This function lists domains with hotlink protection.


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Mime/list_hotlinks

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List domains with hotlink protection.
$mime_list_hotlinks $cpanel->uapi(
    'Mime''list_hotlinks'
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List domains with hotlink protection.
my $mime_list_hotlinks $cpliveapi->uapi(
    'Mime''list_hotlinks',
);

 cPanel Template Toolkit

<!--  List domains with hotlink protection. -->
[% data = execute( 'Mime', 'list_hotlinks', ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 Command Line

uapi --user=username Mime list_hotlinks

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": {
    "extensions": "jpg,jpeg,gif,png,bmp",
    "allow_null": 0,
    "redirect_url": null,
    "urls": [
      "http://example.com",
      "http://www.example.com"
    ],
    "state": "disabled"
  }
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

This function does not accept parameters.

Return

Type

Description

Possible values

Example

urls

string

A list of the domains with hotlink protection.

An array of one or more valid URLs.

 

http://example.com/

extensions

string

File types to hotlink protect. 

 A comma-separated list of valid file extensions. 

jpg,jpeg,gif,png,bmp

allow_null

 Boolean 

 Whether the domain allows hotlinks from an empty or null referral URL. 

  • 1 — Allows hotlinks.
  • 0 — Does not allow hotlinks.

 1

 redirect_url 

string

The URL to which to send hotlinkers.

A valid URL.

 http://redirect.example.com/ 

state

string

Whether hotlink protection is enabled.

  • enabled
  • disabled

disabled

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....