Getting User Account Details

Use the get operation to retrieve the information on user accounts.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving information about user accounts includes the get operation node:

<packet>
<user>
   <get>
   ...
   </get>
</user>
</packet>

 

The get node is nested within the UserGetInput type (user.xsd). This node has the following graphics representation:

user-get-rps.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.

  • filter, required

    It specifies the filtering rule. Data type: UserSelectionFilterType (user.xsd). For more information on filters, refer to the Available Filters section.

  • dataset, required

    It indicates the types of information requested from Plesk. Data type: UserDatasetInput (user.xsd).

  • gen_info, optional

    It is used to request the general account information. Data type: UserGetGenInfo (user.xsd).

  • roles, optional

    It is used to request details on account roles. Data type: none.

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

The get node of the response packet is structured as follows:

user-get-reps.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.

  • result, required

    It wraps the result of the requested operation. Data type: extension of resultType (common.xsd).

  • status, required

    It returns the execution status of the operation. Data type: string. Allowed values: ok | error.

  • errcode, optional

    Is used to return the error code when the operation fails. Data type: unsignedInt.

  • errtext, optional

    Can be used to return an error message if the operation fails. Data type: string.

  • filter-id, optional

    Returns the filtering rule specified in the request packet. Data type: anySimple.

  • id, optional

    It is required if the operation succeeds. It returns the unique identifier of the user account for which the data were retrieved. Data type: integer.

  • data, optional

    It is present if the get operation succeeds. Returns a requested collection of user settings. Data type: UserGetOutputData (user.xsd). See the structure of this node below.

 

The data node is structured as follows:

  • gen-info, optional

    It specifies the general information about the user account. Data type: UserAddGenInfo (user.xsd).

  • login, required

    It specifies the e-mail address of the account. Typically, the address contains a name of a site controlled by the account owner. Data type: string.

  • name, required

    It specifies the user name. Data type: string.

  • owner-guid, required

    It specifies the GUID of an account owner. Data type: string.

  • status, required

    It specifies the account status. Data type: string. Allowed values: enabled | disabled

  • guid, required

    It contains a GUID of the user account. Data type: string.

  • is-built-in, required

    If a role is the Admin or Accountant, the node value is true. Otherwise, it is false. Data type: boolean.

  • contact-info, optional

    It specifies contact information for this user account. Data type: ContactInfoAdd (user.xsd). To see the node definition, refer to section User Contact Information.

  • external-id, optional

    It specifies the ID of the user account in the Panel components. Data type: string.

  • subscription-domain-id, optional

    It specifies the ID of the domain to which the user has access. Data type: string.

  • email, required

    It specifies the user's email address. Data type: string.

  • mailname-id, optional

    If a user has an associated mail account, this parameter will show its ID. Data type: string.

  • roles, optional

    It specifies the user account role settings. Data type: UserAddRoles (user.xsd).

  • name, required

    It specifies the name of a role assigned to the account. Data type: string.

 

Samples

A request packet to get a user account details can look as follows:

<packet>
<user>
<get>
   <filter>
      <guid>96197aa9-389a-db5b-aadc-88350b24fcdd</guid>
   </filter>
<dataset>
  <gen-info/>
</dataset>
</get>
</user>
</packet>

Response:

<packet version="1.6.3.0">
  <user>
    <get>
      <result>
        <status>ok</status>
        <filter-id>96197aa9-389a-db5b-aadc-88350b24fcdd</filter-id>
        <id>1</id>
        <data>
          <gen-info>
            <login>admin</login>
            <name>Eugene Grin</name>
            <owner-guid>58bb9092-4c8b-4110-ba3d-c40bdad3b178</owner-guid>
            <status>enabled</status>
            <guid>96197aa9-389a-db5b-aadc-88350b24fcdd</guid>
            <is-built-in>1</is-built-in>
            <contact-info>
              <company>Grin LLC</company>
              <phone>0-000-0000000</phone>
              <fax/>
              <address>New York</address>
              <city>New York</city>
              <state>New York</state>
              <zip>10101</zip>
              <country>US</country>
            </contact-info>
            <external-id/>
          </gen-info>
        </data>
      </result>
    </get>
  </user>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.