The add-package operation is used to add applications to reseller plans.

Request Packet Structure

A request XML packet adding a new application to a reseller plan includes the add-package operation node:

<packet version="1.6.3.1">
<reseller-plan>
   <add-package>
   ...
   </add-package>
</reseller-plan>
</packet>

The add-package node is presented by the ResellerApplicationInput type (reseller_template.xsd). Its graphical representation is as follows:

image 66909.gif

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It specifies the filtering rule. Data type: ResellerSelectionFilter. For more information on filters, refer to the Available Filters section.
  • The package node is required. It specifies what type of information about the added package is requested. Data type: ApplicationInput (plesk_common.xsd).
  • The name node is required. It specifies the name of the application that will be added to the reseller plan. Data type: string.
  • The value node is required. It specifies the value of the application that will be added to the reseller plan. Data type: string.

Response Packet Structure

he add-package node of the response packet is structured as follows:

image 66911.gif

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is required. It wraps the response got from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. Specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Returns the error code when the operation fails. Data type: unsignedInt.
  • The errtext node is optional. Returns the error message if the operation fails. Data type: string.
  • The filter-id node is optional. Returns the parameter by which the reseller plan was filtered by in the request packet. Data type: anySimple.
  • The id node is optional. Returns the identifier of the reseller plan to which the application was added. Data type: id_type (common.xsd).

Samples

A packet that adds an application package WordPress to the reseller plan with ID 1234 looks as follows:

<packet>
<reseller-plan>
<add-package>
   <filter>
      <id>1234</id>
   </filter>
   <package>
       <name>name</name>
       <value>WordPress</value>
    </package>
</add-package>
</reseller-plan>
</packet>

Response:

<packet>
<reseller-plan>
<add-package>
   <result>
      <status>ok</status>
      <filter-id>1234</filter-id>
      <id>1234</id>
   </result>
</add-package>
</reseller-plan>
</packet>

Negative response from the server looks as follows:

<packet>
<reseller-plan>
<add-package>
   <result>
      <status>error</status>
      <errcode>1023</errcode>
      <errtext>Operation failed.</errtext>
      <filter-id>1234</filter-id>
      <id>1234</id>
   </result>
</add-package>
</reseller-plan>
</packet>