# Cryptolens Web API 3 > Web API 3 is the current programmable API for Cryptolens licensing, activation, customer, reseller, and billing-related workflows. This file contains the full cleaned export of the Web API 3 method and model reference. ## Overview ### Welcome to Web API 3 URL: `https://app.cryptolens.io/docs/api/v3/` Summary: Welcome to the documentation of all the method available in Web API 3. This is the latest version of the API. [Web API 2](https://app.cryptolens.io/docs/api/v2/) should no longer be used in new projects. Welcome to the documentation of all the method available in Web API 3. This is the latest version of the API. [Web API 2](https://app.cryptolens.io/docs/api/v2/) should no longer be used in new projects. Please keep in mind that every method call requires you to provide an [access token](https://app.cryptolens.io/docs/api/v3/Auth). It is an additional argument, called **token**, that you have to add in each request, i.e. **token={access token}**. The parameter names and properties returned have **case-insensitive** names. By default, objects returned will use **lower camel case** naming convention. ### Getting Started If you are new to the Web API, please see our [quick start guide](https://app.cryptolens.io/docs/api/v3/QuickStart). - [Authenticating](https://app.cryptolens.io/docs/api/v3/Auth) - [Versioning](https://app.cryptolens.io/docs/api/v3/Versioning) - [Media Types](https://app.cryptolens.io/docs/api/v3/MediaTypes) - [Help Pages](https://help.cryptolens.io/web-api/index) ### Methods Methods are grouped into specific categories. For example, to manipulate a license key, a good idea would be to look at key methods. - [Key Methods](https://app.cryptolens.io/docs/api/v3/Key) - [User Methods](https://app.cryptolens.io/docs/api/v3/UserAuth) - [Customer Methods](https://app.cryptolens.io/docs/api/v3/Customer) - [Data Object Methods](https://app.cryptolens.io/docs/api/v3/Data) - [Product Methods](https://app.cryptolens.io/docs/api/v3/Product) - [Auth Methods](https://app.cryptolens.io/docs/api/v3/AuthMethods) - [Payment Form Methods](https://app.cryptolens.io/docs/api/v3/PaymentForm) - [Get Token Methods](https://app.cryptolens.io/docs/api/v3/GetToken) - [Analytics Methods](https://app.cryptolens.io/docs/api/v3/AI) - [Message Methods](https://app.cryptolens.io/docs/api/v3/Message) - [Subscription Methods](https://app.cryptolens.io/docs/api/v3/Subscription) - [Reseller Methods](https://app.cryptolens.io/docs/api/v3/Reseller) ### Quick Start URL: `https://app.cryptolens.io/docs/api/v3/QuickStart` Summary: Cryptolens has a comprehensive API with methods that can be split up into two groups: those that are used 1) **inside your app** and 2) **with third party services (CRM, payments, etc)**. To get you up and running, we... ### Introduction Cryptolens has a comprehensive API with methods that can be split up into two groups: those that are used 1) **inside your app** and 2) **with third party services (CRM, payments, etc)**. To get you up and running, we will focus on point 1, i.e. integrating it into your app. ### Code Snippets Our API can easily be accessed through any type of environment. For example, you get license key using either a directly call to our API or through our [.NET Client](https://github.com/SerialKeyManager/SKGL-Extension-for-dot-NET). Please replace the ProductId and the Key with your specific ones. ```text curl https://api.cryptolens.io/api/key/GetKey? \ -d token=[token] \ -d ProductId=5 \ -d Key=MTMPW-VZERP-JZVNZ-SCPZM ``` ```text string token = "[token]"; string key = "MTMPW-VZERP-JZVNZ-SCPZM"; var license = new LicenseKey { token = token, ProductId = 5, Key = key }; if(!license.Refresh(token)) { // could not refresh. check the permissions. It's GetKey, not GetKeys! } // if we are here, we were able to retrieve the key correctly! ``` If you are using C++, quick guide can be found [here](https://blog.skmapp.com/2017/08/new-client-api-for-c/). Please also see the [VB.NET step by step tutorial](https://help.skmapp.com/#getting-started). ### API Keys These are your specific API keys. You will notice that many of our examples require them. If you want to change the scope of permissions, we recommend to read [this page](https://app.cryptolens.io/docs/api/v3/Auth). #### RSA Public Key `[PublicKey]` #### Access Token This access token has both access to [Activate](https://app.cryptolens.io/docs/api/v3/Activate) and [GetKey](https://app.cryptolens.io/docs/api/v3/GetKey) methods. `[token]` ### Authentication & Authorization URL: `https://app.cryptolens.io/docs/api/v3/Auth` Summary: Web API 3 provides a new way of communicating with Cryptolens. Instead of having different access levels (where permission is given on a global level), Web API 3 provides a uniform way of authentication and authorization... ### Introduction Web API 3 provides a new way of communicating with Cryptolens. Instead of having different access levels (where permission is given on a global level), Web API 3 provides a uniform way of authentication and authorization (*please see the explanation of terms below*). The access token is an additional parameter that you have to add to each request, i.e. **token={accesstoken}**. For example ```text https://api.cryptolens.io/api/key/GetKey?token={accesstoken}&ProductId=1234&Key=MUYVD-LSEBY-CXHRQ-XFAGY&Sign=True ``` ### Access Tokens An access token is an easy way of **identifying yourself to Cryptolens** and ensuring that only a **specified scope of permissions** is given. You can think of access tokens as your **login credentials** that are **restricted to a certain scope** of methods (in the Web API). Here's an example of an access token. ```text WyI0IiwiM0l0SlRwQTFTSUNDcXNXQXhsdG8ra0ZmQUU5L0wrVGZRUUQrZ1lybSJd ``` You can manage your access tokens on the [Access Token page](https://app.cryptolens.io/User/AccessToken). Note, an access token will only be shown once. There is no way of retrieving it once generated. Please make sure that you treat each access token as your personal password. Although an access token has a restricted scope, it will be able to access products even if they are not set to IsPublic. [Create an Access Token](https://app.cryptolens.io/User/AccessToken) ### Scopes A scope is a way of telling Cryptolens **what an access token is allowed to do**. It allows you to specify the **allowed methods** in Web API 3 and if you want to restrict it to a **certain product or key**. Let's look at them more in detail! #### Method Lock If you check a box for a specific method during access token creation, you will be able to use that token to enable that method only. For example, if you check the *Extend License* box, you will be able to access that method only. If the box is not selected, you will get the message **Access denied**. #### Product, Key or Feature Lock Say that you've enabled access to certain methods in the Web API (as described) above. Now, the objective is to ensure that the token works with a certain product only. In this case, simply set **Product lock** to the product id of the desired product. The same can be done using **Key lock**, but instead, it will be locked to that particular key. Finally, the **Feature lock** will restrict to a certain feature. In case you want the token to have access to all your products (or all keys inside a certain product), all you have to do is to enter **0** in either Product lock or Key lock. ### Explanation of Terms - **Authentication** - It's a way of identifying yourself to Cryptolens, i.e. so that Cryptolens knows who is performing the request - **Authorization** - It's a way of making sure that only the desired permission is given to something. ### Versioning URL: `https://app.cryptolens.io/docs/api/v3/Versioning` Summary: Methods in the Web API can change over time, however, despite this, it's important that such a change does not break older implementations. In order to be able to do so, Web API 3 uses query string versioning. Methods in the Web API can change over time, however, despite this, it's important that such a change does not break older implementations. In order to be able to do so, Web API 3 uses query string versioning. ### Specifying version In order to specify a version, you simply have to add another query string parameter, **v** for example, **v=1**. By default, the version is number is always **1**, so if you want to get the newest version, you have to change it explicitly. ### How methods are updated Web API methods are updated as follows: - For small changes that include introduction of new input or output parameters, we keep the version number the same. It's important that you use a JSON parser when consuming the API and avoid any RegEx or similar optimizations. - For changes that affect the way the method works, we will increase the version number. ### Media Types URL: `https://app.cryptolens.io/docs/api/v3/MediaTypes` Summary: By default, Cryptolens Web API returns JSON formatted objects. The the most basic result always contains a **message** and a **result**. In rare cases, only a message is returned, in which case a server error has... By default, Cryptolens Web API returns JSON formatted objects. The the most basic result always contains a **message** and a **result**. In rare cases, only a message is returned, in which case a server error has occured. ### Message Pack All controllers support MessagePack format. It can be requested by setting the content type to **application/x-msgpack**. ### Plain Text In some methods, it is also possible to get the result as plain text. At the time of writing, only the [Create Key](https://app.cryptolens.io/docs/api/v3/CreateKey) method supports this type fully. You can request plain text by either: 1. setting content type to **text/plain** 2. setting query string paramter **format** to **plaintext** ## Key Methods ### Key URL: `https://app.cryptolens.io/docs/api/v3/Key` Summary: These are all the methods that can be used to manipulate an existing license key. ### Methods These are all the methods that can be used to manipulate an existing license key. - [Activate](https://app.cryptolens.io/docs/api/v3/Activate) - [Deactivate](https://app.cryptolens.io/docs/api/v3/Deactivate) - [Create Key](https://app.cryptolens.io/docs/api/v3/CreateKey) - [Create Trial Key](https://app.cryptolens.io/docs/api/v3/CreateTrialKey) - [Create Key From Template](https://app.cryptolens.io/docs/api/v3/CreateKeyFromTemplate) - [Get Key](https://app.cryptolens.io/docs/api/v3/GetKey) - [Add Feature](https://app.cryptolens.io/docs/api/v3/AddFeature) - [Block Key](https://app.cryptolens.io/docs/api/v3/BlockKey) - [Extend License](https://app.cryptolens.io/docs/api/v3/ExtendLicense) - [Remove Feature](https://app.cryptolens.io/docs/api/v3/RemoveFeature) - [Unblock Key](https://app.cryptolens.io/docs/api/v3/UnblockKey) - [Machine Lock Limit](https://app.cryptolens.io/docs/api/v3/MachineLockLimit) - [Change Notes](https://app.cryptolens.io/docs/api/v3/ChangeNotes) - [Change Reseller](https://app.cryptolens.io/docs/api/v3/ChangeReseller) - [Change Customer](https://app.cryptolens.io/docs/api/v3/ChangeCustomer) - [Trial Activation](https://app.cryptolens.io/docs/api/v3/TrialActivation) ### Activate URL: `https://app.cryptolens.io/docs/api/v3/Activate` Assumed ModelVersion: 3 (highest documented version at generation time) Summary: This method will perform a key activation, similar to [Activate [Web API 2]](https://app.cryptolens.io/docs/api/v2/Activate). In contrast to key validation, key activation is not *read only* since it can change license key data depending on... This method will perform a key activation, similar to [Activate [Web API 2]](https://app.cryptolens.io/docs/api/v2/Activate). In contrast to key validation, key activation is not *read only* since it can change license key data depending on configurations such as [trial activation](https://help.cryptolens.io/web-interface/trial-activation), etc. If [trial activation](https://help.cryptolens.io/web-interface/trial-activation) is enabled, a key can be altered. Information that is retrieved can be signed by the server to be able to keep validate keys without Internet connection. Please keep in mind that the Feature lock can be used to restrict the fields that can be shown in the result (*fieldsToReturn*). More about this in [Remarks](https://app.cryptolens.io/docs/api/v3/Activate#remarks). This method is accessed by [https://api.cryptolens.io/api/key/Activate](https://api.cryptolens.io/api/key/Activate) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Sign | If true, the information inside the LiceseKey object will be signed. | optional. false by default. | | MachineCode | The machine code (a string that identifies a device) for activation. | optional. empty string by default. | | FriendlyName | Allows you to specify a friendy name for the activated device, for example the employee's email. Friendly name does not impact the number of active machine codes / seats, but it offers an easy way of linking a machine/seat with a user. For added security, you can HMAC hash this value. | optional. empty string by default. | | FieldsToReturn | An integer that allows you to restrict the information returned in the license key data object. | optional. 0 by default = all fields returned. | | SignMethod | Specifies the format of the result and the way it should be signed. | optional. 0 by default. | | Metadata | Includes [additional information](https://app.cryptolens.io/docs/api/v3/Activate#Metadata) about the license key, such as number of activated devices, etc. | optional. false by default. | | FloatingTimeInterval | When set to something greater than zero, floating licensing will be enabled. The time interval is then used to check that no more than the allowed number of machine codes (specified in *maximumNumberOfMachines*) have been activated in that time period (in seconds). Note, the machine code will have "floating:" appended in the beginning. | optional. 0 by default. | | MaxOverdraft | When set to something greater than zero (and assuming *FloatingTimeInterval* is set too) floating licensing will permit a license overdraft (eg. activation will succeed even if *maximumNumberOfMachines* is reached). MaxOverdraft value specifies how much we can exceed the *maximumNumberOfMachines* value. Note, the machine code will have the following structure: if concurrent devices *maximumNumberOfMachines*: "floating:" appended in the beginning of each machine code. if concurrent devices *maximumNumberOfMachines* + MaxOverdraft: "floating-overdraft:" appended in the beginning of each machine code. | optional. 0 by default. | | OSInfo | Additional OS related information (as a string) that will be registered as metadata in [Register Event](https://app.cryptolens.io/docs/api/v3/RegisterEvent). | optional. null by default. | | ModelVersion | The model that will be returned. In comparison to method version, this only affects what fields and information will be returned and does not impact the way the method works. A changelog can be found in the [end of this page](https://app.cryptolens.io/docs/api/v3/Activate#model-versions). | optional. by default, it's 1. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseKey | A LicenseKey object. The structure is described in [License Key](https://app.cryptolens.io/docs/api/v3/Activate#LicenseKey) section. If **SignMethod** is set to 1, the [License Key](https://app.cryptolens.io/docs/api/v3/Activate#LicenseKey) will be a string representation of the object converted into base64 (all DateTime fields are expressed as 64 bit integers in Unix time). | always returned | | Signature | The signature of the base64 representation of the LicenseKey field (above). | returned if **SignMethod=1** | | Metadata | Includes [additional information](https://app.cryptolens.io/docs/api/v3/Activate#Metadata) about the license key, such as number of activated devices, etc. | returned if **Metadata=True** | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | #### License Key (FieldsToReturn=0) | **Parameter** | **Description** | **Remarks** | **Hide?** | | --- | --- | --- | --- | | ProductId | The ID of the product that this key belongs to. | always returned | | ID | The ID (within the product) of the license key. | depends on configuration | | | Key | The license key string, eg. ABCDE-EFGHI-JKLMO-PQRST. | depends on configuration | | | Created | The creation date of the license key. | always returned | | Expires | The expiration date of the license key. Note, it's optional and it's up to your program to interpret this. Please see [Key's that don't expire](https://help.cryptolens.io/web-interface/keys-that-dont-expire). | always returned | | Period | The duration of current license cycle eg. 30 days. Note, this is a static number and does not change automatically. | always returned | | F1 | The feature 1 of the license key. | always returned | | F2 | The feature 2 of the license key. | always returned | | F3 | The feature 3 of the license key. | always returned | | F4 | The feature 4 of the license key. | always returned | | F5 | The feature 5 of the license key. | always returned | | F6 | The feature 6 of the license key. | always returned | | F7 | The feature 7 of the license key. | always returned | | F8 | The feature 8 of the license key. | always returned | | Notes | The notes field of the license key. | depends on configuration | | | Block | This will always be false. | always returned | | GlobalId | A unique identifier of the license key. It can, for instance, be used as a "ReferencerId" when creating a [data object(aka additional variables)](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). | depends on configuration | | | Customer | The entire [customer](https://app.cryptolens.io/docs/api/v3/model/Customer) object assigned to this license key. | depends on configuration | | | ActivatedMachines | A list of [Activation data](https://app.cryptolens.io/docs/api/v3/model/ActivationData). It will include both node-locked and floating licenses. In the case of floating licenses, it will list all of the floating machines that have not expired, even if the *FloatingTimeInterval* is smaller. If you only want to see floating devices that would be permitted within a certain *FloatingTimeInterval*, then you can filter them as follows: **FloatingExpires** ≤ **UTCNow.AddSeconds(FloatingTimeInterval)**. For more information on the difference between floating and node-locked licenses, please see [this article](https://help.cryptolens.io/faq/index#node-locked-vs-floating-licenses). | depends on configuration | | | TrialActivation | Tells if [trial activation](https://help.cryptolens.io/web-interface/trial-activation) is enabled. | always returned | | MaxNoOfMachines | The maximum number of machines/devices that may activate this license. By setting this to 0, machine locking will be disabled and an unlimited number of devices will be able to activate the license. | depends on configuration | | | AllowedMachines | Machine codes of those devices that will be prioritized during activation. Even if the limit is achieved, these will still be activated. **Note:** This is a legacy field and is no longer used. | depends on configuration | | | DataObjects | A list of [Data objects](https://app.cryptolens.io/docs/api/v3/model/DataObject), additional variables associated with the license key. | depends on configuration | | | Reseller | The entire [reseller](https://app.cryptolens.io/docs/api/v3/model/Reseller) object assigned to this license key. | depends on configuration | | | SignDate | The DateTime when this activation file was signed. | always returned | | Signature | The signature of the all the fields above | Returned if **Sign=true**. | #### Metadata (FieldsToReturn=0) You can hide metadata by checking. | **Parameter** | **Description** | **Remarks** | **Hide?** | | --- | --- | --- | --- | | ActivatedMachines | The number of activated machines for this license key. | depends on configuration | | | LicenseStatus | Additional information about the license key. It contains the following: **IsValid** - Either true or false, depending on if the license satisfies all conditions for being valid. **ReasonForInvalidity** - if a license is invalid, this will contain the reason (an integer). This can be decoded as follows: None = 0 Expired = 1 Blocked = 2 **Trial** - tells if the license is a trial, based on the feature definitions for the product **TimeLimited** - tells if the license is a time-limited / subscription, based on the feature definitions for the product **TimeLeft** - if the license key is time-limited, this field will contain the remaining number of days until it expires | depends on configuration | | | UsedFloatingMachines | The number of active floating machine codes for a specific *FloatingTimeInterval*. **Tip:** If you want to find the number of unused machines, subtract this value from maxNumberOfMachines. If overdraft is used, you need to add the maxOverdraft value to maxNumberOfMachines. | depends on configuration | | | Signature | The signature of the metadata object. | Returned if **sign=true**. | | ### Example results If **SignMethod=0** ```text {"productId":1234,"licenseKey":{"id":1,"key":"AAAAA-AAAAA-AAAAA-AAAAA","created":"2015-08-27T00:00:00","expires":"2018-11-03T00:00:00","period":1023,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"this key is used as an example in one of the test cases.","block":false,"globalId":24963,"customer":{"id":3,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453"},"activatedMachines":[{"mid":"5632812","ip":"10.1.1.1","time":"2016-03-25T18:56:34.647"},{"mid":"7632812","ip":"10.1.1.2","time":"2016-04-06T15:05:35.733"},{"mid":"85256631","ip":"10.1.1.5","time":"2016-04-07T22:18:26.673"}],"trialActivation":false,"maxNoOfMachines":10,"allowedMachines":"","dataObjects":[],"signDate":"2016-04-11T09:45:06","signature":null},"result":0,"message":""} ``` If **SignMethod=1** ```text {"licenseKey":"eyJQcm9kdWN0SWQiOjMsIklEIjo2LCJLZXkiOiJHT1hHWi1WQUNLRS1TUUJZRS1CUlhVUCIsIkNyZWF0ZWQiOiIyMDE0LTAxLTAyVDAwOjAwOjAwIiwiRXhwaXJlcyI6IjIwMTQtMDItMTZUMDA6MDA6MDAiLCJQZXJpb2QiOjQ1LCJGMSI6dHJ1ZSwiRjIiOnRydWUsIkYzIjpmYWxzZSwiRjQiOmZhbHNlLCJGNSI6ZmFsc2UsIkY2IjpmYWxzZSwiRjciOmZhbHNlLCJGOCI6ZmFsc2UsIk5vdGVzIjoidG8gU2NvdCIsIkJsb2NrIjpmYWxzZSwiR2xvYmFsSWQiOjEwMDksIkN1c3RvbWVyIjp7IklkIjoyNywiTmFtZSI6ImN1c3RvbWVyIiwiRW1haWwiOiJhcnRlbUBhcnRlbWxvcy5uZXQiLCJDb21wYW55TmFtZSI6InRlc3QiLCJDcmVhdGVkIjoiMjAxNi0wMS0wNFQxOTo0OTowOS4zMDcifSwiQWN0aXZhdGVkTWFjaGluZXMiOltdLCJUcmlhbEFjdGl2YXRpb24iOmZhbHNlLCJNYXhOb09mTWFjaGluZXMiOi0xLCJBbGxvd2VkTWFjaGluZXMiOm51bGwsIkRhdGFPYmplY3RzIjpbXSwiU2lnbkRhdGUiOiIyMDE3LTA0LTE0VDE0OjE1OjM4IiwiU2lnbmF0dXJlIjpudWxsfQ==","signature":"fVhV2revZTug1HtYcLkSEEMCPk0AkaBWBl4cRYOXlOpHR5S7xNtcY9o+wXRuauNXzGXh5LQcT8Ybo1HJ1LFp3z7sEfoDZZHfckbKbeSOTi+ercuqH26nWdvD2wgKsJsU0Rx6iClyKezNS36azriubdxcVabClFawn65GHexw14AeQlGU1jreAs0N57Dw/jwuBPXGfId64V8daOozVJQFhJVA6B1ZSu01FfxuBQxn2kj+UhjRGMp79JasCu2h1V5End66IHf0jlbgfsRDlWGfik1oK1LhFfkVV9rURSWiINhh1rZn1NM4ELHr/ASXUj1P1PdrtPadobDO+eXDUZhBHQ==","result":0,"message":""} ``` ### Remarks - The feature lock value is used to store the *filedsToReturn* value. If you set a certain value in the feature lock, it will be prioritized higher than the *fieldsToReturn* parameter. - To compute the value of the feature lock, please use the **Hide** column, for those fields that you want to omit in the result [above](https://app.cryptolens.io/docs/api/v3/Activate#LicenseKey). - If the *ActivatedMachines* is hidden, only the current machine code will be included (used during this particular activation). Otherwise, all machine codes will be included. - This method will not work if **block** is set to true. Instead, you will first need to [Unblock](https://app.cryptolens.io/docs/api/v3/UnblockKey) it. - Hiding a column using the *filedsToReturn* does not remove the field from the result. It only removes the value of the field, for example by setting it to **null**. - (For first time use) Before you proceed with signing, please visit [this page](https://app.cryptolens.io/User/Security) to generate your public/private key pair. - The *SignMethod* currently supports two ways of returning the license key information and signing the content. **Linq Sign (0)** - The default option supported in the SKM Client API for.NET. Everything is returned as a JSON dictionary with a signature attached to the license key object. - **String Sign (1)** - This option is tailored for cross platform applications and is the preferred way retrieving signed versions of the license key object. The license key is converted into a json string which is later stored in base64. This is then signed using RSA 2048 with SHA256. Please note that in both cases, **Sign** has to be set to true if you want the license key to be signed. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | The key is blocked and cannot be accessed. | | Cannot activate the new device as the limit has been reached. | ### Model Versions This changelog list changes of the returned fields given the model version. 3. This model has a few changes. First, we have added a **Reseller** object to the **LicenseKey**. Secondly, we have made sure that all node-locked and floating licenses are returned (unless field masking is used). We added **FloatingExpires** to **ActivatedMachines** so that you can check when the activatin was set to expire (note, this value can be overrriden when calling this method with a different *FloatingTimeInterval*). 2. Add **FriendlyName** to **ActivatedMachines** in the license key. 1. The original model. ### Get Key URL: `https://app.cryptolens.io/docs/api/v3/GetKey` Assumed ModelVersion: 3 (highest documented version at generation time) Summary: This method will return information about a license key, similar to [Validate [Web API 2]](https://app.cryptolens.io/docs/api/v2/Validate). In contrast to activation, this method (aka Key Validation) will be in *read only* mode. That is, it will... This method will return information about a license key, similar to [Validate [Web API 2]](https://app.cryptolens.io/docs/api/v2/Validate). In contrast to activation, this method (aka Key Validation) will be in *read only* mode. That is, it will not add a device to the license nor use [trial activation](https://help.cryptolens.io/web-interface/trial-activation). More about this in [Remarks](https://app.cryptolens.io/docs/api/v3/GetKey#remarks). This method is accessed by [https://api.cryptolens.io/api/key/GetKey](https://api.cryptolens.io/api/key/GetKey) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Sign | If true, the information inside the LiceseKey object will be signed. | optional. false by default. | | FieldsToReturn | An integer that allows you to restrict the information returned in the license key data object. | optional. 0 by default = all fields returned. | | SignMethod | Specifies the format of the result and the way it should be signed. | optional. 0 by default. | | Metadata | Includes [additional information](https://app.cryptolens.io/docs/api/v3/GetKey#Metadata) about the license key, such as number of activated devices, etc. | optional. false by default. | | FloatingTimeInterval | If **Metadata** is set to true, setting this to something greater than 0 will return the number of active floating licenses. You can read more about the way it works on [this page](https://app.cryptolens.io/docs/api/v3/Activate). | optional. 0 by default. | | ModelVersion | The model that will be returned. In comparison to method version, this only affects what fields and information will be returned and does not impact the way the method works. A changelog can be found in the [end of this page](https://app.cryptolens.io/docs/api/v3/GetKey#model-versions). | optional. by default, it's 1. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseKey | A LicenseKey object. The structure is described in [License Key](https://app.cryptolens.io/docs/api/v3/GetKey#LicenseKey) section. If **SignMethod** is set to 1, the [License Key](https://app.cryptolens.io/docs/api/v3/GetKey#LicenseKey) will be a string representation of the object converted into base64 (all DateTime fields are expressed as 64 bit integers in Unix time). | always returned | | Signature | The signature of the base64 representation of the LicenseKey field (above). | returned if **SignMethod=1** | | Metadata | Includes [additional information](https://app.cryptolens.io/docs/api/v3/GetKey#Metadata) about the license key, such as number of activated devices, etc. | returned if **Metadata=True** | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | #### License Key (FieldsToReturn=0) | **Parameter** | **Description** | **Remarks** | **Hide?** | | --- | --- | --- | --- | | ProductId | The ID of the product that this key belongs to. | always returned | | ID | The ID (within the product) of the license key. | depends on configuration | | | Key | The license key string, eg. ABCDE-EFGHI-JKLMO-PQRST. | depends on configuration | | | Created | The creation date of the license key. | always returned | | Expires | The expiration date of the license key. Note, it's optional and it's up to your program to interpret this. Please see [Key's that don't expire](https://help.cryptolens.io/web-interface/keys-that-dont-expire). | always returned | | Period | The duration of current license cycle eg. 30 days. Note, this is a static number and does not change automatically. | always returned | | F1 | The feature 1 of the license key. | always returned | | F2 | The feature 2 of the license key. | always returned | | F3 | The feature 3 of the license key. | always returned | | F4 | The feature 4 of the license key. | always returned | | F5 | The feature 5 of the license key. | always returned | | F6 | The feature 6 of the license key. | always returned | | F7 | The feature 7 of the license key. | always returned | | F8 | The feature 8 of the license key. | always returned | | Notes | The notes field of the license key. | depends on configuration | | | Block | This will always be false. | always returned | | GlobalId | A unique identifier of the license key. It can, for instance, be used as a "ReferencerId" when creating a [data object(aka additional variables)](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). | depends on configuration | | | Customer | The entire [customer](https://app.cryptolens.io/docs/api/v3/model/Customer) object assigned to this license key. | depends on configuration | | | ActivatedMachines | A list of [Activation data](https://app.cryptolens.io/docs/api/v3/model/ActivationData). It will include both node-locked and floating licenses. In the case of floating licenses, it will list all of the floating machines that have not expired, even if the *FloatingTimeInterval* is smaller. If you only want to see floating devices that would be permitted within a certain *FloatingTimeInterval*, then you can filter them as follows: **FloatingExpires** ≤ **UTCNow.AddSeconds(FloatingTimeInterval)**. For more information on the difference between floating and node-locked licenses, please see [this article](https://help.cryptolens.io/faq/index#node-locked-vs-floating-licenses). | depends on configuration | | | TrialActivation | Tells if [trial activation](https://help.cryptolens.io/web-interface/trial-activation) is enabled. | always returned | | MaxNoOfMachines | The maximum number of machines/devices that may activate this license. By setting this to 0, machine locking will be disabled and an unlimited number of devices will be able to activate the license. | depends on configuration | | | AllowedMachines | Machine codes of those devices that will be prioritized during activation. Even if the limit is achieved, these will still be activated. | depends on configuration | | | DataObjects | A list of [Data objects](https://app.cryptolens.io/docs/api/v3/model/DataObject), additional variables associated with the license key. | depends on configuration | | | Reseller | The entire [reseller](https://app.cryptolens.io/docs/api/v3/model/Reseller) object assigned to this license key. | depends on configuration | | | SignDate | The DateTime when this activation file was signed. | always returned | | Signature | The signature of the all the fields above | Returned if **Sign=true**. | #### Metadata (FieldsToReturn=0) You can hide metadata by checking. | **Parameter** | **Description** | **Remarks** | **Hide?** | | --- | --- | --- | --- | | ActivatedMachines | The number of activated machines for this license key. | depends on configuration | | | LicenseStatus | Additional information about the license key. It contains the following: **IsValid** - Either true or false, depending on if the license satisfies all conditions for being valid. **ReasonForInvalidity** - if a license is invalid, this will contain the reason (an integer). This can be decoded as follows: None = 0 Expired = 1 Blocked = 2 **Trial** - tells if the license is a trial, based on the feature definitions for the product **TimeLimited** - tells if the license is a time-limited / subscription, based on the feature definitions for the product **TimeLeft** - if the license key is time-limited, this field will contain the remaining number of days until it expires | depends on configuration | | | ActivatedMachines | The signature of the metadata object. | Returned if **sign=true**. | | | UsedFloatingMachines | The number of active floating machine codes for a specific *FloatingTimeInterval*. **Tip:** If you want to find the number of unused machines, subtract this value from maxNumberOfMachines. If overdraft is used, you need to add the maxOverdraft value to maxNumberOfMachines. | depends on configuration | | ### Example results If **SignMethod=0** ```text {"productId":1234,"licenseKey":{"id":1,"key":"AAAAA-AAAAA-AAAAA-AAAAA","created":"2015-08-27T00:00:00","expires":"2018-11-03T00:00:00","period":1023,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"this key is used as an example in one of the test cases.","block":false,"globalId":24963,"customer":{"id":3,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453"},"activatedMachines":[{"mid":"5632812","ip":"10.1.1.1","time":"2016-03-25T18:56:34.647"},{"mid":"7632812","ip":"10.1.1.2","time":"2016-04-06T15:05:35.733"},{"mid":"85256631","ip":"10.1.1.5","time":"2016-04-07T22:18:26.673"}],"trialActivation":false,"maxNoOfMachines":10,"allowedMachines":"","dataObjects":[],"signDate":"2016-04-11T09:45:06","signature":null},"result":0,"message":""} ``` If **SignMethod=1** ```text {"licenseKey":"eyJQcm9kdWN0SWQiOjMsIklEIjo2LCJLZXkiOiJHT1hHWi1WQUNLRS1TUUJZRS1CUlhVUCIsIkNyZWF0ZWQiOiIyMDE0LTAxLTAyVDAwOjAwOjAwIiwiRXhwaXJlcyI6IjIwMTQtMDItMTZUMDA6MDA6MDAiLCJQZXJpb2QiOjQ1LCJGMSI6dHJ1ZSwiRjIiOnRydWUsIkYzIjpmYWxzZSwiRjQiOmZhbHNlLCJGNSI6ZmFsc2UsIkY2IjpmYWxzZSwiRjciOmZhbHNlLCJGOCI6ZmFsc2UsIk5vdGVzIjoidG8gU2NvdCIsIkJsb2NrIjpmYWxzZSwiR2xvYmFsSWQiOjEwMDksIkN1c3RvbWVyIjp7IklkIjoyNywiTmFtZSI6ImN1c3RvbWVyIiwiRW1haWwiOiJhcnRlbUBhcnRlbWxvcy5uZXQiLCJDb21wYW55TmFtZSI6InRlc3QiLCJDcmVhdGVkIjoiMjAxNi0wMS0wNFQxOTo0OTowOS4zMDcifSwiQWN0aXZhdGVkTWFjaGluZXMiOltdLCJUcmlhbEFjdGl2YXRpb24iOmZhbHNlLCJNYXhOb09mTWFjaGluZXMiOi0xLCJBbGxvd2VkTWFjaGluZXMiOm51bGwsIkRhdGFPYmplY3RzIjpbXSwiU2lnbkRhdGUiOiIyMDE3LTA0LTE0VDE0OjE1OjM4IiwiU2lnbmF0dXJlIjpudWxsfQ==","signature":"fVhV2revZTug1HtYcLkSEEMCPk0AkaBWBl4cRYOXlOpHR5S7xNtcY9o+wXRuauNXzGXh5LQcT8Ybo1HJ1LFp3z7sEfoDZZHfckbKbeSOTi+ercuqH26nWdvD2wgKsJsU0Rx6iClyKezNS36azriubdxcVabClFawn65GHexw14AeQlGU1jreAs0N57Dw/jwuBPXGfId64V8daOozVJQFhJVA6B1ZSu01FfxuBQxn2kj+UhjRGMp79JasCu2h1V5End66IHf0jlbgfsRDlWGfik1oK1LhFfkVV9rURSWiINhh1rZn1NM4ELHr/ASXUj1P1PdrtPadobDO+eXDUZhBHQ==","result":0,"message":""} ``` ### Remarks - The feature lock value is used to store the *filedsToReturn* value. If you set a certain value in the feature lock, it will be prioritized higher than the *fieldsToReturn* parameter. - To compute the value of the feature lock, please use the **Hide** column, for those fields that you want to omit in the result [above](https://app.cryptolens.io/docs/api/v3/GetKey#LicenseKey). - Hiding a column using the *filedsToReturn* does not remove the field from the result. It only removes the value of the field, for example by setting it to **null**. - (For first time use) Before you proceed with signing, please visit [this page](https://app.cryptolens.io/User/Security) to generate your public/private key pair. - The *SignMethod* currently supports two ways of returning the license key information and signing the content. **Linq Sign (0)** - The default option supported in the SKM Client API for.NET. Everything is returned as a JSON dictionary with a signature attached to the license key object. - **String Sign (1)** - This option is tailored for cross platform applications and is the preferred way retrieving signed versions of the license key object. The license key is converted into a json string which is later stored in base64. This is then signed using RSA 2048 with SHA256. Please note that in both cases, **Sign** has to be set to true if you want the license key to be signed. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Model Versions This changelog list changes of the returned fields given the model version. 3. This model has a few changes. First, we have added a **Reseller** object to the **LicenseKey**. Secondly, we have made sure that all node-locked and floating licenses are returned (unless field masking is used). We added **FloatingExpires** to **ActivatedMachines** so that you can check when the activatin was set to expire (note, this value can be overrriden when calling this method with a different *FloatingTimeInterval*). 2. Add **FriendlyName** to **ActivatedMachines** in the license key. 1. The original model. ### Get Keys URL: `https://app.cryptolens.io/docs/api/v3/GetKeys` Summary: This method will return a list of keys for a given [product](https://app.cryptolens.io/Feature/Product). Please keep in mind that although each license key will be of the [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey) type, the fields related to... This method will return a list of keys for a given [product](https://app.cryptolens.io/Feature/Product). Please keep in mind that although each license key will be of the [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey) type, the fields related to signing operations will be left empty. Instead, if you want to get a signed license key (for example, to achieve [offline key activation](https://help.cryptolens.io/examples/offline-verification)), please use the [Activation](https://app.cryptolens.io/docs/api/v3/Activate) instead. This method is accessed by [https://api.cryptolens.io/api/product/GetKeys](https://api.cryptolens.io/api/product/GetKeys) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Page | If there are more than 100 keys, only 99 will be returned on the first page. in order to obtain the remaining licenses, increment this parameter by 1. | optional. 1 by default. | | [OrderBy](https://app.cryptolens.io/docs/api/v3/GetKeys#remarks) | Specifies the way to order the result. More information is found in [Remarks](https://app.cryptolens.io/docs/api/v3/GetKeys#remarks) | optional. "ID ascending" by default. | | [SearchQuery](https://app.cryptolens.io/docs/api/v3/GetKeys#remarks) | Sorts the result so that only the license keys that satisfy the criterion will be displayed. More information. is found in [Remarks](https://app.cryptolens.io/docs/api/v3/GetKeys#remarks) | optional. empty string by default. | | GlobalId | If you need to find a specific license key, you can instead set this parameter to its ID, to get a faster response. | optional. 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseKeys | A list of [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey) objects. | returned if successful | | Returned | The number of licenses returned in the request, eg. size of the returned list. | always returned | | Total | The total number of keys available that satisfy the condition. For example, if *search query* is empty, the **total** is the number of license keys in the entire product. Otherwise, it's the number of results of that query. By default, only 99 license keys will be returned in a single request. There may still be more license keys, which are obtained by increasing the **Page** parameter. | always returned | | PageCount | Since not all keys will be returned if the number of them is more than 99, you can increment the **Page** parameter to list the remaining ones. This value is the limit of the number of pages available (this makes it easier to iterate through all the keys). | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"licenseKey":[{"productId":1234,"id":1,"key":"AAAAA-AAAAA-AAAAA-AAAAA","created":"2015-08-27T00:00:00","expires":"2018-11-03T00:00:00","period":1023,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"this key is used as an example in one of the test cases.","block":false,"globalId":24963,"customer":{"id":3,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453"},"activatedMachines":[{"mid":"5632812","ip":"10.1.1.1","time":"2016-03-25T18:56:34.647"},{"mid":"7632812","ip":"10.1.1.2","time":"2016-04-06T15:05:35.733"},{"mid":"85256631","ip":"10.1.1.5","time":"2016-04-07T22:18:26.673"}],"trialActivation":false,"maxNoOfMachines":10,"allowedMachines":"","dataObjects":[],"signDate":"2016-04-11T09:45:06","signature":null}],"returned":99,"total":106,"pageCount":2,"result":0,"message":""} ``` ### Remarks - The fields *SignDate* and *Signature* will be empty. Please use [Activation](https://app.cryptolens.io/docs/api/v3/Activate) in order to get each license signed. - The *order by* field has the following structure: **fieldName [ascending|descending]**. For example, If you want to order by the feature field 1 (F1), you should use **F1**. If you want it in descending order, please add the **descending** keywords right after the field, eg. **F1 descending**. The **ascending** keyword is the default, hence optional. - The *search query* field accepts the same queries as the search box on the product page. You can read about the format [here](https://help.cryptolens.io/web-interface/linq-search-product). - The **key lock** does not have any effect on this method, eg. you will still be able to retrieve all keys even if the key lock is set to a certain key. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | The search query causes problems. Please check that it follows the standard: https://help.cryptolens.io/web-interface/linq-search-product | | The 'order by' field causes problems. Please check the remarks section for this method. | ### Create Key URL: `https://app.cryptolens.io/docs/api/v3/CreateKey` Summary: This method allows you to create a new license key. The license can either be standalone or associated to a specific customer. It is also possible to add a new customer and associate it with the newly created license... This method allows you to create a new license key. The license can either be standalone or associated to a specific customer. It is also possible to add a new customer and associate it with the newly created license using *NewCustomer* parameter. If you would like to avoid duplicates based on the email, you can use the *AddOrUseExistingCustomer* parameter. This method is accessed by [https://api.cryptolens.io/api/key/CreateKey](https://api.cryptolens.io/api/key/CreateKey) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Period | The number of days, from today, the license key should be valid. Note, you will still be able to activate keys that have "expired". You can enforce the expiration date in the client program. Please see [Keys that don't expire](https://help.cryptolens.io/web-interface/keys-that-dont-expire) tutorial. | optional, 0 by default. | | F1 | The feature 1 (either true or false) | optional. by default, it's "false" | | F2 | The feature 2 (either true or false) | optional. by default, it's "false" | | F3 | The feature 3 (either true or false) | optional. by default, it's "false" | | F4 | The feature 4 (either true or false) | optional. by default, it's "false" | | F5 | The feature 5 (either true or false) | optional. by default, it's "false" | | F6 | The feature 6 (either true or false) | optional. by default, it's "false" | | F7 | The feature 7 (either true or false) | optional. by default, it's "false" | | F8 | The feature 8 (either true or false) | optional. by default, it's "false" | | Notes | Additional notes about the license key. Max. 500 chars. | optional. by default, it's empty. | | Block | Blocks the key from being accessed by the Activation method. | optional. by default, it's "false" | | CustomerId | The id of the [customer](https://app.cryptolens.io/docs/api/v3/model/customer) that should be associated with this license key. | optional. by default, it's null. | | NewCustomer | If set to true, you will be able to add the paramters that apply to [Add Customer](https://app.cryptolens.io/docs/api/v3/AddCustomer) method to this method so that a customer is automatically created together with the license key. When setting this parameter to true, please ensure that CustomerId is not set to anything.**Note:** In addition to CreateKey permission, you also need to add 'AddCustomer' permission. | optional. false by default. | | AddOrUseExistingCustomer | If set to true, this method will either associate the license with a new customer (if no customer with the specified email exists) or with an existing one (the customer whose email is the same as the 'Email' parameter of this method). **Note:** In addition to CreateKey permission, you also need to add 'AddCustomer' permission. The same idea applies as for the option 'NewCustomer', i.e. this method can be called with the same parameters as [Add Customer](https://app.cryptolens.io/docs/api/v3/AddCustomer) method. If a customer already exists, the license will be associated with an existing customer whose email address equals to 'Email' parameter. Properties of an existing customer will not be updated. | optional. false by default. | | TrialActivation | Enables or disables [Trial activation](https://help.cryptolens.io/web-interface/trial-activation) | optional. by default, it's "false" | | MaxNoOfMachines | In order to restrict the number of computers that can use the same key, you can set enable this feature by enter a number greater than zero. This number represents the maximum number of computers that can activate the key. | optional. by default, it's "0" | | AllowedMachines | A list (separated by new lines) of machine codes that will be prioritized during key activation. | optional. by default, it's null. | | ResellerId | The id of the [reseller](https://app.cryptolens.io/docs/api/v3/model/reseller) that should be associated with this license key. | optional. by default, it's 0. | | NoOfKeys | The number of keys to generate. | optional. 1 by default. | | v | Method version. | optional. by default, it's 1. | ### Results Case 1: If **NoOfKeys** is not specified or set to 1, the followig model will be returned. Note, if **format=plaintext**, only the key string is returned (read more about different media types [here](https://app.cryptolens.io/docs/api/v3/MediaTypes)). | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Key | The newly generated key | returned if no error occurred. | | CustomerId | The customer id of the customer that was associated with the license key. | returned if **NewCustomer** or **AddOrUseExistingCustomer** are set to true. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | Case 2: If **NoOfKeys** is greater than 1, the followig model will be returned. Note, if **format=plaintext**, each license key string will be returned separated by new line (read more about different media types [here](https://app.cryptolens.io/docs/api/v3/MediaTypes)). | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Keys | A list of license keys that uses the same format as in Case 1. | returned if no error occurred. | | CustomerId | The customer id of the customer that was associated with the license key. | returned if **NewCustomer** or **AddOrUseExistingCustomer** are set to true. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"key":"ABCDE-ABCDE-ABCDE-ABCDE","result":0,"message":""} ``` ```text {"keys":[{"key":"ABCDE-ABCDE-ABCDE-ABCDE","result":0,"message":null},{"key":"ABCDE-ABCDE-ABCDE-ABCDE","result":0,"message":null}],"result":0,"message":null} ``` ### Remarks - This method will only generate at most 1K keys at a time, even if NoOfKeys is set to a higher value. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The notes field cannot be more than 500 characters. | | Could not find the product. | | Could not find the customer. | | Creation of a license with x day(s) is not possible in SKGL. The limit is 999 days. | | Generating more than 99,999 keys is not possible in SKGL. | | Access denied. Please add 'AddCustomer' permission. | ### Create Trial Key URL: `https://app.cryptolens.io/docs/api/v3/CreateTrialKey` Summary: This method creates a license key that is time-limited, [node-locked](https://help.cryptolens.io/licensing-models/node-locked) and with the "Time-Limited" and "Trial" features set to true (which can be set by editing the... This method creates a license key that is time-limited, [node-locked](https://help.cryptolens.io/licensing-models/node-locked) and with the "Time-Limited" and "Trial" features set to true (which can be set by editing the [feature definitions](https://help.cryptolens.io/web-interface/feature-definitions) on the product page). **Note**, by default, the trial will work for 15 days. To change this limit, you can set the **Feature Lock** to the desired value, when creating the access token. If a trial key was already created for a certain machine code, this method will try to find the license key and return it instead. However, this will only occur if the license key is still a trial key (based on feature definitions) and is not blocked. This method is accessed by [https://api.cryptolens.io/api/key/CreateTrialKey](https://api.cryptolens.io/api/key/CreateTrialKey) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | MachineCode | The machine code (a string that identifies a device) that this trial key will be locked to. Please note that the max length of the machine code is set to 128 chars. | optional. empty string by default. | | FriendlyName | Allows you to specify a friendy name for the activated device, for example the employee's email. Friendly name does not impact the number of active machine codes / seats, but it offers an easy way of linking a machine/seat with a user. For added security, you can HMAC hash this value. | optional. empty string by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Key | The newly generated key | returned if no error occurred. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"key":"ABCDE-ABCDE-ABCDE-ABCDE","result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The notes field cannot be more than 500 characters. | | Could not find the product. | | Could not find the customer. | | Creation of a license with x day(s) is not possible in SKGL. The limit is 999 days. | | Generating more than 99,999 keys is not possible in SKGL. | ### Deactivate URL: `https://app.cryptolens.io/docs/api/v3/Deactivate` Summary: This method will 'undo' a [key activation](https://app.cryptolens.io/docs/api/v3/Activate) with a certain machine code. The key should not be blocked, since otherwise this method will throw an error. This method will 'undo' a [key activation](https://app.cryptolens.io/docs/api/v3/Activate) with a certain machine code. The key should not be blocked, since otherwise this method will throw an error. This method is accessed by [https://api.cryptolens.io/api/key/Deactivate](https://api.cryptolens.io/api/key/Deactivate) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | The machine code (a string that identifies a device) for activation. | optional. empty string by default. | | Floating | When true, this will release the floating license (without removing it from the list of node-locked licenses). | optional. false by default. | | OSInfo | Additional OS related information (as a string) that will be registered as metadata in [Register Event](https://app.cryptolens.io/docs/api/v3/RegisterEvent). | optional. null by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Remarks - When a machine code does not exist (for example, if was never activated or deactivated at some point), an error will be thrown in the node-locking case only (e.g. when you call this method with default parameters and Floating=false). However, if floating licensing is used (i.e. Floating=true), then an error will not be thrown even if the machine code does not exist. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | The key is blocked and cannot be accessed. | | Either the machine code was never activated or key activation feature was never set up. | ### Block Key URL: `https://app.cryptolens.io/docs/api/v3/BlockKey` Summary: This method will block a specific license key to ensure that the key cannot be accessible by most of the methods in the Web API ([activation](https://app.cryptolens.io/docs/api/v2/Activate), [validation](https://app.cryptolens.io/docs/api/v2/Validate), [optional... This method will block a specific license key to ensure that the key cannot be accessible by most of the methods in the Web API ([activation](https://app.cryptolens.io/docs/api/v2/Activate), [validation](https://app.cryptolens.io/docs/api/v2/Validate), [optional field](https://app.cryptolens.io/docs/api/v2/OptionalField), and [deactivation](https://app.cryptolens.io/docs/api/v2/Deactivate)). Note, blocking the key will still allow you to access the key in Web API 3, unless otherwise stated for a given Web API 3 method. To do the reverse, please see [Unblock Key](https://app.cryptolens.io/docs/api/v3/UnblockKey). This method is accessed by [https://api.cryptolens.io/api/key/BlockKey](https://api.cryptolens.io/api/key/BlockKey) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **Changed** or **Not changed** will be returned (i.e. if the key was already blocked, **Not changed** is returned.) Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Unblock Key URL: `https://app.cryptolens.io/docs/api/v3/UnblockKey` Summary: This method will unblock a specific license key to ensure that the key can be accessible by most of the methods in the Web API ([activation](https://app.cryptolens.io/docs/api/v2/Activate), [validation](https://app.cryptolens.io/docs/api/v2/Validate), [optional... This method will unblock a specific license key to ensure that the key can be accessible by most of the methods in the Web API ([activation](https://app.cryptolens.io/docs/api/v2/Activate), [validation](https://app.cryptolens.io/docs/api/v2/Validate), [optional field](https://app.cryptolens.io/docs/api/v2/OptionalField), and [deactivation](https://app.cryptolens.io/docs/api/v2/Deactivate)). To do the reverse, please see [Block Key](https://app.cryptolens.io/docs/api/v3/BlockKey). This method is accessed by [https://api.cryptolens.io/api/key/UnblockKey](https://api.cryptolens.io/api/key/UnblockKey) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result,either **Changed** or **Not changed** will be returned (i.e. if the key was already unblocked, **Not changed** is returned.) Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Extend License URL: `https://app.cryptolens.io/docs/api/v3/ExtendLicense` Summary: This method will extend a license by a certain amount of days. If the [key algorithm](https://help.cryptolens.io/web-interface/skgl-vs-skm15) in the product is SKGL, the key string will be changed if necessary.... This method will extend a license by a certain amount of days. If the [key algorithm](https://help.cryptolens.io/web-interface/skgl-vs-skm15) in the product is SKGL, the key string will be changed if necessary. Otherwise, if SKM15 is used, the key will stay the same. More about the way this method works in [Remarks](https://app.cryptolens.io/docs/api/v3/ExtendLicense#remarks). This method is accessed by [https://api.cryptolens.io/api/key/ExtendLicense](https://api.cryptolens.io/api/key/ExtendLicense) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | NoOfDays | The number of days the license should be extended. | optional. by default, it's zero. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Remarks This method works as follows: if the expiration date of a license key has not passed, it will add the provided number of days to the expiration date. Otherwise it will add the provided number of days to the current date (i.e. today). A negative number of days will decrease the expiration date. Let's assume we extend a license with **365** days. This method will ensure that the license will be valid in **365** days from the current day (or more if the license had some additional days left). For example, - If a key that **has expired** is extended, it will be valid for **365** days from the current date. - If a key that **has not expired** is extended, let's say it has **20** days left, then it will be valid for **365+20** days. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Machine Lock Limit URL: `https://app.cryptolens.io/docs/api/v3/MachineLockLimit` Summary: This method will change the *maximum number of machine codes* that a license key can have. This method will change the *maximum number of machine codes* that a license key can have. This method is accessed by [https://api.cryptolens.io/api/key/MachineLockLimit](https://api.cryptolens.io/api/key/MachineLockLimit) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | NumberOfMachines | The new value that should be set as the maximum number of machines for this license. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Change Notes URL: `https://app.cryptolens.io/docs/api/v3/ChangeNotes` Summary: This method will change the content of the notes field of a given license key. This method will change the content of the notes field of a given license key. This method is accessed by [https://api.cryptolens.io/api/key/ChangeNotes](https://api.cryptolens.io/api/key/ChangeNotes) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Notes | The new content of the notes field (at most 500 chars) | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | The notes field cannot be more than 500 characters. | ### Change Customer URL: `https://app.cryptolens.io/docs/api/v3/ChangeCustomer` Summary: This method will change the customer associated with a license. If the customer is not specified (for example, if CustomerId=0) or the customer with the provided ID does not exist, any customer that was previously... This method will change the customer associated with a license. If the customer is not specified (for example, if CustomerId=0) or the customer with the provided ID does not exist, any customer that was previously associated with the license will be dissociated. This method is accessed by [https://api.cryptolens.io/api/key/ChangeCustomer](https://api.cryptolens.io/api/key/ChangeCustomer) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | CustomerId | The id of the customer that will be associated with the license. If it is 0 or not found, any customer that was previously associated will be removed. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | Customer not found, so current key no longer references any customer. | ### Change Reseller URL: `https://app.cryptolens.io/docs/api/v3/ChangeReseller` Summary: This method will change the reseller of a license. If the reseller is not specified (for example, if ResellerId=0) or the reseller with the provided ID does not exist, any reseller that was previously associated with the... This method will change the reseller of a license. If the reseller is not specified (for example, if ResellerId=0) or the reseller with the provided ID does not exist, any reseller that was previously associated with the license will be dissociated. This method is accessed by [https://api.cryptolens.io/api/key/ChangeReseller](https://api.cryptolens.io/api/key/ChangeReseller) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | ResellerId | The id of the reseller that will be associated with the license. If it is 0 or not found, any reseller that was previously associated will be removed. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | The reseller was not found or the id was set to zero. The license will no longer have any reseller associated with it. | ### Trial Activation URL: `https://app.cryptolens.io/docs/api/v3/TrialActivation` Summary: This method allows you to enable [Trial Activation](https://help.cryptolens.io/web-interface/trial-activation) (aka. start count down upon activation) field of a license. Please note that if you do not supply the Enabled... This method allows you to enable [Trial Activation](https://help.cryptolens.io/web-interface/trial-activation) (aka. start count down upon activation) field of a license. Please note that if you do not supply the Enabled parameter in the call, Trial Activation will be set to False. This method is accessed by [https://api.cryptolens.io/api/key/TrialActivation](https://api.cryptolens.io/api/key/TrialActivation) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Enabled | A boolean (True or False) that Trial Activation property of the license key will be set to. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. In case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Add Feature URL: `https://app.cryptolens.io/docs/api/v3/AddFeature` Summary: This method will set a certain feature (F1..F8) to **true**. If the [key algorithm](https://help.cryptolens.io/web-interface/skgl-vs-skm15) in the product is SKGL, the key string will be changed if necessary. Otherwise,... This method will set a certain feature (F1..F8) to **true**. If the [key algorithm](https://help.cryptolens.io/web-interface/skgl-vs-skm15) in the product is SKGL, the key string will be changed if necessary. Otherwise, if SKM15 is used, the key will stay the same. To do the reverse, please see [RemoveFeature](https://app.cryptolens.io/docs/api/v3/RemoveFeature). This method is accessed by [https://api.cryptolens.io/api/key/AddFeature](https://api.cryptolens.io/api/key/AddFeature) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Feature | The feature number, 1 to 8 (inclusive), that should be set to true. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ### Remove Feature URL: `https://app.cryptolens.io/docs/api/v3/RemoveFeature` Summary: This method will set a certain feature (F1..F8) to **false**. If the [key algorithm](https://help.cryptolens.io/web-interface/skgl-vs-skm15) in the product is SKGL, the key string will be changed if necessary. Otherwise,... This method will set a certain feature (F1..F8) to **false**. If the [key algorithm](https://help.cryptolens.io/web-interface/skgl-vs-skm15) in the product is SKGL, the key string will be changed if necessary. Otherwise, if SKM15 is used, the key will stay the same. To do the reverse, please see [AddFeature](https://app.cryptolens.io/docs/api/v3/AddFeature). This method is accessed by [https://api.cryptolens.io/api/key/RemoveFeature](https://api.cryptolens.io/api/key/RemoveFeature) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Feature | The feature number, 1 to 8 (inclusive), that should be set to false. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | ## License Templates ### License Templates URL: `https://app.cryptolens.io/docs/api/v3/LicenseTemplate` Summary: Methods related to [license templates](https://app.cryptolens.io/LicenseTypes). You can read more about them [here](https://help.cryptolens.io/web-interface/license-template). ### Methods Methods related to [license templates](https://app.cryptolens.io/LicenseTypes). You can read more about them [here](https://help.cryptolens.io/web-interface/license-template). - [Get License Templates](https://app.cryptolens.io/docs/api/v3/GetLicenseTemplates) ### Get License Templates URL: `https://app.cryptolens.io/docs/api/v3/GetLicenseTemplates` Summary: Returns the list of [license templates](https://app.cryptolens.io/LicenseTypes). A license template allows you to pre-define the parameters that are used when creating a new license. You can read more about them... Returns the list of [license templates](https://app.cryptolens.io/LicenseTypes). A license template allows you to pre-define the parameters that are used when creating a new license. You can read more about them [here](https://help.cryptolens.io/web-interface/license-template). This method is accessed by [https://api.cryptolens.io/api/licensetemplate/GetLicenseTemplates](https://api.cryptolens.io/api/licensetemplate/GetLicenseTemplates) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseTemplates | List of [License Template](https://app.cryptolens.io/docs/api/v3/model/LicenseTemplate) objects. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"licenseTemplates":[{"id":5,"name":"test","productId":3,"parameters":"{\"ProductId\":3,\"Period\":30,\"F1\":false,\"F2\":false,\"F3\":false,\"F4\":false,\"F5\":false,\"F6\":false,\"F7\":false,\"F8\":false,\"Notes\":null,\"Block\":false,\"CustomerId\":0,\"TrialActivation\":false,\"MaxNoOfMachines\":0,\"AllowedMachines\":null}"},{"id":6,"name":"test222","productId":3645,"parameters":"{\"ProductId\":3645,\"Period\":30,\"F1\":true,\"F2\":true,\"F3\":false,\"F4\":false,\"F5\":false,\"F6\":false,\"F7\":false,\"F8\":false,\"Notes\":null,\"Block\":false,\"CustomerId\":0,\"TrialActivation\":false,\"MaxNoOfMachines\":0,\"AllowedMachines\":null}"},{"id":11,"name":"testv2","productId":3645,"parameters":"[{\"APIMethodName\":\"CreateKey\",\"Parameters\":{\"ProductId\":3645,\"Period\":30,\"F1\":false,\"F2\":false,\"F3\":false,\"F4\":false,\"F5\":false,\"F6\":false,\"F7\":false,\"F8\":false,\"Notes\":null,\"Block\":false,\"CustomerId\":0,\"TrialActivation\":false,\"MaxNoOfMachines\":0,\"AllowedMachines\":null}},{\"APIMethodName\":\"AddDataObjectToKey\",\"Parameters\":{\"Name\":\"cryptolens_features\",\"StringValue\":\"[\\\"ModuleA\\\",[\\\"ModuleB\\\",[\\\"Submodule 1\\\",\\\"Submodule 2\\\"]]]\",\"IntValue\":0,\"CheckForDuplicates\":false,\"ProductId\":3645,\"Key\":\"[key]\"}}]"}],"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | ### Create Key From Template URL: `https://app.cryptolens.io/docs/api/v3/CreateKeyFromTemplate` Summary: This method will create a license key based on a [License Template](https://app.cryptolens.io/LicenseTypes). If you want to see all the defined license templates through the API, this can be accomplished with [Get License... This method will create a license key based on a [License Template](https://app.cryptolens.io/LicenseTypes). If you want to see all the defined license templates through the API, this can be accomplished with [Get License Templates](https://app.cryptolens.io/docs/api/v3/GetLicenseTemplates). An alternative is to call the [Create Key](https://app.cryptolens.io/docs/api/v3/CreateKey) method, which allows you to specify all the parameters yourself. **Note:** the "feature lock" field in the access token can be used to restrict which license tempalte id can be used. This method is accessed by [https://api.cryptolens.io/api/key/CreateKeyFromTemplate](https://api.cryptolens.io/api/key/CreateKeyFromTemplate) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseTemplateId | The id of the license template. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Key | The license key string of the newly generated license | always returned | | RawResponse | Properties extracted from the underlying API response, formatted as JSON. | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"key":"MWYXE-VBPFS-OMNDM-GRJRY","rawResponse":"{\"key\":\"MWYXE-VBPFS-OMNDM-GRJRY\",\"result\":\"Success\",\"message\":null}","result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The specified template id is not allowed because feature lock. Please use an access token with feature lock set to 0 or set it to the id of the license template. | | Could not find the license template. | | Could not find the key. | ## Customer Methods ### Customer URL: `https://app.cryptolens.io/docs/api/v3/Customer` Summary: Methods that allow you to interact with your customers and their licenses (see [Customer Management](https://app.cryptolens.io/Feature/Customer)). ### Methods Methods that allow you to interact with your customers and their licenses (see [Customer Management](https://app.cryptolens.io/Feature/Customer)). - [Add Customer](https://app.cryptolens.io/docs/api/v3/AddCustomer) - [Edit Customer](https://app.cryptolens.io/docs/api/v3/EditCustomer) - [Get Customers](https://app.cryptolens.io/docs/api/v3/GetCustomers) - [Get Customer Licenses](https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses) - [Remove Customer](https://app.cryptolens.io/docs/api/v3/RemoveCustomer) ### Add Customer URL: `https://app.cryptolens.io/docs/api/v3/AddCustomer` Summary: This method will add new customer. To remove an existing customer, please see [Remove Customer](https://app.cryptolens.io/docs/api/v3/RemoveCustomer). This method will add new customer. To remove an existing customer, please see [Remove Customer](https://app.cryptolens.io/docs/api/v3/RemoveCustomer). This method is accessed by [https://api.cryptolens.io/api/customer/AddCustomer](https://api.cryptolens.io/api/customer/AddCustomer) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Name | The name of the customer (at most 100 chars) | required | | Email | The email of the customer (at most 100 chars) | required | | CompanyName | The company name of the company the customer belongs to (at most 100 chars) | required | | Notes | An optional notes field (at most 1000 chars) | optional | | EnableCustomerAssociation | If set to true, a portal link will be returned where the customer will be able to view their licenses. | Optional, false by default. | | AllowActivationManagement | If set to true, the customer activate and deactivate devices through the customer portal. | Optional, false by default. | | AllowMultipleUserAssociation | If set to true, it will be possible to associate multiple user accounts with this customer. | Optional, false by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | CustomerId | A unique integer identifier associated with this customer. | always returned | | PortalLink | A link that allows the customer to create an account where they will see their licenses (in the customer dashboard). | Returned if **EnableCustomerAssociation** is set to true. | | Secret | The [customer secret](https://help.cryptolens.io/web-interface/customer-secret) that can be used in some methods as an alternative way to authenticate customers. | Always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"customerId":479,"secret":"customer secret","result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | ### Edit Customer URL: `https://app.cryptolens.io/docs/api/v3/EditCustomer` Summary: This method will edit an existing customer. It will only change the properties that you specify. This method will edit an existing customer. It will only change the properties that you specify. This method is accessed by [https://api.cryptolens.io/api/customer/EditCustomer](https://api.cryptolens.io/api/customer/EditCustomer) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | CustomerId | Id of the customer to edit. | An integer, required. | | Name | Name of the customer. | A string of max 100 characters. | | Email | Email of the customer. | A string of max 100 characters. | | CompanyName | Company name of the customer. | A string of max 100 characters. | | Notes | An optional notes field. | A string of max 1000 characters. | | EnableCustomerAssociation | If set to true, a portal link will be returned where the customer will be able to view their licenses. | A boolean. | | AllowActivationManagement | If set to true, the customer activate and deactivate devices through the customer portal. | A boolean. | | AllowMultipleUserAssociation | If set to true, it will be possible to associate multiple user accounts with this customer. | A boolean. | | MaxNoOfDevices | This limits the number of computers that will be able to use customer's licenses. '0' stands for unlimited. | An integer. | | Secret | If set to true, the customer secret will be updated. | A boolean. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | CustomerId | A unique integer identifier associated with this customer. | always returned | | PortalLink | A link that allows the customer to create an account where they will see their licenses (in the customer dashboard). | Returned if **EnableCustomerAssociation** or **Secret** is set to true. | | Secret | The customer secret. | Returned if **Secret** or **EnableCustomerAssociation** is set to true. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Customer could not be found. | | The name of the customer is limited to 100 characters. | | The email of the customer is limited to 100 characters. | | The company name of the customer is limited to 100 characters. | ### Get Customers URL: `https://app.cryptolens.io/docs/api/v3/GetCustomers` Assumed ModelVersion: 3 (highest documented version at generation time) Summary: This method returns the list of customers. By default, it preserves the legacy ordering. If `SortByCreatedDescending=true`, the newest customers will be shown first. This method returns the list of customers. By default, it preserves the legacy ordering. If `SortByCreatedDescending=true`, the newest customers will be shown first. This method is accessed by [https://api.cryptolens.io/api/customer/GetCustomers](https://api.cryptolens.io/api/customer/GetCustomers) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Search | By default, if either the Name, Company, Email or the Secret matches the search string, it will be returned. If `IncludeIdInSearch=true`, then a numeric Search value can also match the customer Id. | optional | | IncludeIdInSearch | When set to `true`, a numeric Search value can also match the customer Id. By default, this is `false` to preserve the existing Search behavior. | optional. default is false. | | CustomerId | If this is set, you can use the CustomerId field to find a specific customer based on their integer Id. This remains a dedicated exact-Id filter and is independent from the opt-in Search behavior above. | optional | | Limit | Specifies how many customers will be returned. If not set, all customers will be returned. | optional. disabled by default. | | SortByCreatedDescending | When set to `true`, customers are ordered by creation date descending, with newer customers returned first. By default, this is `false` to preserve the existing paging and ordering behavior. | optional. default is false. | | ModelVersion | The model that will be returned. In comparison to method version, this only affects what fields and information will be returned and does not impact the way the method works. A changelog can be found in the [end of this page](https://app.cryptolens.io/docs/api/v3/GetCustomers#model-versions). | optional. by default, it's 1. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Customers | A list of [Customer](https://app.cryptolens.io/docs/api/v3/model/Customer) objects. | always returned | | ResellerCustomers | A list of [Customer](https://app.cryptolens.io/docs/api/v3/model/Customer) objects. These customers belong to a different user but you can still edit some of the fields. | always returned | | VisibleCustomers | A list of [Customer](https://app.cryptolens.io/docs/api/v3/model/Customer) objects. These customers belong to a different user but you can still view them. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"customers":[{"id":1234,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453"}],"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | ### Model Versions This changelog list changes of the returned fields given the model version. 2. All customer objects that are returned will have the same fields as described [here](https://app.cryptolens.io/docs/api/v3/model/Customer). 1. The original model. ### Get Customer Licenses URL: `https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses` Assumed ModelVersion: 3 (highest documented version at generation time) Summary: This method will return a list of license keys that belong to a certain customer. This method will return a list of license keys that belong to a certain customer. This method is accessed in several ways. Each way works in the same way but requires the different permissions. The first method requires *GetCustomerLicenses* permission and the second method requires *GetCustomerLicensesBySecret* permission. The set of accepted parameters differs between the methods. Both cases are listed below: ### Parameters **Method 1:** [https://api.cryptolens.io/api/customer/GetCustomerLicenses](https://api.cryptolens.io/api/customer/GetCustomerLicenses) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | CustomerId | The id of the customer whose licenses we want to access. | required | | Metadata | Includes [additional information](https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses#Metadata) about each license key, such as number of activated devices, etc. | optional. false by default. | | ModelVersion | The model that will be returned. In comparison to method version, this only affects what fields and information will be returned and does not impact the way the method works. A changelog can be found in the [end of this page](https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses#model-versions). | optional. by default, it's 1. | | v | Method version. | optional. by default, it's 1. | **Method 2:** [https://api.cryptolens.io/api/customer/GetCustomerLicensesBySecret](https://api.cryptolens.io/api/customer/GetCustomerLicensesBySecret) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Secret | The Customer secret that can be used by clients to identify themselves to, for instance, retrieve their licenses. | required | | Metadata | Includes [additional information](https://app.cryptolens.io/docs/api/v3/GetCustomerLicenses#Metadata) about each license key, such as number of activated devices, etc. | optional. false by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseKeys | The license keys that belong to the customer. The [License Key](https://app.cryptolens.io/docs/api/v3/GetKey) model is returned. Please note that Reseller information is not returned at this time and will be set to null. You can obtain it by using Activate or GetKey method. | always returned | | Metadata | Additional information about each license key. This is a dictionary of (**GlobalId**, [Metadata](https://app.cryptolens.io/docs/api/v3/model/Metadata)) pairs. In order to retrieve metadata for a specific license key, its **GlobalId** should be used. | returned if **Metadata=True** | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"licenseKeys":[{"productId":3349,"id":7,"key":"ABCDE-FGHIJ-KLMNO-PQRST","created":"2015-08-27T00:00:00","expires":"2016-07-03T00:00:00","period":1,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"","block":false,"globalId":12345},{"productId":3349,"id":18,"key":"ABCDE-FGHIJ-KLMNO-PQRST","created":"2015-08-27T00:00:00","expires":"2017-01-08T00:00:00","period":500,"f1":true,"f2":true,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"","block":false,"globalId":23456}],"result":0,"message":null} ``` ### Remarks - If **Detailed=true**, it will take longer time to execute this method. Therefore, the default option should be preferred. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Customer does not exist. | | The Secret was not specified. | | A customer with the same secret exists. | ### Remove Customer URL: `https://app.cryptolens.io/docs/api/v3/RemoveCustomer` Summary: This method will remove an existing customer given the customerId. To add a new customer, please see [Add Customer](https://app.cryptolens.io/docs/api/v3/AddCustomer). This method will remove an existing customer given the customerId. To add a new customer, please see [Add Customer](https://app.cryptolens.io/docs/api/v3/AddCustomer). This method is accessed by [https://api.cryptolens.io/api/customer/RemoveCustomer](https://api.cryptolens.io/api/customer/RemoveCustomer) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | CustomerId | The id of the customer to remove. | required | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Customer does not exist. | ## Data Object Methods ### Data Object Methods URL: `https://app.cryptolens.io/docs/api/v3/Data` Summary: These are all the methods that can be used to manipulate a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). ### Methods These are all the methods that can be used to manipulate a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). - [Add Data Object](https://app.cryptolens.io/docs/api/v3/AddDataObject) - [List Data Objects](https://app.cryptolens.io/docs/api/v3/ListDataObjects) - [Increment Int Value](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) - [Decrement Int Value](https://app.cryptolens.io/docs/api/v3/DecrementIntValue) - [Set String Value](https://app.cryptolens.io/docs/api/v3/SetStringValue) - [Set Int Value](https://app.cryptolens.io/docs/api/v3/SetIntValue) - [Remove Data Object](https://app.cryptolens.io/docs/api/v3/RemoveDataObject) - [Upload Values](https://app.cryptolens.io/docs/api/v3/UploadValues) ### Help Here are some links that are useful: - [Introduction to Data Objects](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) - [Data Objects in SKGL Extension (.NET)](https://help.cryptolens.io/web-api/dotnet/v401#custom-variables-aka-data-objects) ### Data Objects Overview URL: `https://app.cryptolens.io/docs/api/v3/DataObjectsIntro` Summary: Imagine that you would like to associate specific information with a license key, such as your **customer's name**, the **OS version**, etc. ### Introduction Imagine that you would like to associate specific information with a license key, such as your **customer's name**, the **OS version**, etc. **Data Objects** enable your application to store variables in the cloud in a way that empowers your licensing process. Think of them as **additional variables** that can be added to a license key, a product or the entire account. ### What is a Data Object? Data Object can be thought of as way to **store integers** and **strings** that can later be retrieved anywhere, anytime. For those that understand [UML](https://en.wikipedia.org/wiki/Unified_Modeling_Language), here is a visual representation of a data object. A data object contains the following fields: - **Id** - It's a unique identifier of the data object. - **Name** - It's like a variable name. Note, several objects can have the same name. A name can be 10 chars at most. - **String Value** - This is the content of the data object. It can store a string of 10000 chars. - **Int Value** - The integer value of the data object. It can store a 32 bit signed integer. A data object can be associated with following **ReferencerTypes**: - **User** - Your entire account. The ReferencerId does not need to be specified. - **Product** - A specific product. The ReferencerId is the **productId**, aka **pid**. - **Key** - A specific license key. The ReferencerId is the **keyId**, aka **sid**. ### Related Methods - [Add Data Object](https://app.cryptolens.io/docs/api/v3/AddDataObject) - Creates a new data object. - [List Data Objects](https://app.cryptolens.io/docs/api/v3/ListDataObjects) - List existing data objects. - [Increment Int Value](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) - Increments the IntValue by certain constant. - [Decrement Int Value](https://app.cryptolens.io/docs/api/v3/DecrementIntValue) - Decrements the IntValue by a certain constant. - [Set String Value](https://app.cryptolens.io/docs/api/v3/SetStringValue) - Set a new StringValue. - [Set Int Value](https://app.cryptolens.io/docs/api/v3/SetIntValue) - Set a new IntValue. - [Remove Data Object](https://app.cryptolens.io/docs/api/v3/RemoveDataObject) - Remove an existing Data Object. ### Permissions using Access Tokens As with other methods in the Web API, you can easily customize the permission/scope of each method. To enable access to a method, you need to create an [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) that enables access to the method. In addition, Data Objects have further permission settings. They are summarized below: - To create a data object associated with a **User**, both the **product lock** and the **key lock** should be disabled (set to zero). - To create a data object associated with a **Product**, no **key lock** should be present (i.e. set to zero) and the **product lock** should either be disabled or set to the desired product id. - To create a data object associated with a **Key**, there should not be any **product lock** on a product that this key does not originate from, and there should not be any **key lock** on a key other than this one. - For methods [Increment Int Value](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) and [Decrement Int Value](https://app.cryptolens.io/docs/api/v3/DecrementIntValue), you can use the **Feature lock** field in the [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) as a way to specify the upper bound. - (**Not needed anymore. Just use specialized methods.**)To work with data objects from the client application (**low trust**), the [Key Lock](https://app.cryptolens.io/docs/api/v3/KeyLock) method should be used instead. The idea is that you create a generic [Access Token](https://app.cryptolens.io/docs/api/v3/Auth), which can be converted into a **scope-limited** [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) given a license key string. Moreover, it comes with the advantage that you get the **KeyId**, which can then be used as a **ReferencerId**. You can read more [here](https://help.cryptolens.io/web-api/index). ### Add Data Object URL: `https://app.cryptolens.io/docs/api/v3/AddDataObject` Summary: This method will add a new [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) to either a license key, product, or your entire account. Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/AddDataObject#remarks). This method will add a new [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) to either a license key, product, or your entire account. Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/AddDataObject#remarks). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/AddDataObject](https://api.cryptolens.io/api/data/AddDataObject) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Name | The name of the data object. Max 100 characters. | optional, null by default. | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | IntValue | An int value (int32) to store. | optional, 0 by default. | | ReferencerType | Indicates if the data object should be added to a license key, a product or the entire user account. User = **0**, Product = **1**, Key = **2**. | optional, user (**=0**) by default. | | ReferencerId | The id of the Referencer. It can either be an id to a product that you have or to a license key. When ReferencerType is set to User, there is no need to set this value. | optional, 0 by default. | | CheckForDuplicates | If set to true, this method will check that no other data object with the same name exists. **Note**: setting this to true may affect performance. | optional, false by default. | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/AddDataObjectToKey](https://api.cryptolens.io/api/data/AddDataObjectToKey) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Name | The name of the data object. Max 100 characters. | optional, null by default. | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | IntValue | An int value (int32) to store. | optional, 0 by default. | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | CheckForDuplicates | If set to true, this method will check that no other data object with the same name exists. **Note**: setting this to true may affect performance. | optional, false by default. | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/AddDataObjectToMachineCode](https://api.cryptolens.io/api/data/AddDataObjectToMachineCode) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Name | The name of the data object. Max 10 characters. | optional, null by default. | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | IntValue | An int value (int32) to store. | optional, 0 by default. | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | CheckForDuplicates | If set to true, this method will check that no other data object with the same name exists. **Note**: setting this to true may affect performance. | optional, false by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The unique object id for the new data object. | returned if no errors are thrown. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"id":13,"result":0,"message":null} ``` ### Remarks - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | The 'Name' should have the size of max 100 chars. | | The 'StringValue' should have the size of max 10000 chars. | | The limit of the number of data objects was achieved. | | Not enough permission and/or machine code not found. | | Data object with the same name already exists. | ### List Data Objects URL: `https://app.cryptolens.io/docs/api/v3/ListDataObjects` Summary: This method lists either all [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) associated with a license key, a product or your entire account, or all of them at once. Please read more about access tokens in... This method lists either all [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) associated with a license key, a product or your entire account, or all of them at once. Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/ListDataObjects#remarks). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/ListDataObjects](https://api.cryptolens.io/api/data/ListDataObjects) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ReferencerType | Indicates if the data object is associated with a license key, a product or the entire user account. User = **0**, Product = **1**, Key = **2**. | optional, user (**=0**) by default. | | ReferencerId | The id of the Referencer. It can either be an id to a product that you have or to a license key. When ReferencerType is set to User, there is no need to set this value. | optional, 0 by default. | | Contains | Shows only Data Objects where the **name** contains the following string. | optional, "" by default. | | ShowAll | If set to **true**, all data objects will be returned, that is, both those associated with your entire account, a specific product and a license key. In addition, each data object item will include the **ReferencerType** and its **Id**. Otherwise, i.e. when set to **false**, only the data objects associated with the user, product or key will be returned, without the **ReferencerType** and its **Id**. | optional, false by default. | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/ListDataObjectsToKey](https://api.cryptolens.io/api/data/ListDataObjectsToKey) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Contains | Shows only Data Objects where the **name** contains the following string. | optional, "" by default. | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/ListDataObjectsToMachineCode](https://api.cryptolens.io/api/data/ListDataObjectsToMachineCode) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Contains | Shows only Data Objects where the **name** contains the following string. | optional, "" by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | dataObjects | A list of data objects, where each data object has the structure shown under [Data Object](https://app.cryptolens.io/docs/api/v3/ListDataObjects#dataobj). | returned if no errors are thrown. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ReferencerType | Indicates if the data object is associated with a license key, a product or the entire user account. User = **0**, Product = **1**, Key = **2**. | optional, user (**=0**) by default. | | ReferencerId | The id of the Referencer. It can either be an id to a product that you have or to a license key. When ReferencerType is set to User, there is no need to set this value. | optional, 0 by default. | | Contains | Shows only Data Objects where the **name** contains the following string. | optional, "" by default. | | ShowAll | If set to **true**, all data objects will be returned, that is, both those associated with your entire account, a specific product and a license key. In addition, each data object item will include the **ReferencerType** and its **Id**. Otherwise, i.e. when set to **false**, only the data objects associated with the user, product or key will be returned, without the **ReferencerType** and its **Id**. | optional, false by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | dataObjects | A list of data objects, where each data object has the structure shown under [Data Object](https://app.cryptolens.io/docs/api/v3/ListDataObjects#dataobj). | returned if no errors are thrown. | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | #### Data Object | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identification number for the *Data Object*. | always included. | | Name | The name of the data object. Max 10 characters. | always included. | | StringValue | A string value (text) to store. Max 10000 characters. | always included. | | IntValue | An int value (int32) to store. | always included. | | ReferencerType | Indicates if the data object is associated with a license key, a product or the entire user account. User = **0**, Product = **1**, Key = **2**. | returned only when **ShowAll** is set to **true**. | | ReferencerId | The id of the Referencer. It can either be an id to a product that you have or to a license key. | returned only when **ShowAll** is set to **true**. | ### Example results ```text {"dataObjects":[{"id":4,"name":"cust_name","stringValue":"Artem","intValue":0},{"id":5,"name":"location","stringValue":"Sweden","intValue":0}],"result":0,"message":null} ``` ```text {"dataObjects":[{"referencerId":2,"referencerType":0, "id":4,"name":"cust_name","stringValue":"Artem","intValue":0},{"referencerId":1234,"referencerType":2, "id":5,"name":"location","stringValue":"Sweden","intValue":0}],"result":0,"message":null} ``` ### Remarks - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | Not enough permission and/or machine code not found. | ### Increment Int Value URL: `https://app.cryptolens.io/docs/api/v3/IncrementIntValue` Summary: This method will increment the integer value in a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) by a certain constant (non-negative). You can always [decrement](https://app.cryptolens.io/docs/api/v3/DecrementIntValue) it. Note, this method does... This method will increment the integer value in a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) by a certain constant (non-negative). You can always [decrement](https://app.cryptolens.io/docs/api/v3/DecrementIntValue) it. Note, this method does not allow integer overflows, i.e. if you increment by a constant that would result in an overflow, an error will be thrown. Note also that you can use the **Feature lock** in the [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) to specify the upper bound of the increment constant. So, if you only want to allow incrementing by **1**, please set **Feature lock** field to **1** also. Please see [Remarks](https://app.cryptolens.io/docs/api/v3/IncrementIntValue#remarks) for more details (including access token set up). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/IncrementIntValue](https://api.cryptolens.io/api/data/IncrementIntValue) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The unique object id for the data object. | required | | IntValue | The constant int (non-negative) value that should be added to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **1**, then the new **IntValue** will be the old one plus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify an upper bound. For example, if you set the **Bound** parameter (below) to 10, you will be able to increment the int value until you reach ten (inclusive). Once the upper bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the upper bound that will be enforced on the increment operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/IncrementIntValueToKey](https://api.cryptolens.io/api/data/IncrementIntValueToKey) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Id | The unique object id for the data object. | required | | IntValue | The constant int (non-negative) value that should be added to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **1**, then the new **IntValue** will be the old one plus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify an upper bound. For example, if you set the **Bound** parameter (below) to 10, you will be able to increment the int value until you reach ten (inclusive). Once the upper bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the upper bound that will be enforced on the increment operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Name | The name of the data object. | required | | IntValue | The constant int (non-negative) value that should be added to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **1**, then the new **IntValue** will be the old one plus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify an upper bound. For example, if you set the **Bound** parameter (below) to 10, you will be able to increment the int value until you reach ten (inclusive). Once the upper bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the upper bound that will be enforced on the increment operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/IncrementIntValueToMachineCode](https://api.cryptolens.io/api/data/IncrementIntValueToMachineCode) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Id | The unique object id for the data object. | required | | IntValue | The constant int (non-negative) value that should be added to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **1**, then the new **IntValue** will be the old one plus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify an upper bound. For example, if you set the **Bound** parameter (below) to 10, you will be able to increment the int value until you reach ten (inclusive). Once the upper bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the upper bound that will be enforced on the increment operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Name | The name of the data object. | required | | IntValue | The constant int (non-negative) value that should be added to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **1**, then the new **IntValue** will be the old one plus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify an upper bound. For example, if you set the **Bound** parameter (below) to 10, you will be able to increment the int value until you reach ten (inclusive). Once the upper bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the upper bound that will be enforced on the increment operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Remarks - The sign of the **IntValue** (incrementing constant) parameter will not be taken into account, i.e. **-5** is treated as **5**. - Integer overflows are not allowed. If you attempt to increment by constant that would result in an integer overflow, an error will be thrown and no changes are going to be made. - **Feature lock** in [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) can be used as a way to specify the upper bound for the **IntValue** (incrementing constant). If **Feature lock** is **not 0**, the value of the **Feature lock** will function as an upper bound. So, if you only want to allow incrementing by **1**, please set **Feature lock** to **1** - The **EnableBound** option allows you to specify an upper bound for the increment operation. That is, if you want to force this method to stop at 10 (eg. allow a certain feature to be used 10 times), you can specify the **Bound** to be 10. In this case, when the int value reaches 10, it will no longer be possible to increment the int value. This condition is temporal, i.e. by modifying the upper bound parameter, you can achieve a different upper bound. - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | The increment/decrement value not allowed by security settings. | | Cannot increment/decrement value since the limit was reached for an int32. | | Not enough permission and/or machine code not found. | ### Decrement Int Value URL: `https://app.cryptolens.io/docs/api/v3/DecrementIntValue` Summary: This method will decrement the integer value in a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) by a certain constant (non-negative). You can always [increment](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) it. Note, this method does... This method will decrement the integer value in a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) by a certain constant (non-negative). You can always [increment](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) it. Note, this method does not allow integer overflows, i.e. if you decrement by a constant that would result in an overflow, an error will be thrown. Note also that you can use the **Feature lock** in the [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) to specify the upper bound of the decrement constant. So, if you only want to allow decrementing by **1**, please set **Feature lock** field to **1** also. Please see [Remarks](https://app.cryptolens.io/docs/api/v3/DecrementIntValue#remarks) for more details (including access token setup). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/DecrementIntValue](https://api.cryptolens.io/api/data/DecrementIntValue) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The unique object id for the data object. | required | | IntValue | The constant int value that should be subtracted to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **11**, then the new **IntValue** will be the old one minus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify a lower bound. For example, if you set the **Bound** parameter (below) to 0, you will be able to decrement the int value until you reach zero (inclusive). Once the lower bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the lower bound that will be enforced on the decrement operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/DecrementIntValueToKey](https://api.cryptolens.io/api/data/DecrementIntValueToKey) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Id | The unique object id for the data object. | required | | IntValue | The constant int value that should be subtracted to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **11**, then the new **IntValue** will be the old one minus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify a lower bound. For example, if you set the **Bound** parameter (below) to 0, you will be able to decrement the int value until you reach zero (inclusive). Once the lower bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the lower bound that will be enforced on the decrement operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Name | The name of the data object. | required | | IntValue | The constant int value that should be subtracted to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **11**, then the new **IntValue** will be the old one minus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify a lower bound. For example, if you set the **Bound** parameter (below) to 0, you will be able to decrement the int value until you reach zero (inclusive). Once the lower bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the lower bound that will be enforced on the decrement operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/DecrementIntValueToMachineCode](https://api.cryptolens.io/api/data/DecrementIntValueToMachineCode) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Id | The unique object id for the data object. | required | | IntValue | The constant int value that should be subtracted to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **11**, then the new **IntValue** will be the old one minus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify a lower bound. For example, if you set the **Bound** parameter (below) to 0, you will be able to decrement the int value until you reach zero (inclusive). Once the lower bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the lower bound that will be enforced on the decrement operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Name | The name of the data object. | required | | IntValue | The constant int value that should be subtracted to the current IntValue of the data object. For example, if this value is set to **5** and the old **IntValue** is **11**, then the new **IntValue** will be the old one minus **5**, i.e. **6**. Note, if you would set this value to **-5** instead, the same result would be achieved. | optional, 0 by default. | | EnableBound | If set to **true**, it will be possible to specify a lower bound. For example, if you set the **Bound** parameter (below) to 0, you will be able to decrement the int value until you reach zero (inclusive). Once the lower bound is reached, an error will be thrown. | optional, false by default. | | Bound | This is the lower bound that will be enforced on the decrement operation. It will only be enforced if **EnableBound** is set to **true**. Please read the description above. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Remarks - The sign of the **IntValue** (decrementing constant) parameter will not be taken into account, i.e. **-5** is treated as **5**. - Integer overflows are not allowed. If you attempt to decrement by constant that would result in an integer overflow, an error will be thrown and no changes are going to be made. - **Feature lock** in [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) can be used as a way to specify the upper bound for the **IntValue** (decrementing constant). If **Feature lock** is **not 0**, the value of the **Feature lock** will function as an upper bound. So, if you only want to allow decrementing by **1**, please set **Feature lock** to **1** - The **EnableBound** option allows you to specify a lower bound for the decrement operation. That is, if you want to force this method to stop at zero (eg. allow only positive values), you can specify the **Bound** to be 0. In this case, when the int value reaches zero, it will no longer be possible to decrement the int value. This condition is temporal, i.e. by modifying the lower bound parameter, you can achieve a different lower bound. - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | The increment/decrement value not allowed by security settings. | | Cannot increment/decrement value since the limit was reached for an int32. | | Not enough permission and/or machine code not found. | ### Set String Value URL: `https://app.cryptolens.io/docs/api/v3/SetStringValue` Summary: This method will assign a new string value to a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/SetStringValue#remarks). This method will assign a new string value to a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/SetStringValue#remarks). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/SetStringValue](https://api.cryptolens.io/api/data/SetStringValue) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The unique object id for the data object. | required | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/SetStringValueToKey](https://api.cryptolens.io/api/data/SetStringValueToKey) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Id | The unique object id for the data object. | required | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Name | The name of the data object. | required | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/SetStringValueToMachineCode](https://api.cryptolens.io/api/data/SetStringValueToMachineCode) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Id | The unique object id for the data object. | required | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Name | The name of the data object. | required | | StringValue | A string value (text) to store. Max 10000 characters. | optional, null by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Remarks - The new **StringValue** may not be longer than 10000 characters in length. If it is, an error will be thrown. - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | The 'StringValue' should have the size of max 10000 chars. | | Not enough permission and/or machine code not found. | ### Set Int Value URL: `https://app.cryptolens.io/docs/api/v3/SetIntValue` Summary: This method will assign a new integer value to a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). Note, you can also [increment](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) or [decrement](https://app.cryptolens.io/docs/api/v3/DecrementIntValue) the integer... This method will assign a new integer value to a [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). Note, you can also [increment](https://app.cryptolens.io/docs/api/v3/IncrementIntValue) or [decrement](https://app.cryptolens.io/docs/api/v3/DecrementIntValue) the integer value. Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/SetIntValue#remarks). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/SetIntValue](https://api.cryptolens.io/api/data/SetIntValue) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The unique object id for the data object. | required | | IntValue | The new int value that should be assigned to the data object. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/SetIntValueToKey](https://api.cryptolens.io/api/data/SetIntValueToKey) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Id | The unique object id for the data object. | required | | IntValue | The new int value that should be assigned to the data object. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Name | The name of the data object. | required | | IntValue | The new int value that should be assigned to the data object. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/SetIntValueToMachineCode](https://api.cryptolens.io/api/data/SetIntValueToMachineCode) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Id | The unique object id for the data object. | required | | IntValue | The new int value that should be assigned to the data object. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | MachineCode | the machine code | required | | Name | The name of the data object. | required | | IntValue | The new int value that should be assigned to the data object. | optional, 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Remarks - Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's **IntValue**. - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | Not enough permission and/or machine code not found. | ### Upload Values URL: `https://app.cryptolens.io/docs/api/v3/UploadValues` Summary: This method will extract content from a Cryptolens log (used in offline licensing) and update existing data objects (either by incrementing or decrementing them). To call this method, you either need an "Increment Int... This method will extract content from a Cryptolens log (used in offline licensing) and update existing data objects (either by incrementing or decrementing them). To call this method, you either need an "Increment Int Value" and/or "Decrement Int Value" permission, depending on if the log that you submit increases or decreases an int value of a data object. **Note:** for the time being, the limit of the number of entries in the log is 1000. This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 2 (key specific):** [https://api.cryptolens.io/api/data/UploadValuesToKey](https://api.cryptolens.io/api/data/UploadValuesToKey) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Id | The unique object id for the data object. | required | | Data | The file (in base 64) created by a Cryptolens SDK that has recorded data object usage. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Remarks - Integer overflows are not allowed. If you attempt to increment by constant that would result in an integer overflow, an error will be thrown and no changes are going to be made. - **Feature lock** in [Access Token](https://app.cryptolens.io/docs/api/v3/Auth) can be used as a way to specify the upper bound for the **IntValue** (incrementing constant). If **Feature lock** is **not 0**, the value of the **Feature lock** will function as an upper bound. So, if you only want to allow incrementing by **1**, please set **Feature lock** to **1** - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). We recommend to set the **KeyLock** to **-1** when creating the access token. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Data parameter was empty. | | Data parameter was corrupted. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | The increment/decrement value not allowed by security settings. | | Cannot increment/decrement value since the limit was reached for an int32. | ### Remove Data Object URL: `https://app.cryptolens.io/docs/api/v3/RemoveDataObject` Summary: This method will remove an existing [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/RemoveDataObject#remarks). This method will remove an existing [Data Object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). Please read more about access tokens in [Remarks](https://app.cryptolens.io/docs/api/v3/RemoveDataObject#remarks). This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (general):** [https://api.cryptolens.io/api/data/RemoveDataObject](https://api.cryptolens.io/api/data/RemoveDataObject) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The unique object id for the data object. | required | | v | Method version. | optional. by default, it's 1. | **Method 2 (key specific):** [https://api.cryptolens.io/api/data/RemoveDataObjectToKey](https://api.cryptolens.io/api/data/RemoveDataObjectToKey) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Id | The unique object id for the data object. | required | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Name | The name of the data object. | required | | v | Method version. | optional. by default, it's 1. | **Method 3 (machine code specific):** [https://api.cryptolens.io/api/data/RemoveDataObjectToMachineCode](https://api.cryptolens.io/api/data/RemoveDataObjectToMachineCode) There are two ways to call this method: | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Machine code | the machine code | required | | Id | The unique object id for the data object. | required | | v | Method version. | optional. by default, it's 1. | | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Machine code | the machine code | required | | Name | The name of the data object. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Remarks - When accessing the key specific methods (using productId and the key string), you need to either disable key lock (set it to zero) or set it to a negative number, in the same way you would have done if you would have used [KeyLock](https://app.cryptolens.io/docs/api/v3/KeyLock). ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Not enough permission. | | Not enough permission and/or product not found. | | Not enough permission and/or key not found. | | Incorrect 'ReferencerType'. It can either be 0 (for a User), 1 (for a Product) and 2 (for a Key). | | Not enough permission and/or machine code not found. | ## Product Methods ### Product URL: `https://app.cryptolens.io/docs/api/v3/Product` Summary: These are all the methods for product related tasks. ### Methods These are all the methods for product related tasks. - [Get Keys](https://app.cryptolens.io/docs/api/v3/GetKeys) - [Get Products](https://app.cryptolens.io/docs/api/v3/GetProducts) ### Get Products URL: `https://app.cryptolens.io/docs/api/v3/GetProducts` Summary: This method will return the list of [products](https://app.cryptolens.io/docs/api/v3/model/Product). This method will return the list of [products](https://app.cryptolens.io/docs/api/v3/model/Product). This method is accessed by [https://api.cryptolens.io/api/product/GetProducts](https://api.cryptolens.io/api/product/GetProducts) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Products | A list of [Product](https://app.cryptolens.io/docs/api/v3/model/Product) objects. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"products":[{"id":1234,"name":"Example product","creationDate":"2014-01-02T00:00:00","description":"Description","password":"","isPublic":true,"keyAlgorithm":1,"featureDefinitions":{"f1":{"name":"Time Limit (F1)","type":1},"f2":{"name":"Trial (F2)","type":2},"f3":{"name":"Feature 3","type":0},"f4":{"name":"Feature 4","type":0},"f5":{"name":"Feature 5","type":0},"f6":{"name":"Feature 6","type":0},"f7":{"name":"Feature 7","type":0},"f8":{"name":"Feature 8","type":0},"allLicensesTimeLimited":false,"blockExpiredLicenses":false},"dataObjects":[]}],"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | ## Auth Methods ### Auth Methods URL: `https://app.cryptolens.io/docs/api/v3/AuthMethods` Summary: Methods listed in this category are primarily intended for security features in the [Web API 3](https://app.cryptolens.io/docs/api/v3/). Methods listed in this category are primarily intended for security features in the [Web API 3](https://app.cryptolens.io/docs/api/v3/). ### Methods These methods are related to authentication/authorization. - [Key Lock](https://app.cryptolens.io/docs/api/v3/KeyLock) - *generates an access token restricted to a Key (and returns the key Id given key string).* ### Help Here are some links that are useful: - [Introduction to Access Tokens](https://app.cryptolens.io/docs/api/v3/Auth) - *gives you a general idea of how authentication with access tokens works.* - [Web API Workflows](https://help.cryptolens.io/web-api/index) - *describes, in details, three workflow examples depending on the environment of your application.* ### Key Lock URL: `https://app.cryptolens.io/docs/api/v3/KeyLock` Summary: This method will, given a license key, generate a new [access token](https://app.cryptolens.io/docs/api/v3/Auth) that is locked to that particular key and return the Id of that key. The scope of the [access token](https://app.cryptolens.io/docs/api/v3/Auth) is preserved... This method will, given a license key, generate a new [access token](https://app.cryptolens.io/docs/api/v3/Auth) that is locked to that particular key and return the Id of that key. The scope of the [access token](https://app.cryptolens.io/docs/api/v3/Auth) is preserved (i.e. all methods that were enabled in the access token used to access this method will be copied to the new access token) except for the key lock, which is going to be changed to the id of the license key. Note, for this method to work, the access token used to access this method has to have key lock set to **-1** or smaller. All of these details are described in [Remarks](https://app.cryptolens.io/docs/api/v3/KeyLock#remarks). This method is accessed by [https://api.cryptolens.io/api/auth/KeyLock](https://api.cryptolens.io/api/auth/KeyLock) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | KeyId | The id of the license key (i.e. not the key string). | always returned | | Token | The new [Access Token](https://app.cryptolens.io/docs/api/v3/Auth). | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"keyId":1005,"token":"WyIxOCIsIldGQlkyOHhXV2wrQkJaQVNaanJFV1pHdzZwVzZJQTVNK3M0UlphMFkiXQ==","result":0,"message":null} ``` ### Remarks - The [access token](https://app.cryptolens.io/docs/api/v3/Auth) has to have the **Key Lock** set to **-1** or smaller for this method to work. - This method does not require any explicit permission. If the **Key Lock** set to **-1** or smaller this method will be enabled. - The new [access token](https://app.cryptolens.io/docs/api/v3/Auth) will have the same permission on the methods. Only the **Key Lock** will be changed from being **-1** to the **KeyId** of the given key (in the input parameters). - The [access token](https://app.cryptolens.io/docs/api/v3/Auth) cannot be retrieved after generation. Please make sure to store it inside the app to avoid generating a new access token. - The value of the KeyLock specifies the expiration date of the new access token, i.e. **-1** will set the expiration to **1 day** from the time the access token was generated. Similarly, setting it to **-2** will set the expiration date **2 days** from the time of the request. ### Errors | **Error** | | --- | | The Key Lock has to be set to '-1' for this method to work. | | Could not find the product. | | Could not find the key. | ### Get Token (beta) URL: `https://app.cryptolens.io/docs/api/v3/GetToken` Summary: Get Token permission allows you to create access tokens on behalf of the authorizing user. This can be used to create plugins or to achieve user login authentication (for licensing). It gives you access to a range of... Get Token permission allows you to create access tokens on behalf of the authorizing user. This can be used to create plugins or to achieve user login authentication (for licensing). It gives you access to a range of methods: AuthorizeApp (in some cases, token is needed), GetChallenge and GetToken methods. ### General The idea behind the way your application can receive a token from an SKM user contains three parties: - **Vendor** - the vendor who develops the application. - **App** - the instance of your application that attempts to retrieve the token. - **User** - the person who will authorize the app to create a token on their behalf. All of the parties above have different responsibilities. #### Vendor The vendor should create a token with GetToken permission (aka parent token). This is used to authorize the app to create authorization requests on their behalf. Apart from this, the vendor has the ability to customize the properties of the generated tokens (aka child tokens). For example, the **key lock** parameter can be used to set an upper bound for how long the new token will be valid. Although it's better to set it to a longer date (say 30 to 60 days), there may be cases when you want to have a shorter time span. From the perspective of the vendor, there are no major security concerns. The user, on the other hand, would benefit from having a shorter time span, since they can control who can access their keys (and other data). You should always, despite the scope of the token, treat the new access token as a password and store it in a secure location. The user has entrusted you to do so. #### App The app is responsible to create an authorization request (that the user has to accept) and later solve a challenge provided by SKM to get a new token. The app will never see the actual user name and password if configured properly, and the only thing it knows is the new access token authorized by the user. In this way, the user can always remove the access token, which would require a new authorization request. The should generate a new **RSA 2048** key pair for each authorization request (it could be done fewer times, but then it's important to keep the keys in a safe place). Only the public key should be sent to SKM; the private key will be used to solve the challenge. #### User The user is the one who lets the app to access the license keys (just an example) without exposing the credentials to the vendor nor the app. The app will only posses an access token that belongs to the user and the user can always block the access if desired. ### Plug-ins If your app requires access to certain methods that belong to the user, you can ask the user to authorize this as described above. ### User Login Auth User login authentication mechanism is very similar to the plug-in example. The only difference is that we also keep track of machine codes. When you initiate an authorization request, you will specifically ask the user to authorize their device. This helps you to keep track of how many devices they are running on and you can always specify the limit by editing their customer profile. Note, in contrast to the general case, user login auth requires you to have an active association between the customer (in the control panel) and an existing customer in SKM. Another unique feature of user login auth is that you can control some methods as a vendor. For example, **GetLicenseKeys** method will look at the parent token's **feature lock** to determine how much information should be shown for each license key. To obtain this value, please use [the following](https://app.cryptolens.io/docs/api/v3/Activate#LicenseKey) tool. You can also use **product lock** in the same way you would normally use it. ## User Methods ### User authentication URL: `https://app.cryptolens.io/docs/api/v3/UserAuth` Summary: The idea behind user authentication is to allow you to authenticate users using their credentials (i.e. username and password) to verify their license. You can use their username and password to retrieve their licenses... ### Introduction The idea behind user authentication is to allow you to authenticate users using their credentials (i.e. username and password) to verify their license. You can use their username and password to retrieve their licenses instead of asking for a license key. This is similar to obtaining all licenses assigned to a customer using [customer secret](https://help.cryptolens.io/web-interface/customer-secret), with the difference that the user can pick both the username and password, as well as restore a forgotten password. ### Methods - [Login](https://app.cryptolens.io/docs/api/v3/Login) - retrieves all licenses that belong to the user. - [Register](https://app.cryptolens.io/docs/api/v3/Register) - creates a new user and optionally assigns them to a customer object (that contains all their licenses). - [Associate](https://app.cryptolens.io/docs/api/v3/Associate) - associates a user with a customer object. - [Dissociate](https://app.cryptolens.io/docs/api/v3/Dissociate) - dissociates a user from a customer object. - [Get Users](https://app.cryptolens.io/docs/api/v3/GetUsers) - lists all users. - [Change Password](https://app.cryptolens.io/docs/api/v3/ChangePassword) - changes password of a user. - [Reset Password Token](https://app.cryptolens.io/docs/api/v3/ResetPasswordToken) - generates a password reset token. - [Remove User](https://app.cryptolens.io/docs/api/v3/RemoveUser) - removes a user. ### Login URL: `https://app.cryptolens.io/docs/api/v3/Login` Summary: This method will return all licenses that belong to the user. This method can be called with an access token that has UserAuthNormal and UserAuthAdmin permission. This method will return all licenses that belong to the user. This method can be called with an access token that has UserAuthNormal and UserAuthAdmin permission. This method is accessed by [https://api.cryptolens.io/api/userauth/Login](https://api.cryptolens.io/api/userauth/Login) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username | required | | Password | The password | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | LicenseKeys | The list of [license keys](https://app.cryptolens.io/docs/api/v3/model/BasicLicenseKey) that belong to the user. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Unable to authenticate user. | | No username or password supplied. | ### Register URL: `https://app.cryptolens.io/docs/api/v3/Register` Summary: This method will register a new user. Please note that calling this method requires a UserAuthAdmin token. This method will register a new user. Please note that calling this method requires a UserAuthAdmin token. This method is accessed by [https://api.cryptolens.io/api/userauth/Register](https://api.cryptolens.io/api/userauth/Register) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username | required | | Password | The password | required | | CustomerId | The customer id | optional | | Email | The email | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | No username or password supplied. | | Username already exists. Please pick a different one. | | Customer not found. | ### Associate URL: `https://app.cryptolens.io/docs/api/v3/Associate` Summary: Associates a user with a [customer object](https://app.cryptolens.io/docs/api/v3/model/Customer). Please note that calling this method requires a UserAuthAdmin token. Associates a user with a [customer object](https://app.cryptolens.io/docs/api/v3/model/Customer). Please note that calling this method requires a UserAuthAdmin token. This method is accessed by [https://api.cryptolens.io/api/userauth/Associate](https://api.cryptolens.io/api/userauth/Associate) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username | required | | CustomerId | The customer id | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Username does not exist. | | Customer not found. | ### Dissociate URL: `https://app.cryptolens.io/docs/api/v3/Dissociate` Summary: Dissociates a user from a customer [customer object](https://app.cryptolens.io/docs/api/v3/model/Customer). Please note that calling this method requires a UserAuthAdmin token. Dissociates a user from a customer [customer object](https://app.cryptolens.io/docs/api/v3/model/Customer). Please note that calling this method requires a UserAuthAdmin token. This method is accessed by [https://api.cryptolens.io/api/userauth/Dissociate](https://api.cryptolens.io/api/userauth/Dissociate) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Username does not exist. | ### Get Users URL: `https://app.cryptolens.io/docs/api/v3/GetUsers` Summary: List all registered users. Please note that calling this method requires a UserAuthAdmin token. List all registered users. Please note that calling this method requires a UserAuthAdmin token. This method is accessed by [https://api.cryptolens.io/api/userauth/GetUsers](https://api.cryptolens.io/api/userauth/GetUsers) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | CustomerId | The customer Id. | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Users | The list of [User](https://app.cryptolens.io/docs/api/v3/model/User) objects. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | ### Change Password URL: `https://app.cryptolens.io/docs/api/v3/ChangePassword` Summary: This method will change the password of a user. It supports 3 modes of operation. With an access token that has UserAuthNormal permission (i.e. without admin permission), the password can either be changed by providing... This method will change the password of a user. It supports 3 modes of operation. With an access token that has UserAuthNormal permission (i.e. without admin permission), the password can either be changed by providing the old password or a password reset token, which can be generated using [Reset Password Token](https://app.cryptolens.io/docs/api/v3/ResetPasswordToken) method. Finally, if you call this method with an access token that has UserAuthAdmin permission, it will allow you to set AdminMode to True and only provide the NewPassword. This method is accessed by [https://api.cryptolens.io/api/userauth/ChangePassword](https://api.cryptolens.io/api/userauth/ChangePassword) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username. | required | | OldPassword | The old password if available. | optional | | NewPassword | The new password. | required | | PasswordResetToken | The password reset token. | optional | | AdminMode | A boolean that allows you to enable the admin mode. | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | No username or password supplied. | | Could not update the password. | ### Reset Password Token URL: `https://app.cryptolens.io/docs/api/v3/ResetPasswordToken` Summary: This method allows you to retrieve the password reset token that you can use when calling [Change Password](https://app.cryptolens.io/docs/api/v3/ChangePassword) method. Please note that calling this method requires a UserAuthAdmin token. This method allows you to retrieve the password reset token that you can use when calling [Change Password](https://app.cryptolens.io/docs/api/v3/ChangePassword) method. Please note that calling this method requires a UserAuthAdmin token. This method is accessed by [https://api.cryptolens.io/api/userauth/ResetPasswordToken](https://api.cryptolens.io/api/userauth/ResetPasswordToken) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | PasswordResetToken | The password reset token. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | No username supplied. | | Could not generate the password reset token. | ### Remove User URL: `https://app.cryptolens.io/docs/api/v3/RemoveUser` Summary: This method removes a user. Please note that calling this method requires a UserAuthAdmin token. This method removes a user. Please note that calling this method requires a UserAuthAdmin token. This method is accessed by [https://api.cryptolens.io/api/userauth/RemoveUser](https://api.cryptolens.io/api/userauth/RemoveUser) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | No username supplied. | | The user could not be found. | ## Analytics Methods ### Analytics URL: `https://app.cryptolens.io/docs/api/v3/AI` Summary: These are all the methods that can be used to collect usage information of your application, which is then analysed using Cryptolens AI engine. ### Methods #### Events These are all the methods that can be used to collect usage information of your application, which is then analysed using Cryptolens AI engine. - [Register Event](https://app.cryptolens.io/docs/api/v3/RegisterEvent) - [Get Events](https://app.cryptolens.io/docs/api/v3/GetEvents) #### Object Log These methods are related to events that are created when certain objects are created, edited or removed. - [Get Object Log](https://app.cryptolens.io/docs/api/v3/GetObjectLog) #### Web API Log These methods are related to events that are created each time a license changes (eg. activation or change of expiration date). Data object changes are also logged in this log. Note, this log contians mininmal information about the event. - [Get Web API Log](https://app.cryptolens.io/docs/api/v3/GetWebAPILog) ### Register Event URL: `https://app.cryptolens.io/docs/api/v3/RegisterEvent` Summary: This method will register an event that has occurred in either the client app (eg. start of a certain feature or interaction within a feature) or in a third party provider (eg. a payment has occurred, etc). Events are... This method will register an event that has occurred in either the client app (eg. start of a certain feature or interaction within a feature) or in a third party provider (eg. a payment has occurred, etc). Events are stored for at least 30 days. Older events may be removed. **Note**: You can either use this method standalone (eg. by only providing a machine code/device identifier) or together with Cryptolens Licensing module (which requires productId and optionally keyid to be set). The more information that is provided, the better insights can be provided. This method is accessed in several ways. Each way works in the same way and requires the same permission. The only difference is the type of parameters. Both cases are listed below: ### Parameters **Method 1 (register only one event):** [https://api.cryptolens.io/api/ai/RegisterEvent](https://api.cryptolens.io/api/ai/RegisterEvent) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | The product id (=**[ProductId] **) | conditionally optional (only required if you specify a key below) | | Key | The serial key string. | optional | | MachineCode | The machine code or any other identifier of the device/user (especially if no product and key is given). | Optional (but very useful to help us to destinguish unique users) | | FeatureName | The name of the feature, eg. 'VideoRecorder' or 'F1'. Can be any string of max 100 chars in length. | optional | | EventName | The name of the event, eg. 'click' or 'start'. Can be any string of max 100 chars in length. | optional | | Value | The value of the event, eg. if this event lead to a transaction, you can enter its value here (as an int, 25.3 should be entered as 2530). In this case, you can, for instance, set EventName to 'purchase', or anything similar. | optional | | Currency | The currency, eg USD. Useful if this event has a certain value. | optional | | Metadata | Additional metadata as JSON string related to this event. Be careful and do not send personal identifiable information unless it is really needed. Please read more ">here. | optional | | v | Method version. | optional. by default, it's 1. | **Method 2 (register multiple event):** [https://api.cryptolens.io/api/ai/RegisterEvents](https://api.cryptolens.io/api/ai/RegisterEvents) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | The product id (=**[ProductId] **) | conditionally optional (only required if you specify a key below) | | Key | The serial key string | optional | | MachineCode | The machine code or any other identifier of the device/user (especially if no product and key is given). | Optional (but very useful to help us to destinguish unique users) | | Events | A JSON list containing objects with fields **FeatureName**, **EventName**, **Value**, **Currency**, **Time** (unix timestamp) and **Metadata** (a JSON string). If no time is specified in one of the objects, the current time will be used. Other objects will fallback to a default value, in case they are missing. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, either **Changed** or **Not changed** will be returned (i.e. if the key was already blocked, **Not changed** is returned.) Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | Events string is not correctly formatted json string. | ### Get Events URL: `https://app.cryptolens.io/docs/api/v3/GetEvents` Summary: This method will retrieve events that were registered using [Register event](https://app.cryptolens.io/docs/api/v3/RegisterEvent) method. Events are stored for at least 30 days. Older events may be removed. This method will retrieve events that were registered using [Register event](https://app.cryptolens.io/docs/api/v3/RegisterEvent) method. Events are stored for at least 30 days. Older events may be removed. ### Parameters This method is accessed by [https://api.cryptolens.io/api/ai/GetEvents](https://api.cryptolens.io/api/ai/GetEvents) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Limit | Specifies how many events should be returned. | default is 10 and at most 100 | | StartingAfter | Works as a cursor (for pagination). If the last element had the id=125, then setting this to 125 will return all events coming after 125. | optional | | EndingBefore | Works as a cursor (for pagination). If the last element had the id=125, then setting this to 125 will return all events coming before 125. | optional | | Time | The time value to filter the events on. This can either be a Unix timestamp or a dictionary with the following properties: **gte** - returns events where "Time" is greater than or equal to this value. **gt** - returns events where "Time" is greater than this value. **lte** - returns events where "Time" is less than or equal to this value. **lt** - returns events where "Time" is less than this value. For example, if you call this method with a GET request, you could set it to {"gte":1534407953,"lte":1534422362} to filter between events created at 1534407953 and 1534422362. | optional | | ProductId | The product id to filter on. | optional | | Key | The key string to filter on. Note: to filter on a license key, you need to specify the ProductId parameter. | optional | | Metadata | The metadata string to filter on. | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Events | A list of [Event Objects](https://app.cryptolens.io/docs/api/v3/model/EventObject). | returned if no errors are thrown | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The 'Time' parameter has the wrong format. | ### Get Object Log URL: `https://app.cryptolens.io/docs/api/v3/GetObjectLog` Summary: This method will retrieve a list of [Object Logs](https://app.cryptolens.io/docs/api/v3/model/ObjectLog). These are events that are created when certain object types are added or modified to allow you to track all changes made by you and your... This method will retrieve a list of [Object Logs](https://app.cryptolens.io/docs/api/v3/model/ObjectLog). These are events that are created when certain object types are added or modified to allow you to track all changes made by you and your resellers. They are guaranteed to exist for 30 days. Older events may be removed. ### Parameters This method is accessed by [https://api.cryptolens.io/api/ai/GetObjectLog](https://api.cryptolens.io/api/ai/GetObjectLog) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Limit | Specifies how many events should be returned. | default is 10 and at most 100 | | StartingAfter | Works as a cursor (for pagination). If the last element had the id=125, then setting this to 125 will return all events coming after 125. | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Events | A list of [Object Log Objects](https://app.cryptolens.io/docs/api/v3/model/ObjectLog). | returned if no errors are thrown | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | ### Get Web API Log URL: `https://app.cryptolens.io/docs/api/v3/GetWebAPILog` Summary: This method will retrieve a list of [Web API Logs](https://app.cryptolens.io/docs/api/v3/model/WebAPILog). All events that get logged are related to a change of a license key or data object, eg. when license key gets activated or when a property... This method will retrieve a list of [Web API Logs](https://app.cryptolens.io/docs/api/v3/model/WebAPILog). All events that get logged are related to a change of a license key or data object, eg. when license key gets activated or when a property of data object changes. More details about the method that was called are specified in the **State** field. You can read more about it [here](https://app.cryptolens.io/docs/api/v3/model/WebAPILog). These logs contain minimal information but are guaranteed to be preserved. To get more information, especially about changes not tracked in this log, please check out the [Object Log](https://app.cryptolens.io/docs/api/v3/GetObjectLog). Note, it's possible to restrict access to this method so that it can be used inside a client application, more about this in [remarks](https://app.cryptolens.io/docs/api/v3/GetWebAPILog#remarks). ### Parameters This method is accessed by [https://api.cryptolens.io/api/ai/GetWebAPILog](https://api.cryptolens.io/api/ai/GetWebAPILog) | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | The product id that we should filter on. | optional | | Key | The key string that we should filter on. | optional, but requires **ProductId** to be specified. | | MachineCode | The machine code to filter on. Requires the entire machine code to be specified. Case sensitive. | optional | | FriendlyName | The friendly name to filter on. "Contains" operation is used, i.e. you do not need to specify the entire friendly name. Case insensitive. | optional | | States | The list of integer values representing the state that you want to filter on. This allows you to extract logs related to a certain event. For example, if you want to see all *CreateKey* request, you can set this parameter to **[3010]**. If you need to filter on multiple events, you can add them to the list as follows: **[3010,2010]**. You can read more about the different states [here](https://app.cryptolens.io/docs/api/v3/model/WebAPILog#state-codes). | optional | | Time | Allows you to filter based on the time of the request. It accepts a JSON string with the following properties: **gt** - greater than **gte** - greater than or equal **lt** - less than **lte** - less than or equal The time is formatted as a Unix timestamp. For example, Time can be set to **{"gt":1742208215}**. You can also include other "lt" or other properties to narrow down the interval. | optional | | Limit | Specifies how many events should be returned. | default is 10 and at most 1000 | | StartingAfter | Works as a cursor (for pagination). If the last element had the id=125, then setting this to 125 will return all events coming after 125. **If you use the time filter, this value should be set to unix timestamp of the request.** | optional | | EndingBefore | Works as a cursor (for pagination). If the last element had the id=125, then setting this to 125 will return all events coming before 125. **If you use the time filter, this value should be set to unix timestamp of the request.** | optional | | OrderBy | Allows you to order the data based on either the Id or Time. We recommend that you use StartingAfter and EndingBefore instead, since it will perform automatic ordering. By default, it will order in "ascending" mode (unless EndingBefore is specified, in which case it will be set to Id descending). To change that, you can append "descending" to the field. For example, to order by Id in a descending order, you can set this variable to **Id descending**. When time filter is applied, automatic order by on Time will be applied. | optional **(depricated)** | | AnomalyClassification | If enabled, the result will contain information about whether a certain request is anomalous. You can read more about this feature [here](https://help.cryptolens.io/web-interface/anomaly-detection). | optional, false by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Logs | A list of [Web API Log Objects](https://app.cryptolens.io/docs/api/v3/model/WebAPILog). If **AnomalyClassification** is set to true, a list of [Web API Log Objects (extended)](https://app.cryptolens.io/docs/api/v3/model/WebAPILog) will be returned instead. | returned if no errors are thrown | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. If it's a successful result, **null** will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. | ### Example results ```text {"result":0,"message":""} ``` ### Remarks - If you set **KeyLock=-1** when creating the access token, this method will require the product id together with the license key string. This can be used to retrieve logs inside a client application without exposing logs of other license keys. ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | An error occured. | ## Message Methods ### Message API URL: `https://app.cryptolens.io/docs/api/v3/Message` Summary: These are all the methods for creating and broadcasting messages. You can read more about how they can be used [here](https://help.cryptolens.io/messaging/index). ### Methods These are all the methods for creating and broadcasting messages. You can read more about how they can be used [here](https://help.cryptolens.io/messaging/index). - [Create Message](https://app.cryptolens.io/docs/api/v3/CreateMessage) - [Remove Message](https://app.cryptolens.io/docs/api/v3/RemoveMessage) - [Get Messages](https://app.cryptolens.io/docs/api/v3/GetMessages) ### Create Message URL: `https://app.cryptolens.io/docs/api/v3/CreateMessage` Summary: This method will create a new message (which you can also manage [here](https://app.cryptolens.io/Message)). This method will create a new message (which you can also manage [here](https://app.cryptolens.io/Message)). This method requires **Edit Messages** permission. This method is accessed by [https://api.cryptolens.io/api/message/CreateMessage](https://api.cryptolens.io/api/message/CreateMessage) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Channel | Specifies the channel of the message. | optional | | Content | The message content. For example, this can be a message about an update or a link to download the new version. Please check out [this](https://help.cryptolens.io/messaging/index) article for more ideas. | optional | | Time | The format is unix timestamp. If no time is specified, we will set it to the time when this message was sent. | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | MessageId | The id of the message that was created. | required | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The timestamp in the Time parameter does not have the correct format. | ### Get Messages URL: `https://app.cryptolens.io/docs/api/v3/GetMessages` Summary: This method will return a list of messages that were broadcasted. You can create new messages [here](https://app.cryptolens.io/Message). Messages can be filtered based on the time and the channel. This method will return a list of messages that were broadcasted. You can create new messages [here](https://app.cryptolens.io/Message). Messages can be filtered based on the time and the channel. This method is accessed by [https://api.cryptolens.io/api/message/GetMessages](https://api.cryptolens.io/api/message/GetMessages) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Channel | Specifies the channel, whose messages you would like to retrieve. If not set, messages from all channels will be returned. | optional | | Time | Allows you to retrieve only those messages that were created after a certain **Time** (strictly greater than), eg. the last time you contacted the server. The format is unix timestamp. If no time is specified, all messages will be returned. | optional | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Messages | A list [Message](https://app.cryptolens.io/docs/api/v3/model/Message) objects. | returned if no error was thrown | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"messages":[{"id":13,"content":"v401 is now available for download","created":1537815312,"channel":"stable"}],"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The timestamp in the Time parameter does not have the correct format. | ### Remove Message URL: `https://app.cryptolens.io/docs/api/v3/RemoveMessage` Summary: This method will remove a message that was previously broadcasted (which you can also manage [here](https://app.cryptolens.io/Message)). This method will remove a message that was previously broadcasted (which you can also manage [here](https://app.cryptolens.io/Message)). This method requires **Edit Messages** permission. This method is accessed by [https://api.cryptolens.io/api/message/RemoveMessage](https://api.cryptolens.io/api/message/RemoveMessage) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The id of the message to be removed. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | ## Payment Form Methods ### Payment Form URL: `https://app.cryptolens.io/docs/api/v3/PaymentForm` Summary: Overview of payment form session methods and related help links. ### Methods These are all the methods that can be used to manipulate an existing license key. - [Create Session](https://app.cryptolens.io/docs/api/v3/PFCreateSession) ### Help Here are some links that are useful: - [SKGL Extension (.NET) overview](https://help.cryptolens.io/web-api/skm-client-api) ### Create Session URL: `https://app.cryptolens.io/docs/api/v3/PFCreateSession` Summary: This method will create a new session for a [Payment Form](https://app.cryptolens.io/Feature/PaymentForm). It allows you to customize appearance of the form (such as price, heading, etc). You should only create new sessions from a server side... This method will create a new session for a [Payment Form](https://app.cryptolens.io/Feature/PaymentForm). It allows you to customize appearance of the form (such as price, heading, etc). You should only create new sessions from a server side (i.e. never directly from your application). Note, session will only work once and it will eventually expire depending on **Expires** parameter. This method is accessed by [https://api.cryptolens.io/api/paymentform/CreateSession](https://api.cryptolens.io/api/paymentform/CreateSession) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | PaymentFormId | The id of the payment form (=**[ProductId] **) | required | | Price | The amount you want to charge your customer as a double (eg. 12.5) | optional, 0 by default | | Currency | The ISO currency code (eg. USD) | required | | Heading | This will appear on top of the payment form (at most 100 chars). | optional | | ProductName | This is the text that is going to be displayed as the item that is being purchased (at most 200 chars). | optional | | CustomField | A [custom field](https://help.skmapp.com/#payment-request) that can be used as variables for the requests that are sent upon a successful transaction (at most 1000 chars). | optional | | Metadata | Any additional metadata that you want to be saved upon a successful transaction (at most 1000 chars) | optional | | Expires | The number of seconds this session should be valid. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | SessionId | A unique integer identifier associated with this customer. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"sessionId":"WyIxMiIsInF1MjdXTXk5MnprSEpuZytHQUdFMVd6VDVSSzQ2K2ZhRkJReCswVzYiXQ==","result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | The currency string is incorrect. | | The payment form does not exist. | ## Subscription Methods ### Subscription URL: `https://app.cryptolens.io/docs/api/v3/Subscription` Summary: These methods are related to the [recurring billing](https://help.cryptolens.io/recurring-payments/index) module. They can all be accessed using an access token with 'Subscription' permission. ### Methods These methods are related to the [recurring billing](https://help.cryptolens.io/recurring-payments/index) module. They can all be accessed using an access token with 'Subscription' permission. - [Record Usage](https://app.cryptolens.io/docs/api/v3/RecordUsage) ### Help Here are some links that are useful: - [Recurring billing tutorial](https://help.cryptolens.io/recurring-payments/index) ### Record Usage URL: `https://app.cryptolens.io/docs/api/v3/RecordUsage` Summary: This method records uses [Stripe's metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) to record usage for a certain subscription. In order to use this mehtod, you need to have set up... This method records uses [Stripe's metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) to record usage for a certain subscription. In order to use this mehtod, you need to have set up [recurring billing](https://help.cryptolens.io/recurring-payments/index). A record will be created using [Stripe's API](https://stripe.com/docs/api/usage_records) with action set to 'increment'. This method is accessed by [https://api.cryptolens.io/api/subscription/RecordUsage](https://api.cryptolens.io/api/subscription/RecordUsage) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | the product id (=**[ProductId] **) | required | | Key | the serial key string | required | | Amount | The amount to increment the usage counter with. | optional. 0 by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example result ```text {"result":0,"message":""} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Could not find the product. | | Could not find the key. | | No Stripe payment processor was set up. | | The subscription item id could not be found. | | Could not increment the usage counter. | ## Reseller Methods ### Reseller URL: `https://app.cryptolens.io/docs/api/v3/Reseller` Summary: These are all the methods that can be used to work with reseller objects. All methods require only the "Reseller" permission. Please enable the reseller module on the [billing page](https://app.cryptolens.io/Billing). ### Methods These are all the methods that can be used to work with reseller objects. All methods require only the "Reseller" permission. Please enable the reseller module on the [billing page](https://app.cryptolens.io/Billing). - [Add Reseller](https://app.cryptolens.io/docs/api/v3/AddReseller) - [Edit Reseller](https://app.cryptolens.io/docs/api/v3/EditReseller) - [Remove Reseller](https://app.cryptolens.io/docs/api/v3/RemoveReseller) - [Get Resellers](https://app.cryptolens.io/docs/api/v3/GetResellers) - [Get Reseller Customers](https://app.cryptolens.io/docs/api/v3/GetResellerCustomers) ### Add Reseller URL: `https://app.cryptolens.io/docs/api/v3/AddReseller` Summary: This method will add new reseller. To remove an existing reseller, please see [Remove Reseller](https://app.cryptolens.io/docs/api/v3/RemoveReseller). This method will add new reseller. To remove an existing reseller, please see [Remove Reseller](https://app.cryptolens.io/docs/api/v3/RemoveReseller). This method is accessed by [https://api.cryptolens.io/api/reseller/AddReseller](https://api.cryptolens.io/api/reseller/AddReseller) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Name | Name of the reseller. | A string of max 100 characters. | | Url | Url to reseller's website. | A string of max 500 characters. | | Email | Email of the reseller. | A string of max 100 characters. | | Phone | Phone number to the reseller. | A string of max 100 characters. | | Description | Description related to the reseller. | A string of max 500 characters. | | Metadata | A JSON dictionary containing extra fields to store with the reseller. | A JSON string. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ResellerId | A unique integer identifier associated with this reseller. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"resellerId":8,"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The model state is not valid. Please check the parameters. | | The name cannot be longer than 100 characters. | | The url cannot be longer than 500 characters. | | The email cannot be longer than 100 characters. | | The phone cannot be longer than 100 characters. | | The description cannot be longer than 500 characters. | ### Edit Reseller URL: `https://app.cryptolens.io/docs/api/v3/EditReseller` Summary: This method will edit an existing reseller. This method will only change the properties that you specify. This method will edit an existing reseller. This method will only change the properties that you specify. This method is accessed by [https://api.cryptolens.io/api/reseller/EditReseller](https://api.cryptolens.io/api/reseller/EditReseller) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ResellerId | Id of the reseller. | An integer, required. | | Name | Name of the reseller. | A string of max 100 characters. | | Url | Url to reseller's website. | A string of max 500 characters. | | Email | Email of the reseller. | A string of max 100 characters. | | Phone | Phone number to the reseller. | A string of max 100 characters. | | Description | Description related to the reseller. | A string of max 500 characters. | | Metadata | A JSON dictionary containing extra fields to store with the reseller. Note, to remove a certain field, you can set it to null or empty string. | A JSON string. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | Reseller could not be found. | | The name cannot be longer than 100 characters. | | The url cannot be longer than 500 characters. | | The email cannot be longer than 100 characters. | | The phone cannot be longer than 100 characters. | | The description cannot be longer than 500 characters. | ### Get Resellers URL: `https://app.cryptolens.io/docs/api/v3/GetResellers` Summary: This method will return the list of resellers, with the newest resellers shown first. This method will return the list of resellers, with the newest resellers shown first. This method is accessed by [https://api.cryptolens.io/api/reseller/GetResellers](https://api.cryptolens.io/api/reseller/GetResellers) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Search | If either the Name, Phone, Email or Description contain the search string, it will be returned. | optional | | ResellerId | If this value is set, the method will return only one reseller with whose Id is equal to the value of this parameter. If no such reseller exists, no resellers will be returned. Please make sure that the parameter **Search** is not set when retrieving a reseller based on Id. | optional, 0 by default. | | Limit | Specifies how many customers will be returned. If not set, all customers will be returned. | optional. disabled by default. | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Resellers | A list of [Reseller](https://app.cryptolens.io/docs/api/v3/model/Reseller) objects. | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"resellers":[{"id":7,"inviteId":0,"resellerUserId":0,"created":"2020-10-07T00:00:00","name":"Test Reseller","url":null,"email":null,"phone":null,"description":"Test Reseller","metadata":{"key":"value"}}],"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | ### Get Reseller Customers URL: `https://app.cryptolens.io/docs/api/v3/GetResellerCustomers` Summary: This method will return a list of customers that belong to a certain reseller. This method will return a list of customers that belong to a certain reseller. This method is accessed by [https://api.cryptolens.io/api/reseller/GetResellerCustomers](https://api.cryptolens.io/api/reseller/GetResellerCustomers) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ResellerId | The id of the reseller whose customers you want to access. | required | | v | Method version. | optional. by default, it's 1. | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Customers | The list of [customer objects](https://app.cryptolens.io/docs/api/v3/model/Customer). | always returned | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"customers":[{"id":38,"name":"Test","email":"test@example.com","companyName":"SKM","created":"2016-02-19T20:42:57.283"},{"id":13910,"name":"artem","email":"test@example.com","companyName":"Cryptolens AB","created":"2020-08-18T13:04:58.85"}],"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Reseller could not be found. | ### Remove Reseller URL: `https://app.cryptolens.io/docs/api/v3/RemoveReseller` Summary: This method will remove an existing reseller given the resellerId. To add a new reseller, please see [Add Reseller](https://app.cryptolens.io/docs/api/v3/AddReseller). This method will remove an existing reseller given the resellerId. To add a new reseller, please see [Add Reseller](https://app.cryptolens.io/docs/api/v3/AddReseller). This method is accessed by [https://api.cryptolens.io/api/reseller/RemoveReseller](https://api.cryptolens.io/api/reseller/RemoveReseller) ### Parameters | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ResellerId | The id of the reseller to remove. | required | ### Results | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Result | This is either **0**(=success) or **1**(=error). | always returned | | Message | The message that provides additional information about the result. | always returned. | ### Example results ```text {"result":0,"message":null} ``` ### Errors | **Error** | | --- | | Access denied. | | The input parameters were incorrect. | | Reseller could not be found. Maybe it was already removed? | ## Models ### Activation Data URL: `https://app.cryptolens.io/docs/api/v3/model/ActivationData` Assumed ModelVersion: 3 (highest documented version at generation time) Summary: A result of an activation performed using activation methods ([Activate [Web API 2]](https://app.cryptolens.io/docs/api/v2/Activate) or [Activate [Web API 3]](https://app.cryptolens.io/docs/api/v3/Activate)). A result of an activation performed using activation methods ([Activate [Web API 2]](https://app.cryptolens.io/docs/api/v2/Activate) or [Activate [Web API 3]](https://app.cryptolens.io/docs/api/v3/Activate)). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Mid | Machine id (device identifier) | A string. | | IP | The IP of the client device that performed the activation. | A string. | | Time | The time of the activation. | A DateTime. | | FriendlyName | The friendly name of the device. Note, in order for this field to be returned, you need to set the correct modelVersion when calling Activate or GetKey. | A string. | | FloatingExpires | The friendly name of the device. Note, in order for this field to be returned, you need to set the correct modelVersion when calling Activate or GetKey. | A DateTime. | ### Result ```text {"mid":"wPUNwGtgWYc3daEcq9JK82NV","ip":"192.0.2.255","time":"2016-04-06T15:05:35.733"} ``` ### Anomaly Properties URL: `https://app.cryptolens.io/docs/api/v3/model/AnomalyProperties` Summary: Properties related to an anomaly. Properties related to an anomaly. ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | StartingAt | The Id of the first request in the group. | A integer. | | EndingAt | The Id of the last request in the group. | An integer. | | Detected | The time when the anomaly was detected. | A DateTime. | | GroupId | A unique Id identifying this group of anomalous requests. | An integer. | | DateOfFirstLog | The time when the first request in the anomalous group occurred. | A DateTime. | ### Result ```text {"startingAt":16195129,"endingAt":16386890,"detected":"2021-04-19T11:47:13.957","groupId":3,"dateOfFirstLog":"2020-05-22T07:16:34.233"} ``` ### Basic License Key URL: `https://app.cryptolens.io/docs/api/v3/model/BasicLicenseKey` Summary: A license key object represents information related to a specific license found inside a [product](https://app.cryptolens.io/Feature/Product). This model is a reduced version of [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey). A license key object represents information related to a specific license found inside a [product](https://app.cryptolens.io/Feature/Product). This model is a reduced version of [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | The ID of the product that this key belongs to. | An integer | | ID | The ID (within the product) of the license key. | An integer | | Key | The license key string, eg. ABCDE-EFGHI-JKLMO-PQRST. | A string | | Created | The creation date of the license key. | A DateTime | | Expires | The expiration date of the license key. Note, it's optional and it's up to your program to interpret this. Please see [Key's that don't expire](https://help.cryptolens.io/web-interface/keys-that-dont-expire). | A DateTime | | Period | The duration of current license cycle eg. 30 days. Note, this is a static number and does not change automatically. | An integer | | F1 | The feature 1 of the license key. | A boolean | | F2 | The feature 2 of the license key. | A boolean | | F3 | The feature 3 of the license key. | A boolean | | F4 | The feature 4 of the license key. | A boolean | | F5 | The feature 5 of the license key. | A boolean | | F6 | The feature 6 of the license key. | A boolean | | F7 | The feature 7 of the license key. | A boolean | | F8 | The feature 8 of the license key. | A boolean | | Notes | The notes field of the license key. | A string of max 150 characters. | | Block | This will always be false. | A boolean | | GlobalId | A unique identifier of the license key. It can, for instance, be used as a "ReferencerId" when creating a [data object(aka additional variables)](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). | An integer | ### Result ```text {"productId":1234,"id":1,"key":"AAAAA-AAAAA-AAAAA-AAAAA","created":"2015-08-27T00:00:00","expires":"2018-11-03T00:00:00","period":1023,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"this key is used as an example in one of the test cases.","block":false,"globalId":24963} ``` ### Customer URL: `https://app.cryptolens.io/docs/api/v3/model/Customer` Assumed ModelVersion: 3 (highest documented version at generation time) Summary: A customer object is a representation of a customer that can be found in the [customer panel](https://app.cryptolens.io/Customer). A customer object is a representation of a customer that can be found in the [customer panel](https://app.cryptolens.io/Customer). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the customer | An integer | | Name | Name of the customer | A string of max 100 characters. | | Email | The email of the customer. | A string of max 100 characters. | | CompanyName | Company name of the customer | A string of max 100 characters. | | Created | Creation date of the customer | A DateTime. | | EnableCustomerAssociation | Whether it should be possible to customers to sign up for an account. | A boolean. | | AssociationAuthCode | The code that can be used by the customer to sign up for an account. | A string. | | MaxNoOfDevices | The maximum number of devices that the customer can log in on if user account authentication is used. | An integer. | | Owner | The UserId of the account that owns this customer. | An integer. | | ResellerId | The UserId of the account that acts as a reseller. | An integer. | | IsPublic | Whether resellers should be able to see this customer. Note, if a reseller is registered with this customer, they will still be able to see it even if this is set to false. | A boolean. | | Secret | The customer secret. | A string. | | Notes | The notes field. | A string. | ### Result ```text {"id":1234,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453"} ``` ### Customer (extended) URL: `https://app.cryptolens.io/docs/api/v3/model/CustomerExtended` Summary: A customer object is a representation of a customer that can be found in the [customer panel](https://app.cryptolens.io/Customer). A customer object is a representation of a customer that can be found in the [customer panel](https://app.cryptolens.io/Customer). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the customer | An integer | | Name | Name of the customer | A string of max 100 characters. | | Email | Namer | A string of max 100 characters. | | CompanyName | Company name of the customer | A string of max 100 characters. | | Created | Creation date of the customer | A DateTime. | | EnableCustomerAssociation | Whether it should be possible to customers to sign up for an account. | A boolean. | | AssociationAuthCode | The code that can be used by the customer to sign up for an account. | A string. | | MaxNoOfDevices | The maximum number of devices that the customer can log in on if user account authentication is used. | An integer. | | Owner | The UserId of the account that owns this customer. | An integer. | | ResellerId | The UserId of the account that acts as a reseller. | An integer. | | IsPublic | Whether resellers should be able to see this customer. Note, if a reseller is registered with this customer, they will still be able to see it even if this is set to false. | A boolean. | ### Result ```text {"id":1234,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453", "enableCustomerAssociation":"false", "associationAuthCode":"ABCDE", "maxNoOfDevices":"1","owner":"1234", "resellerId":"1234", "isPublic":"false"} ``` ### Data Object URL: `https://app.cryptolens.io/docs/api/v3/model/DataObject` Summary: The structure of a [data object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) aka additional variable. The structure of a [data object](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro) aka additional variable. ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identification number for the *Data Object*. | always included. | | Name | The name of the data object. Max 10 characters. | always included. | | StringValue | A string value (text) to store. Max 100 characters. | always included. | | IntValue | An int value (int32) to store. | always included. | ### Result ```text {"mid":"wPUNwGtgWYc3daEcq9JK82NV","ip":"192.0.2.255","time":"2016-04-06T15:05:35.733"} ``` ### Event Object URL: `https://app.cryptolens.io/docs/api/v3/model/EventObject` Summary: Reference for the Event Object model. ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the event. | An integer | | Key | The serial key string. | string | | MachineCode | The machine code or any other identifier of the device/user (especially if no product and key is given). | string | | FeatureName | The name of the feature, eg. 'VideoRecorder' or 'F1'. Can be any string of max 20 chars in length. | string | | EventName | The name of the event, eg. 'click' or 'start'. Can be any string of max 20 chars in length. | string | | Time | Time of the event. | A unix timestamp (integer) | | Value | The value of the event, eg. if this event lead to a transaction, you can enter its value here (as an int, 25.3 should be entered as 2530). In this case, you can, for instance, set EventName to 'purchase', or anything similar. | An integer | | Currency | The currency, eg USD. Useful if this event has a certain value. | string | | Metadata | Additional metadata as JSON string related to this event. Be careful and do not send personal identifiable information unless it is really needed. Please read more ">here. | string | ### Feature Definitions URL: `https://app.cryptolens.io/docs/api/v3/model/FeatureDefinitions` Summary: A [feature definition](https://help.cryptolens.io/web-interface/feature-definitions) object. It can be edited on the product page. A [feature definition](https://help.cryptolens.io/web-interface/feature-definitions) object. It can be edited on the product page. **Note:** There are three feature types, Default (0), Time Limited (1) and Trial(2). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | F1 | The name and type of the feature. | A a JSON object. | | F2 | The name and type of the feature. | A a JSON object. | | F3 | The name and type of the feature. | A a JSON object. | | F4 | The name and type of the feature. | A a JSON object. | | F5 | The name and type of the feature. | A a JSON object. | | F6 | The name and type of the feature. | A a JSON object. | | F7 | The name and type of the feature. | A a JSON object. | | F8 | The name and type of the feature. | A a JSON object. | | AllLicensesTimeLimited | If true, all licenses will be treated as time-limited. | A boolean. | | BlockExpiredLicenses | If true, expired licenses (based on feature definitions) will be blocked. | A boolean. | ### Result ```text {"f1":{"name":"Time Limit (F1)","type":1},"f2":{"name":"Trial (F2)","type":2},"f3":{"name":"Feature 3","type":0},"f4":{"name":"Feature 4","type":0},"f5":{"name":"Feature 5","type":0},"f6":{"name":"Feature 6","type":0},"f7":{"name":"Feature 7","type":0},"f8":{"name":"Feature 8","type":0},"allLicensesTimeLimited":false,"blockExpiredLicenses":false} ``` ### License Key URL: `https://app.cryptolens.io/docs/api/v3/model/LicenseKey` Summary: A license key object represents information related to a specific license found inside a [product](https://app.cryptolens.io/Feature/Product). A license key object represents information related to a specific license found inside a [product](https://app.cryptolens.io/Feature/Product). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ProductId | The ID of the product that this key belongs to. | An integer | | ID | The ID (within the product) of the license key. | An integer | | Key | The license key string, eg. ABCDE-EFGHI-JKLMO-PQRST. | A string | | Created | The creation date of the license key. | A DateTime | | Expires | The expiration date of the license key. Note, it's optional and it's up to your program to interpret this. Please see [Key's that don't expire](https://help.cryptolens.io/web-interface/keys-that-dont-expire). | A DateTime | | Period | The duration of current license cycle eg. 30 days. Note, this is a static number and does not change automatically. | An integer | | F1 | The feature 1 of the license key. | A boolean | | F2 | The feature 2 of the license key. | A boolean | | F3 | The feature 3 of the license key. | A boolean | | F4 | The feature 4 of the license key. | A boolean | | F5 | The feature 5 of the license key. | A boolean | | F6 | The feature 6 of the license key. | A boolean | | F7 | The feature 7 of the license key. | A boolean | | F8 | The feature 8 of the license key. | A boolean | | Notes | The notes field of the license key. | A string of max 150 characters. | | Block | This will always be false. | A boolean | | GlobalId | A unique identifier of the license key. It can, for instance, be used as a "ReferencerId" when creating a [data object(aka additional variables)](https://app.cryptolens.io/docs/api/v3/DataObjectsIntro). | An integer | | Customer | The entire [customer](https://app.cryptolens.io/docs/api/v3/model/Customer) object assigned to this license key. | A [Customer Object](https://app.cryptolens.io/docs/api/v3/model/Customer) | | ActivatedMachines | Activated devices/machines that belong to this license key. | A list of [Activation data](https://app.cryptolens.io/docs/api/v3/model/ActivationData) | | TrialActivation | Tells if [trial activation](https://help.cryptolens.io/web-interface/trial-activation) is enabled. | A boolean | | MaxNoOfMachines | The maximum number of machines/devices that may activate this license. By setting this to 0, machine locking will be disabled and an unlimited number of devices will be able to activate the license. | An integer | | AllowedMachines | Machine codes of those devices that will be prioritized during activation. Even if the limit is achieved, these will still be activated. | A string | | DataObjects | A list of [Data objects](https://app.cryptolens.io/docs/api/v3/model/DataObject), additional variables associated with the license key. | A [Data objects](https://app.cryptolens.io/docs/api/v3/model/DataObject) | | SignDate | The DateTime when this activation file was signed. | Returned with no value. | | Signature | The signature of the all the fields above | Returned with no value. | ### Result ```text {"productId":1234,"id":1,"key":"AAAAA-AAAAA-AAAAA-AAAAA","created":"2015-08-27T00:00:00","expires":"2018-11-03T00:00:00","period":1023,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"this key is used as an example in one of the test cases.","block":false,"globalId":24963,"customer":{"id":3,"name":"Bob","email":"bob@example.com","companyName":"SKM","created":"2015-09-04T16:11:14.453"},"activatedMachines":[{"mid":"5632812","ip":"10.1.1.1","time":"2016-03-25T18:56:34.647"},{"mid":"7632812","ip":"10.1.1.2","time":"2016-04-06T15:05:35.733"},{"mid":"85256631","ip":"10.1.1.5","time":"2016-04-07T22:18:26.673"}],"trialActivation":false,"automaticActivation":true,"maxNoOfMachines":10,"allowedMachines":"","dataObjects":[],"signDate":"2","signature":null} ``` ### License Template URL: `https://app.cryptolens.io/docs/api/v3/model/LicenseTemplate` Summary: The [License Template](https://help.cryptolens.io/web-interface/license-template) object. You can also see a list of license templates on the [following page](https://app.cryptolens.io/LicenseTypes). The [License Template](https://help.cryptolens.io/web-interface/license-template) object. You can also see a list of license templates on the [following page](https://app.cryptolens.io/LicenseTypes). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | The id of the license template. | An integer. | | Name | The name of the license template. | A string. | | ProductId | The id of the product that this license template is associated with. | An integer. | | Parameters | Parameters of the [License Template](https://help.cryptolens.io/web-interface/license-template). | A Sting. | ### Result ```text {"ProductId":3645,"Period":30,"F1":true,"F2":true,"F3":false,"F4":false,"F5":false,"F6":false,"F7":false,"F8":false,"Notes":null,"Block":false,"CustomerId":0,"TrialActivation":false,"MaxNoOfMachines":0,"AllowedMachines":null} ``` ### Message URL: `https://app.cryptolens.io/docs/api/v3/model/Message` Summary: A message object that can be broadcasted to users. You can create new messages [here](https://app.cryptolens.io/Message). A message object that can be broadcasted to users. You can create new messages [here](https://app.cryptolens.io/Message). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the message | An integer | | Content | The content of the message | A string of max 500 characters. | | Channel | The channel this message belongs to | A string of max 200 characters. | | Created | Creation date of the message | A unix timestamp. | ### Result ```text {"id":13,"content":"v401 is now available for download","created":1537815312,"channel":"stable"} ``` ### Metadata URL: `https://app.cryptolens.io/docs/api/v3/model/Metadata` Summary: Additional information about each [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey). Additional information about each [License Key](https://app.cryptolens.io/docs/api/v3/model/LicenseKey). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | ActivatedMachines | The number of activated machines for this license key. | depends on configuration | | LicenseStatus | Additional information about the license key. It contains the following: **IsValid** - Either true or false, depending on if the license satisfies all conditions for being valid. **ReasonForInvalidity** - if a license is invalid, this will contain the reason (an integer). This can be decoded as follows: None = 0 Expired = 1> Blocked = 2 **Trial** - tells if the license is a trial, based on the feature definitions for the product **TimeLimited** - tells if the license is a time-limited / subscription, based on the feature definitions for the product **TimeLeft** - if the license key is time-limited, this field will contain the remaining number of days until it expires | depends on configuration | ### Result ```text {"activatedMachines": 3, "licenseStatus":{"isValid":true,"reasonForInvalidity":0,"trial":false,"timeLimited":false,"timeLeft":0}}} ``` ### Object Log URL: `https://app.cryptolens.io/docs/api/v3/model/ObjectLog` Summary: Reference for the Object Log model. ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the event. | An integer | | Created | The time when this event occurred. | Unix timestamp (integer) | | ResourceType | The resource type is the affected object of this event. Unspecified Customer IssuedLicense LicenseKey LicenseIssuance Product DataObject | integer | | ResourceAction | The action that was performed on the object. None Added Updated Deleted | integer | | AffectedObjectId | The id of the object that was affected. | integer | | ObjectOwnerUserId | The id of the user who owns this object. | integer | | PerformedByUserId | The id of the user who performed the action. | string | | Data | Contains a JSON object related to this event. For example, if the object is created, this will contain a JSON version of the object. If only certain fields hava changed, a JSON dictionary will be returned where the key is the name of the field and the value is an array where the first value is the old value and the second value is the new value. | string | ### Product URL: `https://app.cryptolens.io/docs/api/v3/model/Product` Summary: A product object is a representation of a product that can be found in the [product panel](https://app.cryptolens.io/Product). A product object is a representation of a product that can be found in the [product panel](https://app.cryptolens.io/Product). ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the product | An integer | | Name | Name of the product | A string of max 100 characters. | | CreationDate | The creation date< of the product. | A date time | | Description | Description of the product. | A string of max 500 characters. | | Password | Password of the product. Only returned if the Key Algorithm is SKGL. | A string | | KeyAlgorithm | The key algorithm. | Either SKGL or SKM15. | | FeatureDefinitions | An [feature definitions](https://app.cryptolens.io/docs/api/v3/model/FeatureDefinitions) object with information about what features are trials, etc. | A json object. | | DataObjects | Data objects associated with the product. | A list of [Data Object](https://app.cryptolens.io/docs/api/v3/model/DataObject). | ### Result ```text {"id":1234,"name":"Example product","creationDate":"2014-01-02T00:00:00","description":"Description","password":"","isPublic":true,"keyAlgorithm":1,"featureDefinitions":{"f1":{"name":"Time Limit (F1)","type":1},"f2":{"name":"Trial (F2)","type":2},"f3":{"name":"Feature 3","type":0},"f4":{"name":"Feature 4","type":0},"f5":{"name":"Feature 5","type":0},"f6":{"name":"Feature 6","type":0},"f7":{"name":"Feature 7","type":0},"f8":{"name":"Feature 8","type":0},"allLicensesTimeLimited":false,"blockExpiredLicenses":false},"dataObjects":[]} ``` ### Reseller URL: `https://app.cryptolens.io/docs/api/v3/model/Reseller` Assumed ModelVersion: 2 (highest documented version at generation time) Summary: An object that contains information about a reseller. An object that contains information about a reseller. ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the reseller. | An integer | | InviteId | The invite id, if applicable.. | An integer | | ResellerUserId | The id of the user account connected to this reseller object. | An integer | | Created | Creation date of the reseller. | A DateTime. | | Name | Name of the reseller. | A string of max 100 characters. | | Url | Url to reseller's website. | A string of max 500 characters. | | Email | Email of the reseller. | A string of max 100 characters. | | Phone | Phone number to the reseller. | A string of max 100 characters. | | Description | Description related to the reseller. | A string of max 500 characters. | | Metadata | The list of extra fields that are associated with the reseller. | A dictionary. | ### User URL: `https://app.cryptolens.io/docs/api/v3/model/User` Summary: A user object. A user object. ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Username | The username. | A string. | | Email | The email | A string. | | Created | The date when the user was created. | A DateTime. | | CustomerId | The customer id of the customer the user is associated with. If set to 0, it means the user is not associated with any customer object. | An integer. | ### Result ```text Not available. ``` ### Web API Log URL: `https://app.cryptolens.io/docs/api/v3/model/WebAPILog` Summary: A state code is a 4 digit number that stores information about a request. It allows you to tell whether a certain request was successful or unsuccessful, and in some cases, what kind of action was taken. State codes can... ### Structure | **Parameter** | **Description** | **Remarks** | | --- | --- | --- | | Id | A unique identifier of the event. | An integer | | ProductId | The id of the product. | An integer | | Key | The license key string. | A string | | IP | An anonymized IP of the device that triggered this log. | A string | | Time | The time when this log was created. | Unix timestamp (integer) | | State | Contains more information about the method that was called and if it was successful or not. | An integer | | MachineCode | The machine code of the device, if applicable. | A string | | FriendlyName | Specifies a friendly name for the activated device, for example the employee's email. Friendly name does not impact the number of active machine codes / seats, but it offers an easy way of linking a machine/seat with a user. | A string | | FloatingExpires | The time when the floating device will expire, if applicable. | Unix timestamp (integer) | | DOIntValue | If this request is related to an operation on the integer value of a [data object](https://app.cryptolens.io/docs/api/v3/Data), this value will be set to the value that was passed in as IntValue. | An integer | | DOId | If this request is related to an operation on a [data object](https://app.cryptolens.io/docs/api/v3/Data), this value will contain the id of the data object. | An integer | ### State codes A state code is a 4 digit number that stores information about a request. It allows you to tell whether a certain request was successful or unsuccessful, and in some cases, what kind of action was taken. State codes can be decoded in the following way: **2011** - **20 - **tells what kind of method was executed (eg. activate, deactivate). here it is activation. - **1 -** tells if the request was successful or unsuccessful. here, it is successful. - **1 -** is an optional digit that gives additional information about the request. (usually zero) #### The first 2 digits | **Short Code ** | **Method** | | --- | --- | | 10** | validation request | | 20** | activation request | | 30** | key generation request | | 40** | optional field request | | 50** | no request associated | | 60** | deactivation request | | 70** | other license manipulation requests | | 80** | data object requests | #### The 3rd digit (success or failure) | **Short Code ** | **Method** | | --- | --- | | **1* | successful request | | **2* | unsuccessful request | #### Optional digit (4th) At the moment, activation (20**), key generation (30**) and optional field (40**) provide an optional digit with more information about the request. | **Short Code ** | **Method** | | --- | --- | | 3010 | nothing special | | 3011 | a trial key was generated | | 3012 | an existing trial key was returned | | 3021 | there was an error when creating the trial key | | **Short Code ** | **Method** | | --- | --- | | 2010 | nothing special | | 2011 | the key was already activated on a machine with the given id | | 2012 | the key is activated with a new machine code | | 2022 | device limit has been reached (node-locking) | | 2013 | trial activation was performed | | 2014 | activated using floating licensing | | 2024 | device limit has been reached in floating licensing | | 2015 | activated using an overdraft floating license | | **Short Code ** | **Method** | | --- | --- | | 4020 | nothing special | | 4021 | the optional field cannot be decreased anymore | | **Short Code ** | **Method** | | --- | --- | | 6010 | deactivation successful | | 6011 | release of a floating license successful | | **Short Code ** | **Method** | | --- | --- | | 7011 | add feature successful | | 7012 | remove feature successful | | 7013 | block key successful | | 7014 | unblock key successful | | 7015 | extend license successful | | 7016 | machine lock limit successful | | 7017 | change notes successful | | 7018 | trial activation successful | | 7019 | change customer successful | | **Short Code ** | **Method** | | --- | --- | | 8011 | add data object successful | | 8012 | remove data object successful | | 8013 | list data objects successful | | 8014 | increment int value successful | | 8015 | decrement int value successful | | 8016 | set int value successful | | 8017 | set string value successful |