Send a heartbeat to verify the license checkout

The heartbeat is used to verify that the license checkout is still valid, report on the quantity being consumed from the license, and reauthorize the use of the license.

You can perform a heartbeat on a license checkout through the 10Duke Scale License Checkout API.

For background, see an overview of the license consumption flow, and information on the best practices related to heartbeat.

Before you start

Make sure that the client application has access to the public key needed for verifying the license token in the heartbeat response.

Heartbeat request

A heartbeat request must provide the same client application claims as the license checkout.

If the license model binds the license consumption to the hardware on which the license was checked out, the cliHwId value in the heartbeat request must match the one provided at checkout, or the heartbeat fails.

Heartbeat response

As a response to a successful heartbeat, 10Duke Scale returns a new JSON Web Token (JWT) license token. The client application needs to verify and validate the license token received at each heartbeat in the same way as at checkout.

The new license token contains the same claims as the token returned at checkout and an additional oldLeaseId claim.

The leaseId claim contains a new lease ID, and oldLeaseId contains the lease ID from the previous license token.

Make sure to use the new lease ID for further interaction with the License Checkout API. The previous lease ID that the client has is no longer valid after a heartbeat.

Using the new and previous lease IDs, client applications that cache license tokens locally can implement a robust token replacement logic.

Example heartbeat response

This is an example of a successful response to a license heartbeat.

{
  "iat": 1714987346,
  "jti": "014865ff-3739-4357-a1ab-f7d86ebd20c8",
  "iss": "10Duke",
  "exp": 1751327999,
  "nbf": 1714986679,
  "toe": 1714987346,
  "leaseId": "1714998146.djEuMC4w.e.YWZlYjBiMGRlNTk2NGQ4N2JhZDkyYTc5MzE2M2M2OWQ=",
  "oldLeaseId": "1714997479.djEuMC4w.e.M2NjNWFjZjM1NzlmNDA0ZmIyYTljNjZkYjk4ODcyZTI=",
  "hbnbf": 1714998146,
  "productName": "ThreeDee",
  "type": "PRECONFIGURED_PRODUCT",
  "productConfigurationName": "ThreeDee Team",
  "licenseId": "1fc8e4e5-1dcd-4db9-a45f-c1c0c724815b",
  "qtyPrealloc": 0,
  "qtyVerified": 1,
  "qtyDimension": "SEATS",
  "qtyEnforcementType": "ENFORCED",
  "features": [
    "simulate",
    "render",
    "measure"
  ],
  "licenseConsumerId": "dd30afb4-8417-2646-89bc-163e0e2f86ca",
  "status": "success",
  "clientClaims": {
    "cliHwId": "xefainge8uiGhoo4aemieK1x",
    "cliHwLabel": "MyDesktop",
    "cliInstallationId": "644b92b9-23b0-42ee-a325-8dd9071f8d03",
    "cliLang": "en",
    "cliVersion": "1.0.1"
  }
}

Send a heartbeat through the API

Use the following License Checkout API operations to send a heartbeat for a license that is being consumed by a license consumer of type person (user) or device or by a license key:

Item URL (relative, prepend the environment base URL)
Send a heartbeat in enforced mode for a user or device POST /licensing/actions/heartbeat
Send a heartbeat in enforced mode using a license key POST /licensing/actions/heartbeat/{licenseKey}
Send a heartbeat for the metered consumption of licenses for a user or device POST /licensing/actions/heartbeat-metered-use
Send a heartbeat for the metered consumption of licenses using a license key POST /licensing/actions/heartbeat-metered-use/{licenseKey}