# Introduction Source: https://help.cryptolens.io/api-reference/introduction Our Web API reference is currently available at [https://app.cryptolens.io/docs/api/v3/](https://app.cryptolens.io/docs/api/v3/) For [AI-assisted integrations](/getting-started/build-with-ai) or full API reference search, use [**llms-full.txt**](https://app.cryptolens.io/docs/api/v3/llms-full.txt)**.** It contains the complete Devolens, formerly Cryptolens, API documentation in an LLM-friendly format. # Basics of Devolens Source: https://help.cryptolens.io/basics/index Core concepts for getting started with Devolens licensing. Devolens (formerly Cryptolens) helps you add licensing to your software, automate license delivery, and manage how customers access your products. At a high level, a typical integration has three parts: * **Licensing data**: products, license keys, customers, features, activations, and metadata. * **Your application**: verifies a license and decides what functionality to unlock. * **Integration layer**: client SDKs or direct Web API calls connect your application and backend systems to Devolens. ## Runtime license checks Inside your application, licensing usually becomes a simple decision: is this license valid, and what should the user be allowed to do? ```c# theme={null} if (license.HasFeature(1) .HasNotExpired() .IsValid()) { // Unlock the feature. } else { // Show an activation, renewal, or upgrade message. } ``` The exact code depends on your platform and licensing model. See [key verification](/examples/key-verification) for a complete implementation. ## What to learn first Start with the core objects that most licensing models are built from, then learn how your application communicates with Devolens. * [Products, keys, customers, and activations](/basics/product-and-keys) explains the main objects you manage in Devolens. * [Web API](/basics/webapi) explains how applications, backend systems, and integrations communicate with Devolens. * [Licensing models](/licensing-models/index) shows common ways to combine these concepts, such as subscriptions, floating licenses, usage-based licensing, and user authentication. ## Next * [Follow the getting started guide](/getting-started/getting-started-guide) * [Choose a client SDK](/libraries) * [Review common licensing models](/licensing-models/index) # Products, keys, customers, and activations Source: https://help.cryptolens.io/basics/product-and-keys Core Devolens (formerly Cryptolens) concepts and how they map to licensing models. Product Page Devolens (formerly Cryptolens) gives you flexibility to implement many different licensing models. Most models are built from the same core concepts: products, license keys, features, data objects, activations, and customers. ## Product A **Product** organizes license keys that unlock functionality in your application. In most cases, you create one product for each application you sell. There are exceptions where multiple products can make sense: * If your application consists of many standalone modules and each module needs its own expiry date, for example for trials or time-limited licenses, you can create a separate product for each module. * If the modules do not need separate expiry dates, one product is usually enough. You can use features to decide which modules are active. If you choose a multi-product setup, consider linking each license to a Customer in Devolens. That lets you issue a [customer secret](/feature/web-ui/customer-secret), so the customer can access all their licenses without remembering each license key separately. For serial key generation, each product uses an algorithm such as [SKGL or SKM15](https://help.cryptolens.io/web-interface/skgl-vs-skm15). We recommend the default SKM15 algorithm. ## License key A **License Key** is a 20-character string, for example `MUYVD-LSEBY-CXHRQ-XFAGY`, with licensing information associated with it. A key can store properties such as expiry date, blocked status, features, customer information, and custom metadata. License keys are the main object your application verifies when deciding whether to unlock functionality. ### Features Features let you limit which parts of your product a customer can use. Eight feature flags are available by default, and you can extend this with custom feature definitions as described in [feature templates](/feature/web-ui/feature-templates). Features can also differentiate product editions, modules, trials, and time-limited offers. ### Data objects Data objects are custom variables or metadata that can be attached to a license. They are useful when a licensing model needs additional properties, such as operating system, network, geo-location, credits, usage limits, or other product-specific values. For usage limits and credits, see [usage-based licensing](/licensing-models/usage-based). ### Activated machines Activated machines let you limit how many machines, users, networks, or other identifiers can use a license. From Devolens' perspective, the `MachineCode` value is just a string. Your application decides what it represents. You control the allowed count with the [maximum number of machines](/feature/web-ui/maximum-number-of-machines) property. Common patterns include: * [Node-locking](/licensing-models/node-locked), where each activation is usually a device and remains active until it is deactivated through the API or dashboard. * [Floating licensing](/licensing-models/floating), where activations can expire automatically after inactivity. * Pre-activated machines or users, where only an allowed list can use the license. * [Per-user seats using activations](/licensing-models/user-based-activations), where `MachineCode` represents a stable user identifier instead of a device. You can also combine these patterns. For example, you can allow only computers A, B, C, and D to use a license, while also allowing only two of them to be active at the same time. ## Customer A **Customer** groups licenses that belong to the same customer or organization. When you sell multiple products, assigning each License Key to a Customer makes it easier to track and manage what that customer owns. Customer-linked licenses also unlock several customer access patterns: * Invite customers to the [Customer portal](/feature/customer-portal/index), where they can manage licenses and activations. * Bundle many licenses behind one [customer secret](/feature/web-ui/customer-secret). * Let customers authenticate with [user credentials](/licensing-models/user-credentials) instead of entering each license key manually. ## Next * [Learn the basics about our Web API](/basics/webapi) * [Review common licensing models](/licensing-models/index) # Web API Source: https://help.cryptolens.io/basics/webapi How applications, backend systems, and integrations communicate with Devolens. The Devolens (formerly Cryptolens) Web API is the HTTPS interface that applications, backend services, and third-party systems use to work with licensing data. It is used for license verification, key creation, activation management, customer access, usage data, and automation. For most client applications, we recommend using one of the [client SDKs](/libraries). The SDKs call the Web API for you and include helpers for common licensing tasks. You can also call the Web API directly when you need a custom backend integration, an unsupported programming language, or a workflow that is not covered by an SDK. ## How it fits At a high level, the Web API is the integration layer between your systems and Devolens: ```text theme={null} Your application or client SDK Your backend, CRM, payment provider, or admin portal Enterprise components such as a license server or reverse proxy | v Devolens Web API | v License keys, customers, activations, features, and usage data ``` This makes the Web API useful both for simple license checks inside an application and for larger SME or enterprise workflows where licensing is connected to sales, billing, customer administration, support, or internal tools. ## Common use cases You can use the Web API to: * Activate and verify license keys. * Create, extend, block, or update license keys from your backend. * Assign license keys to customers and retrieve licenses linked to a customer. * Manage activated machines, user seats, floating seats, or other activation identifiers. * Store and update license metadata, such as feature configuration or usage counters. * Integrate Devolens with payment providers, CRM systems, provisioning workflows, or internal admin portals. * Support platforms where no official client SDK is available. ## SDKs vs direct API calls | Approach | Best for | Notes | | ------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | Client SDKs | In-app license verification and standard activation flows. | SDKs wrap common Web API methods and usually include helpers for machine codes, signed responses, and license checks. | | Direct Web API calls | Backend automation, payment flows, customer systems, unsupported languages, and advanced integrations. | Your application sends normal HTTPS requests to Devolens and handles the response directly. | | License server or reverse proxy | Enterprise environments with strict networking, offline needs, or customer-specific domains/IP addresses. | These options can route or cache licensing traffic while keeping the same licensing model. | ## Security basics Access to the Web API is controlled with access tokens. Create separate tokens for different workflows and give each token only the permissions it needs. For example, a token used by a backend payment workflow may need permission to create or update license keys. A token distributed inside a desktop or mobile application should be much more limited. Do not place admin or key-generation tokens in client-side applications. For license verification, use signed responses where supported and verify the response with your RSA public key. Your application should also check the license properties that matter for your product, such as product ID, expiry date, blocked status, features, and machine-binding or activation rules. ## Direct request example If you are using an unsupported language or building a custom integration, you can call the Web API directly. For example, this request retrieves information about a license key: ```text theme={null} https://app.cryptolens.io/api/key/GetKey?token={access-token}&ProductId=1234&Key=MUYVD-LSEBY-CXHRQ-XFAGY&Sign=True ``` The exact parameters depend on the method you call. See the [Web API reference](https://app.cryptolens.io/docs/api/v3/) for endpoint-specific request and response details. ## Enterprise deployment options Most applications can call Devolens directly through the client SDKs or the Web API. Some enterprise customers have additional network or compliance requirements. In those cases, you can also use: * [Reverse proxy](/examples/reverse-proxy), if requests need to go through your own domain or IP address. * [License server](/feature/license-server/index), if customer machines have limited internet access or need a local licensing gateway. * Backend-only API calls, if license provisioning, billing, or customer administration should be isolated from client applications. ## Next steps * [Web API reference](https://app.cryptolens.io/docs/api/v3/) * [Client SDK reference](/libraries) * [Key verification example](/examples/key-verification) * [Key generation example](/examples/key-generation) * [Common licensing models](/licensing-models/index) * [GDPR and data protection](/security/gdpr) # Changelog Source: https://help.cryptolens.io/changelog/index Updates are available on the following page: [https://app.cryptolens.io/App/Changes](https://app.cryptolens.io/App/Changes) # Data analysis and reports Source: https://help.cryptolens.io/examples/data-analysis Example of how to analyse various data sources in Cryptolens ## Introduction There are several data sources you can use to analyse the usage of your application and generate audit reports. We will describe them in more detail below and provide several examples of how they can be analysed. ## Data sources * [Web API Log](https://app.cryptolens.io/docs/api/v3/model/WebAPILog) - contains a list 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 contains minimal information about the event. * [Events Log](https://app.cryptolens.io/docs/api/v3/model/EventObject) - contains events that were registered using [Register Event](https://app.cryptolens.io/docs/api/v3/RegisterEvent) as well several other internal events. * [Object Log](https://app.cryptolens.io/docs/api/v3/model/ObjectLog) - contains a list of events that are created when certain object types are added or modified to allow you to track all changes made by you and your team members. ## Analysis We suggest to review the [following repository](https://github.com/Cryptolens/reporting-tools) to check if the report that you need to create is already available. As always, please let us know should you have any questions at [support@cryptolens.io](mailto:support@cryptolens.io). The easiest way to analyse the logs is using our [Python SDK](https://github.com/Cryptolens/cryptolens-python) in combination with [Anaconda](https://www.anaconda.com/) to manage the packages. Let’s look at how we can get some basics stats on the ratio of successful vs. unsuccessful requests. First, we need to load the relevant data: ```python theme={null} from datetime import datetime, timedelta, date from licensing.models import * from licensing.methods import Key, Helpers import pandas as pd import matplotlib.pyplot as plt from tools import * month_back = int(datetime.datetime.timestamp(datetime.datetime.today() - datetime.timedelta(days=30))) logs = [] ending_before=0 """ Loading the data """ while True: res = Key.get_web_api_log(token=get_api_token(), order_by="Id descending", limit = 1000, ending_before=ending_before) if res[0] == None: break logs = logs + res[0] if res[0][-1]["time"] < month_back: break; ending_before = res[0][-1]["id"] logs = pd.DataFrame(logs) logs = logs[logs["time"]>month_back] ``` Once we have the data in a pandas DataFrame, let’s create the plot: ```python theme={null} def success(state): return state % 100 // 10 - 1 logs["Success"] = success(logs["state"]) logs[logs["Success"]== 0] = "Success" logs[logs["Success"]== 1] = "Failure" logs["Success"].value_counts(normalize=True).plot(kind="bar", title='Successful vs. unsuccessful API requests') ``` This will create the following plot: Data Analysis Successfulratio Pn # Data collection Source: https://help.cryptolens.io/examples/data-collection Explains how data is being collected and how additional data can be supplied for better insights ## Idea By default, Cryptolens [logs](https://app.cryptolens.io/docs/api/v2/WebAPILog) many of the requests made to the Web API. This includes all [data object methods](https://app.cryptolens.io/docs/api/v3/Data) and all [key methods](https://app.cryptolens.io/docs/api/v3/Key) except for [Get Key](https://app.cryptolens.io/docs/api/v3/GetKey). However, these logs contain limited information and may not capture all events that could be useful from an analytics standpoint. When you deploy your product, it can for instance be useful to know the OS it’s running on or what features customers use the most, etc. Although these are useful on their own, when you link them together, you can get even better insights that can aid you in business critical decision making. For example, if you link transaction data with the OS data, you can see which OS brings you most of the revenue. If you see that a certain OS version does not bring in significant revenues, you can use this as basis to stop supporting it. In Cryptolens, additional data is referred to as **events** and can be gathered using [analytics methods](https://app.cryptolens.io/docs/api/v3/AI) in the Web API. We will cover these in the implementation section. ## Implementation ### In the app To register an event, you can call the [AI.RegisterEvent](https://help.cryptolens.io/api/dotnet/api/SKM.V3.Methods.AI.html#SKM_V3_Methods_AI_RegisterEvent_System_String_SKM_V3_Models_RegisterEventModel_) method. Most of the parameters are optional, but it’s useful to at least supply a `FeatureName` and either `Key` or `MachineCode`. If you just have one product, `ProductId` is not necessary, but it’s useful if you have multiple products. The code snippet below can be used to register event, in our case that the user started `YearReportGenerator` module. ```c# theme={null} AI.RegisterEvent("access token with RegisterEvent permission", new RegisterEventModel { EventName = "start", FeatureName = "YearReportGenerator", Key= "AAAA-BBBB-CCCC-DDDD", MachineCode = Helpers.GetMachineCode(), ProductId = 3, Metadata = Helpers.GetOSStats() }); ``` If you are on a platform that does not support this method, you can always send in data using by calling the URL below: ``` https://app.cryptolens.io/api/ai/RegisterEvent?token=&EventName=start&FeatureName=YearReportGenerator&Key=AAAA-BBBB-CCCC-DDDD&ProductId=3&MachineCode=& ``` ### Integration with payment providers In order to track transactions, we can use the same [AI.RegisterEvent](https://help.cryptolens.io/api/dotnet/api/SKM.V3.Methods.AI.html#SKM_V3_Methods_AI_RegisterEvent_System_String_SKM_V3_Models_RegisterEventModel_) method, but supply different set of parameters. To record the value, we can use the parameters `Value` and `Currency`. This can either be accomplished by calling the Web API directly or `AI.RegisterEvent` method (in case your backend is in .NET). Let’s assume your customer has have paid 30 usd for the product. In that case, you can call the following url: ``` https://app.cryptolens.io/api/ai/RegisterEvent?token=&Value=30&Currenc ``` # Introduction Source: https://help.cryptolens.io/examples/index In this section, we have listed several examples to help you get started. The focus is on applications targeting .NET, however Cryptolens does work with other languages too. You can find more examples in repositories associated with respective [client API](https://help.cryptolens.io/web-api/skm-client-api). If you want to explore other licensing models, we recommend to review [licensing models](https://help.cryptolens.io/licensing-models/licensetypes) section, where all examples have code suggestions in .NET. Depending on the platform (eg. Unity, Android, etc), we recommend to review [this page](https://help.cryptolens.io/getting-started/index) for platform specific advice. ## Inside your application * [Key verification](/examples/key-verification) - prepared example for key verification (C#, [VB.NET](http://VB.NET), Java, Python, C++). * [Offline key verification](/examples/offline-verification) - prepared example for offline key verification (C#, [VB.NET](http://VB.NET)). * [Creating verified trials](/examples/verified-trials) - prepared example showing how to create verified trials (C#, [VB.NET](http://VB.NET)). ## External services * [Key generation](/examples/key-generation) - key generation (useful when integrating with third party payment services). ## Licensing models * [Perpetual licensing (try & buy)](/licensing-models/perpetual) * [Recurring payments (SaaS)](https://help.cryptolens.io/licensing-models/subscription) # Integration with n8n Source: https://help.cryptolens.io/examples/integration-with-n8n Devolens (formerly Cryptolens) offers a n8n integration (node) that you can use in a similar way as our [Zapier app](/examples/zapier). You can find out more about the methods that are supported on [this page](https://n8n.io/integrations/cryptolens-devolens/). If any method that you need is missing, please let our support team know. ## Use cases Similar to Zapier, the goal of the n8n integration is allow you to integrate Cryptolens with other services. Typically, our customers use it to automate: 1. License key delivery upon a successful payment. 2. Populate a CRM when a new license is created. 3. Create a new license for a lead in a CRM. 4. Sending automatic reminders to customers when their license is about to expire. ### Examples Our n8n node was released recently and we are still working on documenting how it can be used. Please feel free to reach out to us, help (at) [devolens.com](http://devolens.com) or through the chat box. Below, we have listed a few use cases and the general idea of how to implement them. **License key delivery when a payment succeeds** For this example, let's assume you are using [Stripe Checkout](https://stripe.com/en-se/payments/checkout) to process payments. Once a customer has activated a subscription, you can capture this event using [Stripe's n8n node](https://n8n.io/integrations/stripe/) and call Cryptolens to issue a license. Once the license is issued, you can call an email service (e.g. [Send email service](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.sendemail/)) to send the license to a customer. **Populate a CRM once a license is issued** Our n8n integration contains an action called Get Web API Log (in the AI tab) that you can use to capture events. To capture all events related to issuance of a license, you can filter on States 3010 and 3011. Once you have the event, you can call the CRM that you are using. # Key Generation Source: https://help.cryptolens.io/examples/key-generation Example of how to create new keys using our API. Being able to create new license keys through external applications is important if you want to integrate Cryptolens with an external providers (eg. for payments, distribution etc). For example, if you already have a web store in place and want to keep using it, you can still use Cryptolens for eg. software licensing. This article describes the way you can generate keys by a simple web request through another website or an application. The goal is to automate software distribution by allowing your customers to receive valid license keys upon successful payments. ## Generating a Key Once you have enabled key generation, you are able to generate a new key. The simplest way is to assign all parameters (can be found here) to get a link that will return the specific key you want. A quick way to get that link without actually reading the Web API documentation is as following: 1. Select the product: [https://app.cryptolens.io/Product](https://app.cryptolens.io/Product) 2. Press Create New Key 3. Fill in all the parameters (such as set time, features, etc.) 4. Press on the \ button. 5. Copy the link in the textbox. Done! If you try to visit the link, you will notice that a new key will be returned. If you prefer to get a json object instead, please add \&json=true . # Key verification Source: https://help.cryptolens.io/examples/key-verification This guide shows the steps to perform a simple key verification using one of our SDKs/libraries.