License API
...
License
Borrow Floating License
12 min
{ "tab" "examples", "url" "/api/v4/floating/borrow", "name" "/api/v4/floating/borrow", "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" \[ { "kind" "required", "name" "hardware id", "type" "string", "children" \[], "description" "unique hardware id generated for the client device" }, { "kind" "required", "name" "product", "type" "string", "children" \[], "description" "product short code" }, { "name" "borrowed until", "kind" "required", "type" "string", "description" "timestamp until license is borrowed iso 8601 format (always in utc timezone)", "children" \[] }, { "kind" "optional", "name" "license key", "type" "string", "children" \[], "description" "required if product is key based (see section below)" }, { "kind" "optional", "name" "username", "type" "string", "children" \[], "description" "required if product is user based (see section below)" }, { "name" "password", "kind" "optional", "type" "string", "description" "required if product is user based (see section below)", "children" \[] }, { "name" "license id", "kind" "optional", "type" "number", "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 for obtaining a list of licenses assigned to a user, see \\"user licenses\\"", "children" \[] } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "es8g1cukjmbnpiivt9vof", "language" "200", "code" "{\n \\"borrowed until\\" \\"2022 05 06t00 00 00z\\",\n \\"max borrow time\\" 48,\n \\"device id\\" 1648212707135009,\n \\"license id\\" 1622536481402629,\n \\"floating in use devices\\" 0,\n}", "customlabel" "" }, { "id" "7eyilksv2qgjcowesdz 2", "language" "400", "code" "{\n \\"unknown product\\" \\"provided product was not found\\",\n \\"license not found\\" \\"license with the provided license user not found\\",\n \\"license not enabled\\" \\"the license is not enabled\\",\n \\"blacklisted\\" \\"this device is blacklisted\\",\n \\"device not found\\" \\"an active device matching the hardware id not found \\",\n\n \ndodaj jos", "customlabel" "" } ], "selectedlanguageid" "es8g1cukjmbnpiivt9vof" }, "examples" { "languages" \[ { "id" "v0xppdwj6z prqfzb1ick", "language" "curl", "code" "curl location request post '/api/v4/floating/borrow' \\\\\n header 'accept application/json' \\\\\n header 'date string' \\\\\n header 'authorization string' \\\\\n data raw '{\\"hardware id\\" \\"string\\",\\"product\\" \\"string\\",\\"license key\\" \\"string\\",\\"username\\" \\"string\\"}'", "customlabel" "" }, { "id" "qsgfqls9yj7eecnveakje", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' '/api/v4/floating/borrow',\n 'headers' {\n 'accept' 'application/json',\n 'date' 'string',\n 'authorization' 'string'\n },\n body '{\\"hardware id\\" \\"string\\",\\"product\\" \\"string\\",\\"license key\\" \\"string\\",\\"username\\" \\"string\\"}'\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "hl5nweu5 mt8sh2fqtx 2", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"date\\", \\"string\\");\nmyheaders append(\\"authorization\\", \\"string\\");\n\nvar raw = \\"{\\\\\\"hardware id\\\\\\" \\\\\\"string\\\\\\",\\\\\\"product\\\\\\" \\\\\\"string\\\\\\",\\\\\\"license key\\\\\\" \\\\\\"string\\\\\\",\\\\\\"username\\\\\\" \\\\\\"string\\\\\\"}\\";\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"/api/v4/floating/borrow\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "0qrygeoue7u2ob9d3 uhc", "language" "python", "code" "import requests\n\nurl = \\"/api/v4/floating/borrow\\"\n\npayload = \\"{\\\\\\"hardware id\\\\\\" \\\\\\"string\\\\\\",\\\\\\"product\\\\\\" \\\\\\"string\\\\\\",\\\\\\"license key\\\\\\" \\\\\\"string\\\\\\",\\\\\\"username\\\\\\" \\\\\\"string\\\\\\"}\\"\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" "a7k8gbzdnazn4oq1 rzri", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"/api/v4/floating/borrow\\")\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 = \\"{\\\\\\"hardware id\\\\\\" \\\\\\"string\\\\\\",\\\\\\"product\\\\\\" \\\\\\"string\\\\\\",\\\\\\"license key\\\\\\" \\\\\\"string\\\\\\",\\\\\\"username\\\\\\" \\\\\\"string\\\\\\"}\\"\n\nresponse = http request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "v0xppdwj6z prqfzb1ick" }, "description" "borrows a floating cloud license\n", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } send null as a value for borrowed until if you wan't to set borrowed until to max borrow time from now + max borrow time value defined on a license schema request body type borrowfloatinglicenserequestbody = { // required parameters product string, hardware id string, / `borrowed until` is a string in iso 8601 format (always in utc timezone) it contains a date component and optional time component, e g "2024 09 27t23 30 48 016z" "2024 09 27 23 30 48 016" "2024 09 27 23 30 48" "2024 09 27 23 30" "2024 09 27" / borrowed until string, // required for key based products license key string, // required for user based products username string, password string, // optional parameters license id? string | undefined, } json schema response body type borrowfloatinglicenseresponsebody = { borrowed until string, // date in iso8061 format max borrow time number, // hours device id number, license id number, } json schema 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 client interactions with the license have to be authorized using a license key user based product licenses the license has a corresponding "license user" instead of a license key client interactions with the license have to be authorized using a username and password 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 missing parameters (400) some parameters are missing in the request { params } unknown product (400) provided product was not found license not found (400) license with the provided license user not found license not active (400) the license is not active license not enabled (400) the license is not enabled license borrow not allowed (400) license does not allow borrowing borrow until not valid (400) borrow until field is not valid device not found (400) an active device matching the hardware id not found blacklisted (400) this device is blacklisted floating not available (400) no available slots for floating license