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

 

Description

This function lists the server's cPanel styles.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/list_styles?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/list_styles?api.version=1
 Command Line
whmapi1 list_styles


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. 

 Output (JSON)
{  
   "metadata":{  
      "version":1,
      "command":"list_styles",
      "result":1,
      "reason":"OK"
   },
   "data":{  
      "list":[  
         {  
            "default":1,
            "preview":1,
            "type":"default",
            "name":"basic",
            "display_name":"Basic"
         },
         {  
            "display_name":"retro",
            "name":"retro",
            "type":"default",
            "preview":1
         }
      ]
   }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <command>list_styles</command>
        <reason>OK</reason>
        <result>1</result>
    </metadata>
    <data>
        <list>
            <preview>1</preview>
            <default>1</default>
            <type>default</type>
            <name>basic</name>
            <display_name>Basic</display_name>
        </list>
        <list>
            <name>retro</name>
            <display_name>retro</display_name>
            <type>default</type>
            <preview>1</preview>
        </list>
    </data>
</result>


Note:

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

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
listarray of hashesAn array of hashes of cPanel styles on the server.Each hash contains the default, preview, type, name, and display_name returns. 

default

Boolean

Whether the style is the server's default style.

The function returns this value in the list hash.

  • 1 — Default style.
  • 0 — Not the default style.
1

preview

Boolean

Whether the style includes a preview image.

The function returns this value in the list hash.

  • 1 — Includes a preview image.
  • 0 — Does not include a preview image.
1

type

string

The style type.

The function returns this value in the list hash.

  • default
  • global
  • reseller
  • user
default

name

string

The style's name within the server's files.

The function returns this value in the list hash.

A valid string. The system uses the style's directory name (the compressed style's filename) as the style name.

basic

display_name

string

The style's name as it appears within cPanel & WHM interfaces.

The function returns this value in the list hash.

A valid string.

Basic