How to get the license ID

Hi,

I am using the Web API to display how many activations/deactivations are left. To get that I need the License ID. What I don’t understand is how I can get this ID.
For trials there is a GetTrialId() but there is no GetLicenseId() or am I missing something?
I can use GetLicenseKey() to retrieve the Key but how do I get the ID from that?

Thank you for your answer.

Hi,

Which API endpoint are you trying to use to fetch the license details?

Are you invoking the API from your application or backend server?

Personal access token must not be exposed in any app which you deliver to your customer.

If you are invoking the API from backend server, then you can get license details using following:

https://api.cryptlex.com/v3/docs#operation/V3LicensesGet

with productId and email query params.

In case you want this information in the client app, then your user must first login using the following endpoint:

https://api.cryptlex.com/v3/docs#operation/V3AccountsLoginPost

This will return an access token for the user, and then you can invoke following endpoint to get the license details from your frontend app or desktop app:

https://api.cryptlex.com/v3/docs#operation/V3MeLicensesGet

I want to display this information in the client desktop app but I don’t want to have the end user deal with the hassle of having a login/password to enter in the app on top of a required key just to display extra information in the app. Actually I am not even giving a login/password to a company purchasing a license with a given number of activation. I just mail them a key that they distribute internally among their end users.
In that context I cannot use V3AccountsLoginPost endpoint…

That is the reason I wanted to use a “GetLicenseId()” to retrieve the license ID and then use it on the V3LicensesByIdGet endpoint with a Personal Access Token with only license:read scope.

Until you introduce something like that in a future version of LexActivator I guess I won’t be able to display the remaining activation/deactivation in the app then.

This will give your customer access to all the license keys.

Ideally, your customer should login to the customer portal to check how many license activations are left.

https://docs.cryptlex.com/user-management/customer-portal

To login on this portal I also need to create login/passwords for the users. I want to keep a standalone desktop app without a need to use a web browser.
Plus the person buying the license that will provide an email like accounting@acme.com will be most likely not the end user. That person will buy a 10-activation single license key and give it to an engineering department that will handle themselves their activation/deactivation. I don’t see them using a accounting@acme.com to check their license status. Unless you can create multiple emails attached to the same license key.
I could create 10 keys with 1 activation but it is more convenient to have 1 key 10 activation instead that a department can share.

Thank you for proposing alternatives but they are too cumbersome for displaying an information that most users won’t care about.