Register Event

Please log in to get a personalized configuration!

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
Parameter Description Remarks
ProductId The product id 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
Parameter Description Remarks
ProductId The product id 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

{"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.
;