License API
License Activation/Deactivatio...
Deactivate License (Offline Method)
14 min
currently we support trial, perpetual and consumption license types for offline deactivation purposes { "tab" "examples", "url" "/api/v4/deactivate offline", "name" "/api/v4/deactivate offline", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "kind" "required", "name" "date", "type" "string", "children" \[], "description" "in rfc7231 format (see \\"license api authorization\\"), eg thu, 17 nov 2022 20 51 35 gmt" }, { "kind" "required", "name" "authorization", "type" "string", "children" \[], "description" "see \\"license api authorization\\" article" } ], "bodydataparameters" \[ { "name" "base64 encoded json object", "kind" "required", "type" "object", "description" "the request body is a base64 encoded stringified json object containing the properties below see the \\"finalized payload\\" section for examples on how to generate this payload", "children" \[ { "name" "api key or client id", "kind" "required", "type" "string", "description" "company api key" }, { "name" "date", "kind" "required", "type" "string", "description" "in rfc7231 format (see \\"license api authorization\\"), eg thu, 17 nov 2022 20 51 35 gmt" }, { "name" "request id", "kind" "required", "type" "string", "description" "custom unique id used to identify the request" }, { "name" "request", "kind" "required", "type" "string", "description" "determines the type of request \\"activation\\" or \\"deactivation\\"" }, { "name" "signature", "kind" "required", "type" "string", "description" "calculated request signature (see section below)" }, { "name" "product", "kind" "required", "type" "string", "description" "product short code" }, { "name" "hardware id", "kind" "required", "type" "string", "description" "unique hardware id generated for the client device" }, { "name" "license key", "kind" "optional", "type" "string", "description" "required if product is key based (see section below)" }, { "name" "username", "kind" "optional", "type" "string", "description" "required if product is user based (see section below)" }, { "name" "license id", "kind" "optional", "type" "string", "description" "ensures that the action affects only the license with the specified id this is useful if e g you have multiple licenses for the same product assigned to the same user" }, { "name" "sdk ver", "kind" "optional", "type" "string", "description" "sdk version string which will be logged" }, { "name" "consumptions", "kind" "optional", "type" "number", "description" "increases/decreases total consumptions" }, { "name" "product features", "kind" "optional", "type" "array", "description" "an array of `{ \\"feature\\" string, \\"consumptons\\" number }` objects which will add consumptions to those license features the consumption number may be negative if negative consumptions are allowed on the license" } ], "schema" \[ { "name" "api key or client id", "kind" "required", "type" "string", "description" "company api key" }, { "name" "date", "kind" "required", "type" "string", "description" "in rfc7231 format (see \\"license api authorization\\"), eg thu, 17 nov 2022 20 51 35 gmt" }, { "name" "request id", "kind" "required", "type" "string", "description" "custom unique id used to identify the request" }, { "name" "request", "kind" "required", "type" "string", "description" "determines the type of request \\"activation\\" or \\"deactivation\\"" }, { "name" "signature", "kind" "required", "type" "string", "description" "calculated request signature (see section below)" }, { "name" "product", "kind" "required", "type" "string", "description" "product short code" }, { "name" "hardware id", "kind" "required", "type" "string", "description" "unique hardware id generated for the client device" }, { "name" "license key", "kind" "optional", "type" "string", "description" "required if product is key based (see section below)" }, { "name" "username", "kind" "optional", "type" "string", "description" "required if product is user based (see section below)" }, { "name" "license id", "kind" "optional", "type" "string", "description" "ensures that the action affects only the license with the specified id this is useful if e g you have multiple licenses for the same product assigned to the same user" }, { "name" "sdk ver", "kind" "optional", "type" "string", "description" "sdk version string which will be logged" }, { "name" "consumptions", "kind" "optional", "type" "number", "description" "increases/decreases total consumptions" }, { "name" "product features", "kind" "optional", "type" "array", "description" "an array of `{ \\"feature\\" string, \\"consumptons\\" number }` objects which will add consumptions to those license features the consumption number may be negative if negative consumptions are allowed on the license" } ] } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "es8g1cukjmbnpiivt9vof", "code" "{\n \\"request\\" \\"deactivation\\",\n \\"license key\\" \\"gawda bmrz ywel 3ktp\\",\n \\"username\\" \\"test\@example com\\", // if user based licenses\n \\"request id\\" \\"4d75 4bb1 98b3 fd58b705b52e\\",\n \\"license signature\\" \\"2/7ggln1hhvmrvchxo=\\",\n \\"validity period\\" null,\n \\"maintenance period\\" \\"2029 10 24t00 00 00 000z\\",\n \\"license type\\" \\"perpetual\\",\n \\"is trial\\" false,\n \\"product features\\" \[{\n \\"name\\" 'feature 3',\n \\"code\\" 'f3',\n \\"feature type\\" 'activation',\n \\"allow overages\\" false,\n \\"max overages\\" 0,\n \\"expiry date\\" '2022 02 25'\n },\n {\n \\"name\\" 'feature 4',\n \\"code\\" 'f4',\n \\"feature type\\" 'consumption',\n \\"max consumption\\" 10,\n \\"total consumptions\\" 0,\n \\"expiry date\\" null\n }\n ],\n \\"max activations\\" 1,\n \\"times activated\\" 0,\n \\"custom fields\\" \[\n {\n \\"name\\" \\"custom field\\",\n \\"data type\\" null,\n \\"value\\" \\"has a value\\"\n },\n {\n \\"name\\" \\"testfieldname\\",\n \\"data type\\" null,\n \\"value\\" \\"testfieldvalue\\"\n }\n ],\n \\"product details\\" {\n \\"product name\\" \\"test\\",\n \\"short code\\" \\"tt\\",\n \\"allow trial\\" true,\n \\"trial days\\" 15,\n \\"authorization method\\" \\"license key\\",\n \\"allow overages\\" true,\n \\"max overages\\" 10\n }\n}", "language" "200", "customlabel" "" }, { "id" "7eyilksv2qgjcowesdz 2", "code" "", "language" "400", "customlabel" "" } ], "selectedlanguageid" "7eyilksv2qgjcowesdz 2" }, "examples" { "languages" \[ { "id" "puj0dciaubp2lza0c4v25", "language" "curl", "code" "curl location request post '/api/v4/deactivate offline' \\\\\n header 'accept application/json' \\\\\n header 'date string' \\\\\n header 'authorization string' \\\\\n data raw ' base64 payload here '", "customlabel" "" }, { "id" " wty9a00wct4a6fyhhv1y", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' '/api/v4/deactivate offline',\n 'headers' {\n 'accept' 'application/json',\n 'date' 'string',\n 'authorization' 'string'\n },\n body buffer from(json stringify(offline payload)) tostring('base64')\n};\n\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "afnfecpndbtfvufwe8c92", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"date\\", \\"string\\");\nmyheaders append(\\"authorization\\", \\"string\\");\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body btoa(json stringify(offline payload)),\n redirect 'follow'\n};\n\nfetch(\\"/api/v4/deactivate offline\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "k0fc tzwu0tbqadtqa0hn", "language" "python", "code" "import requests\n\nurl = \\"/api/v4/deactivate offline\\"\n\npayload = \\"{\\\\\\"payload\\\\\\" \\\\\\"object\\\\\\"}\\"\nheaders = {\n 'accept' 'application/json',\n 'date' 'string',\n 'authorization' 'string'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "uo7w84epbz9ep8zce 6b1", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"/api/v4/deactivate offline\\")\n\nhttp = net http new(url host, url port);\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"date\\"] = \\"string\\"\nrequest\[\\"authorization\\"] = \\"string\\"\nrequest body = \\"{\\\\\\"payload\\\\\\" \\\\\\"object\\\\\\"}\\"\n\nresponse = http request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "afnfecpndbtfvufwe8c92" }, "description" "deactivates a license for a specific computer identified by hardware id using the ls activation req file\n", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } schema request body the request body is a string representing a base64 encoded json object containing all the required activation data if using "multipart/form data" for the request, the "file" form parameter is mandatory type licenseofflineactivationobject = ({ // for key based licenses license key string } | { // for user based licenses username string password string }) & { // required properties hardware id string product string request id string signature string date string request "activation" } & ({ api key string // for api key authorization } | { client id string // for oauth authorization }) & { // optional properties bundle code? string | undefined license id? number | undefined is vm? boolean | undefined vm info? string | undefined os ver? string | undefined hostname? string | undefined os hostname? string | undefined ip? string | undefined ip local? string | undefined app ver? string | undefined sdk ver? string | undefined mac address? string | undefined } json schema { "$schema" "https //json schema org/draft/2020 12/schema", "type" "object", "allof" \[ { "oneof" \[ { "type" "object", "properties" { "license key" { "type" "string" } }, "required" \["license key"], "additionalproperties" false }, { "type" "object", "properties" { "username" { "type" "string" }, "password" { "type" "string" } }, "required" \["username", "password"], "additionalproperties" false } ] }, { "type" "object", "properties" { "api key" { "type" "string" }, "client id" { "type" "string" }, "request" { "type" "string" }, "request id" { "type" "string" }, "date" { "type" "string" }, "signature" { "type" "string" }, "hardware id" { "type" "string" }, "product" { "type" "string" }, "bundle code" { "type" "string" }, "license id" { "type" "number" }, "is vm" { "type" "boolean" }, "vm info" { "type" "string" }, "os ver" { "type" "string" }, "hostname" { "type" "string" }, "os hostname" { "type" "string" }, "ip" { "type" "string" }, "ip local" { "type" "string" }, "app ver" { "type" "string" }, "sdk ver" { "type" "string" }, "mac address" { "type" "string" } }, "allof" \[ { "anyof" \[{ "required" \["api key"] }, { "required" \["client id"] }] }, { "anyof" \[{ "required" \["license key"] }, { "required" \["username"] }] } ], "required" \["hardware id", "product", "date", "signature"], "additionalproperties" false } ] } signature the signature value is constructed as follows the string licensespring plus a newline the string date , plus the "date" value from the license payload object, plus a newline either the "license key" or "username" value from the request payload object (which ever is present on the license, see the license authorization method section below) plus a newline the "hardware id" value from the request payload object plus a newline the "api key" value from the request payload object this complete string is then encrypted using hmac sha256 and the company shared key as the encryption key import crypto from 'node\ crypto'; const activationpayload = { // payload content }; // api key or client id depending on authorization type used const key = (activationpayload api key || activationpayload client id); // if using api key authorization the signing key is the shared key // if using oauth the signing key is the client secret const signingkey = ' '; const signingstring = 'licensespring\n' + 'date ' + activationpayload date + '\n' + (activationpayload license key || activationpayload username) + '\n' + activationpayload hardware id + '\n' + key; const signature = crypto createhmac('sha256', signingkey) update(signingstring) digest('base64'); finalized payload this object is then stringified and encoded to base64, e g js browser const activationpayload = { // payload content }; const requestbody = btoa(json stringify(activationpayload)); nodejs const activationpayload = { // payload content with "signature" property }; const requestbody = buffer from(json stringify(activationpayload)) tostring('base64'); response body if the request succeeds, the endpoint responds with the http code 200 and the string license deactivated license authorization method there are two types of product licenses based on how the client application authorizes itself to interact with a license key based product licenses each license assigned to the product requires the client to provide a license key in order to activate, check or deactivate the license (property license key in the request body) the license response object will contain the license key property, and the property product details authorization method will be the string license key user based product licenses each license assigned to the product has a corresponding "license user" instead of a license key there are multiple ways a user based product license can be accessed when making a request by providing the values for username and password for the license user by providing the values for id token and customer account code if using single sign on authentication using implicit grant by providing the values for code and customer account code if using single sign on authentication using authorization code grant in the license response object, product details authorization method will have the string value user and the response object will contain the user object with information on the license user errors if an error occurs, the response will have an http status code of 400 or higher, and the response body will contain an error description in the following format { status number, code string, message string } json schema { "$schema" "https //json schema org/draft/2020 12/schema", "type" "object", "properties" { "status" { "type" "number" }, "code" { "type" "string" }, "message" { "type" "string" } }, "required" \[ "status", "code", "message" ], "additionalproperties" false } list of exceptions missing headers (400) some headers are missing when missing authorization or date headers missing parameters (400) some parameters are missing in the request different, parameters when no request body at all or no file found in request body authorization missing params (400) some parameters are missing in authorization different, parameters when has request body but request body is not properly base 64 encoded when file is missing in request body when license key or hardware id body parameters are missing when data body parameter is missing when api key parameter is missing guide on using offline licenses if any aspect of the offline licensing model remains unclear or raises questions, we encourage you to explore our in depth guide on offline license activation docid\ feyf5uic8a7rvjq9lcz3g this resource offers a comprehensive explanation of the offline licensing process, how it operates, and ways to utilize its advantages for your specific software applications