partner10.createKey(struct, struct, string, string, array, struct, array, struct)

Purpose

This function creates one main Key or a bundle of Keys: main Key and additional Key; it also automatically attaches the additional Key to the main Key. When creating a Key, this signature allows to activate this Key by GUID.

Note: This version of the method call does not define a key/feature billing type. Thus, a key/feature of the client default billing type (defined with Partner API constant) will be created.

 

Signature

Method name: partner10.createKey

# Type Description

1

struct AuthInfo

client authentication information

2

struct ServerAddress

server addresses

3

string

ID of the client who will own the created key

4

string

identifier of a keytype for the new key

5

array(string)

array of identifiers of upgrade plans which will be applied to the new key

6

struct CreationParameters

key creation parameters (see below)

7

array(string)

array of identifiers for additional keys

8

struct CreationParameters

additional keys creation parameters

Returns

Field Type Description

resultCode

int

code for command execution result (see below)

resultDesc

string

textual description of command execution result (see below)

mainKeyNumber

string

number for the created key if format PLSK.XXXXXXXX.XXXX

expirationDate

dateTime.iso8601

key expiration date

updateDate

dateTime.iso8601

key update date. If there is no update date for the license - will be absent

productKey

string

Product activation code. If there are no product activation code for the license - will be absent

additionalKeysNumbers

array(string)

numbers for additional keys in same format

susDate

dateTime.iso8601

SUS date (optional. Display only when SUS is available)

Used Structures

Structure CreationParameters has following fields:

Field Type Description

guid

string

GUID that will be used to activate key. (optional)

hwid

string

Hardware identifier. Key will be activated with this id. (optional)

Deprecated since Partner API v.1.10.2.

parentKeyNumber

string

Used for creating additional key and attach created key to existing parent key specified by value in format PLSK.XXXXXXXX.XXXX (optional)

bindingIPAddress

string

IP address to which the created key must be bound (optional)

 

Result Codes

resultCode resultDesc

100

<key number> has been successfully created. The following additional keys were attached: <additional key number #1>, <additional key number #2>, ...

101

Additional key <additional key number> has been successfully created and attached to <main key number>

200

Client authorization failed

201

Access to this method is denied

202

Access to this object is denied

203

Not enough permissions to create feature keys

220

Key <key number> is not found

221

License key <key number> is marked as problem

222

License key <key number> is terminated

226

Another license is already active with the same HWID.

244

Feature is not applicable.

245

Additional keytype "<name of additional key type>" not applicable to main key's keytype "<name of main key type>"

250

Client with ID <ID> is not found

252

This customer account is detected as problem. No further actions for this customer are allowed.

253

This customer account is unconfirmed. No further actions for this customer are allowed.

257

Given parent key <key number> is master key

260

No "UPGRADE_PLAN_NAME" entry in the client's pricelist

261

Key type "<name of key type>" not found in client's pricelist

272

Another license is bound to given IP address.

280

Operation is not supported for this account type

284

Operation with N/A price is not allowed for this client

287

Failed to complete remote operation with product <product family>.

300

Internal error, please try after some time

400

Incorrect authorization info format

401

Incorrect server info format

410

Incorrect key number format: "<key number>"

412

Unknown base keytype: <name>

414

Incorrect HWID format

416

Unknown feature: <FEATURE NAME>

419

Unknown additional keytype: <name>

420

Unable to find keytype with <LICENSE_DETAILS> type for <CONSTANT_NAME> constant.

421

Incorrect server license details format

453

Duplicate feature: <feature>

XML Examples

Request message

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
  <methodName>partner10.createKey</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>login</name>
            <value>
              <string><em>API_LOGIN</em></string>
            </value>
          </member>
          <member>
            <name>password</name>
            <value>
              <string><em>API_PASSWORD</em></string>
            </value>
          </member>
        </struct>
      </value>
    </param>
    <param>
      <value>
        <struct>
          <member>
            <name>ips</name>
            <value>
              <array>
                <data>
                  <value>
                    <string>192.168.0.1</string>
                  </value>
                </data>
              </array>
            </value>
          </member>
          <member>
            <name>macs</name>
            <value>
              <array>
                <data>
                  <value>
                    <string>CA:9A:FF:90:6E:87</string>
                  </value>
                </data>
              </array>
            </value>
          </member>
        </struct>
      </value>
    </param>
    <param>
      <value>
        <string><em>CLIENT_ID</em></string>
      </value>
    </param>
    <param>
      <value>
        <string>PLESK_75_RELOADED</string>
      </value>
    </param>
    <param>
      <value>
        <array>
          <data/>
        </array>
      </value>
    </param>
    <param>
      <value>
        <struct/>
      </value>
    </param>
    <param>
      <value>
        <array>
          <data>
            <value>
              <string>PLESK_CS_GAMESERVER</string>
            </value>
          </data>
        </array>
      </value>
    </param>
    <param>
      <value>
        <struct/>
      </value>
    </param>
  </params>
</methodCall>

Response message

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>resultCode</name>
            <value>
              <int>100</int>
            </value>
          </member>
          <member>
            <name>mainKeyNumber</name>
            <value>PLSK.00123456.0000</value>
          </member>
          <member>
            <name>resultDesc</name>
            <value>PLSK.00123456.0000 has been successfully created. Following 					additional keys were attached: PLSK.00112345.0000.</value>
          </member>
          <member>
            <name>additionalKeysNumbers</name>
            <value>
              <array>
                <data>
                  <value>PLSK.00112345.0000</value>
                </data>
              </array>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>
 

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.