Description

This function creates a branding package's directory.

 

Examples


https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Branding&cpanel_jsonapi_func=createpkg&pkg="mypkg"

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Create a new branding package.
$new_branding_pkg = $cpanel->api2(
    'Branding', 'createpkg',
		array(        
			'pkg'      => 'mypkg',
    ) 
 );

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Create a new branding package.
my $new_branding_pkg = $cpliveapi->api2(
    'Branding', 'createpkg',
    { 
			'pkg'      => 'mypkg',
	}
 );

 

cpapi2 --user=username Branding createpkg pkg=mypkg

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "createpkg",
    "data": [
      {
        "pkg": "mypkg"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Branding"
  }
}

 

Parameters

InputTypeDescriptionPossible valuesExample
pkgstring

Required

The new branding package name.

A string value.

You cannot use the following values:

  • root
  • A blank value.
  • Any value that contains a forward slash (/).
mypkg

 

Returns

ReturnTypeDescriptionPossible valuesExample
errorstring

An error message.

This function only returns an error value if it failed. 

A string that describes the error.Branding package names may not contain the "/" character.
pkgstringThe branding package name.

The pkg parameter's value.

mypkg
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1