WC Key Manager lets you easily handle your software upgrades by providing version information for your products and download links for the latest versions. Here’s how to get version information using the Licensing API.
To get version information, you need to send a GET request to the Licensing API endpoint like this:
https://example.com?wckm-api=get_version&key=YOUR_LICENSE_KEY
Note: You must provide either the key or product_id to get the version details. If key is provided and the key is valid, the response will include download_link and changelogs for the product. Otherwise, the response will include the latest version of the product and the changelog.
Parameters
Parameter | Description |
---|---|
key | (Optional) The license key that you want to activate. |
label | (Optional) The unique string to reference the activation. |
product_id | (Optional) The key will automatically detect the product ID if not provided. |
email | (Optional) The email address of the user who purchased the product. |
Example Response:
The response for this request will be a JSON object. If the version information is successfully retrieved, the response will be:
{
"success": true,
"new_version": "1.0.0",
"stable_version": "1.0.0",
"name": "Cap",
"slug": "cap",
"min_php": "8.0.0",
"min_wp": "6.6",
"url": "https://example.com/?wckm-api=get_changelog&product_id=19",
"package": "https://example.com/?wckm-api=download&token=MTcyMTMwNDQ4ODowMTYxLTc0MDUtMTUwNy04MzUzOjE5OmUxMWEzMGUxMmM1NjJhNmU5NmQ1NmJkM2NlMjQwNzRjOg==",
"download_link": "https://example.com/?wckm-api=download&token=MTcyMTMwNDQ4ODowMTYxLTc0MDUtMTUwNy04MzUzOjE5OmUxMWEzMGUxMmM1NjJhNmU5NmQ1NmJkM2NlMjQwNzRjOg==",
"last_updated": "2024-07-17",
"homepage": "https://example.com/product/cap/",
"sections": "a:2:{s:11:\"description\";s:33:\"<p>This is a simple product.</p>\n\";s:9:\"changelog\";s:35:\"<p>1.0.0<br />\nInitial Release</p>\n\";}",
"banners": "a:1:{i:0;a:2:{s:3:\"low\";s:59:\"https://example.com/wp-content/uploads/2024/06/cap-2.jpg\";s:4:\"high\";s:59:\"https://example.com/wp-content/uploads/2024/06/cap-2.jpg\";}}",
"icons": "a:1:{i:0;a:2:{s:3:\"low\";s:59:\"https://example.com/wp-content/uploads/2024/06/cap-2.jpg\";s:4:\"high\";s:59:\"https://example.com/wp-content/uploads/2024/06/cap-2.jpg\";}}"
}
If the license is invalid, the response will be:
{
"success": false,
"error": "invalid",
"message": "Invalid key or product id, please provide a valid key or product id."
}