Question
How to create Plesk License Key with Partner API 3.0?
Answer
Warning: Article is applicable for Plesk partners only.
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, have to be created with 2 separate API requests.
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 the file request.json
should be like the following:
For a Plesk license with a feature:
Where
externalId
value is optional and
item
value should be one of the following:
- A Partner API 3.0 constant name.
- Key type (base license name) or feature name for unmatched items.
For a Plesk license with additional license (add-on):
CONFIG_TEXT: {
"items" : [ {
"externalId" : "98765"
"item" : "PLESK-12-WEB-ADMIN-1M"
},
{
"externalId" : "54321"
"item" : "FT-PLESK-5-LANGUAGE-PACKS-1M"
} ]
}
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 its 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"} '
Note: For additional questions, contact the Licensing and purchase support at Licensing and Purchase support.
Comments
0 comments
Please sign in to leave a comment.