How to create a License Key with Partner API 3.0

Created:

2017-03-02 18:48:54 UTC

Modified:

2017-08-08 13:45:31 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to create a License Key with Partner API 3.0

Applicable to:

  • Plesk

Question

How to create a License Key with Partner API 3.0?

Answer

A Plesk license key with a feature (like Language Pack), has to be created using 1 API request, while Plesk license key with additional licenses like Premium Anti-virus or Kaspersky, have to be created with 2 separate API requests.Use

Use curl utility with the following arguments:

# curl -X POST "https://api.central.plesk.com/30/keys?return-key-state=yes" -u user:password -H "Content-Type:application/json;charset=UTF-8" -d @request.json

The content of requiest.json file should be like the following:

For a Plesk license with a feature:

{
"items" : [ {
"externalId" : "98765"
"item" : "PLESK-12-WEB-ADMIN-1M"
},
{
"externalId" : "54321"
"item" : "FT-PLESK-5-LANGUAGE-PACKS-1M"
} ]
}

Where externalId value is optional and item value should be one of the following:

For a Plesk license with additional license (add-on):

Create Plesk license:

$ curl -X POST -H "Authorization: Basic aW50ZXJuZXR4X2RlbW86Nkw1QUFpR3o0bXB4aTE2QjlxanRyWldBa1VWbTFmcGE=" -H "Content-Type: application/json; charset=utf-8" -H "Cache-Control: no-cache" -d '{"items":[{"item":"PLESK-12-VPS-WEB-HOST-1M"}],"nickname":"MyTest123"} ' "URL_here"
{
"ownerId": "1234567",
"keyIdentifiers": {
"keyId": 12345678,
"keyNumber": "PLSK.00000000.0000",
"activationCode": "A00000-A00000-A00000-A00000-A00000"
},
"parentKeyIdentifiers": null,
"activationInfo": null,
"ipAddressBinding": null,
....................
}

Create Premium AV license, indicating it's parent key parentKeyIdentifiers:

curl -X POST -H "Authorization: Basic aW50ZXJuZXR4X2RlbW86Nkw1QUFpR3o0bXB4aTE2QjlxanRyWldBa1VWbTFmcGE=" -H "Content-Type: application/json; charset=utf-8" -H "Cache-Control: no-cache" "URL_here" \
-d '{"parentKeyIdentifiers":{"keyId":12345678},"items":[{"item":"ADD-PLESK-12-VPS-PREMIUM-ANTIVIRUS-1M"}],"nickname":"MyTest123"} '

Additional Information

Plesk Documentation and Help Portal - Creating a License Key

Have more questions? Submit a request
Please sign in to leave a comment.