Click or drag to resize

KeyActivate Method

This method will perform a key activation, similar to Activate [Web API 2]. 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, etc. If 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://serialkeymanager.com/docs/api/v3/Activate

Namespace:  SKM.V3.Methods
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public static KeyInfoResult Activate(
	string token,
	ActivateModel parameters
)

Parameters

token
Type: SystemString
The access token. Read more at https://serialkeymanager.com/docs/api/v3/Auth
parameters
Type: SKM.V3.ModelsActivateModel
The parameters that the method needs.

Return Value

Type: KeyInfoResult
A BasicResult or null.
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.
• 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.
Examples
Assuming that you've created a key in the SKM platform that has maximum number of machines set to anything greater than zero, we can run the following code:
Activation example
var auth = "{access token with permission to access the activate method}"
var result = Key.Activate(token: auth, parameters: new ActivateModel()
{
    Key = "GEBNC-WZZJD-VJIHG-GCMVD",
    ProductId = 3349,
    Sign = true,
    MachineCode = SKGL.SKM.getMachineCode(SKGL.SKM.getSHA1);
});

if(result == null || result.Result == ResultType.Error)
{
    // an error occured or the key is invalid or it cannot be activated
    // (eg. the limit of activated devices was achieved)
}
// everything went fine if we are here!
See Also