Click or drag to resize

KeyCreateKey Method

This method will create a new license key, which is the same as GenerateKey in Web API 2.

Namespace:  SKM.V3.Methods
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public static CreateKeyResult CreateKey(
	string token,
	CreateKeyModel parameters
)

Parameters

token
Type: SystemString
Details such as Token and Version.
parameters
Type: SKM.V3.ModelsCreateKeyModel
The parameters that the method needs.

Return Value

Type: CreateKeyResult
A BasicResult object or null.
Remarks
This method may, in rare cases, return null if an error has occurred. Null should be seen as an unsuccessful result.
Examples
Creating a new key
Private Sub CreateKey()
    Dim parameters = New CreateKeyModel() With {
        .ProductId = 3,
        .F1 = 1,
        .Period = 30
    }
    Dim auth = "{access token with CreateKey permission and optional product lock}"
    Dim result = Key.CreateKey(token:=auth, parameters:=parameters)
    If (result IsNot Nothing AndAlso result.Result = ResultType.Success) Then
        ' successful
        Console.WriteLine(result.Key)
    End If
End Sub
See Also