Use the get operation in the following cases:

  • To retrieve list of language packs installed on the server
  • To retrieve detailed info on each LP

Request Packet Structure

A request XML packet retrieving info on LP’s includes the get operation node:

<packet version="1.5.0.0">
<locale>
   <get>


   </get>
</locale>
</packet>

The get node is presented by type LocaleGetInput (locale.xsd), and its graphical representation is as follows:

image 40727

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. Specifies the filtering rule. For more information, refer to the Available Filters section. Data type: LocaleFilter (locale.xsd) .

Response Packet Structure

The get node of the output XML packet is presented by type LocaleGetOutput (locale.xsd) and structured as follows:

image 40733

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 retrieved from the server. Data type: extension of type LocaleResultType (locale.xsd).

  • The status node is required. It specifies the execution status of the get operation. Data type: string. Allowed values: ok | error.

  • The errcode node is optional. It returns the error code if the get operation fails. Data type: unsignedInt.

  • The errtext node is optional. It returns the error message if the get operation fails. Data type: string.

  • The filter-id node is optional. It returns a filtering rule parameter if the operation fails. For more information, refer to the Available Filters section. Data type: anySimpleType.

  • The id node is optional. It holds name of the language pack matched by the filtering rule if the operation fails. Data type: string.

  • The info node is optional. It specifies LP settings. Data type: LocaleInfo (locale.xsd). If the info node is present in the response packet, the following nodes are required:

    image 40736

    • The id node specifies the LP name. For details on language pack names, refer to the LP Names section. Data type: string.
    • The lang node specifies the LP language. Data type: string.
    • The country node specifies countries where this language is native. Data type: string.
    • The used node specifies the number of users at all levels that use this language in their interface. Data type: integer.
    • The enabled node specifies if this LP is available for users. Data type: boolean.

Remarks

In XML API 1.5.0.0, the result node also contains the message node.

image 49030

  • The message node is optional. It does not return any value for this operation. Data type: string.

Samples

Retrieving info on a single LP

The following request packet retrieves info on US English LP:

<packet>
  <locale>
    <get>
        <filter>
        <id>en-US</id>
        </filter>
    </get>
  </locale>
</packet>

Response:

<packet>
  <locale>
    <get>
    <result>
        <status>ok</status>
        <info>
          <id>en-US</id>
          <lang>ENGLISH</lang>
          <country>United States</country>
          <used>17</used>
          <enabled>true</enabled>
        </info>
    </result>
    </get>
  </locale>
</packet>

If the LP was not found, the response from the server looks as follows:

<packet>
  <locale>
    <get>
      <result>
        <status>error</status>
        <errcode>1013</errcode>
        <errtext>Locale does not exist</errtext>
        <filter-id>en-US</filter-id>
        <id>en-US</id>
      </result>
    </get>
  </locale>
</packet>

Retrieving info on multiple LP’s

The following request packet retrieves info on US English and Russian LP’s:

<packet>
  <locale>
    <get>
        <filter>
          <id>en-US</id>
          <id>ru-RU</id>
        </filter>
    </get>
  </locale>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <locale>
    <get>
      <result>
        <status>ok</status>
        <info>
          <id>en-US</id>
          <lang>ENGLISH</lang>
          <country>United States</country>
          <used>4</used>
          <enabled>true</enabled>
        </info>
      </result>
      <result>
        <status>ok</status>
        <info>
          <id>ru-RU</id>
          <lang>RUSSIAN</lang>
          <country>Russian Federation</country>
          <used>0</used>
          <enabled>true</enabled>
        </info>
      </result>
    </get>
  </locale>
</packet>