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

Description

This function sets the server's profile.

Notes:

  • You cannot use this function if accounts exist on the server.
  • For a list of the server's available profiles, use the get_available_profiles function.


Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/start_profile_activation?api.version=1&code=MAILNODE&optional=%7B%22SpamFilter%22%3A1%2C+%22DNS%22%3A0%7D
 Command Line
whmapi1 start_profile_activation code=MAILNODE optional={"SpamFilter": 1, "DNS":0}


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.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "data":{  
      "log_id":"17053.10418168.1533478604"
   },
   "metadata":{  
      "version":1,
      "command":"start_profile_activation",
      "reason":"OK",
      "result":1
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
codestring

Required

The code value of the server profile.

  • STANDARDNODE — The Standard Node profile.
  • DATABASENODE — The Database Node profile.
  • MAILNODE — The Mail Node profile.
  • DNSNODE — The DNS Node profile.
MAILNODE
optionalJSON

The optional roles to enable or disable with the profile, in JSON format.

Note:

This parameter does not enable optional roles for profiles that do not possess any optional roles.

For a list of profiles and their optional roles, read our How to Use Server Profiles documentation.

If you do not pass this parameter, the system disables a profile's optional roles, if any exist.

  • 0 — Disable role.
  • 1 — Enable role.
{"SpamFilter": 1, "DNS":0}

Returns

ReturnTypeDescriptionPossible valuesExample
log_idinteger

The profile activation log ID.

The system creates the log files in the /var/cpanel/logs/activate_profile/ directory.

A valid integer.

17053.10418168.1533478604