First, let's get your SECRET_KEY. Go to config.php of Blackout and look for the text: define('SECRET_KEY', 'XXXXXXXXXXXXX'); and copy it.
Now let's verify what level of security you are using. Go to config.php and look for define('API_SECURITY', 0); check between 0, 1, and 2. If it is 1, you only need the secret_key. If it is 2, you need to generate a request code on your dashboard. If it is 3, you need to get the SECRET_KEY of your software account and verify that you have the permission dbb.admin.request.validation or dbb.*.
If you have everything, let's proceed to write the code. Note that this applies to all other code.
Create a License
Use this LUA example to generate a license via API requests. Requirements:
CLIENT (The client ID. This can only be the DISCORD_ID or the SOFTWARE_ID of the registered user.)
PRODUCT (You need to verify which product you want this to be for, remember to check products to see if it exists and what the ID_name is.)
EXPIRE (This only applies in DAYS. You can put a number between 1 to greater.)
MAXIPS (This is to know how many MAX IPS this license wants to have. It can be 1 or more.)
BOUND (Force this key to use the PRODUCT.)
CUSTOM_ADDONS (This must be together and separated by # for example: unlimited#dbb#debugg etc. [No limit.]
Perfect! It seems that everything went correctly. Now it remains to adjust the code to your liking.
Create a Group
Use this LUA example to generate a group via API requests. Requirements:
NAME (The name for the group. Mandatory.)
COLOR (It is optional. You can put a color only with #028000 or any HEX code of your preference. It is mandatory to use HEX for others and must carry the # at the beginning.)
local http =require("socket.http")local ltn12 =require("ltn12")local domain ="license.devbybit.com"local secret ="PUT_YOUR_SECRET_KEY"local type ="create"local table ="group"local name ="Developer"local color ="#028000"local params = { secret = secret, type =type, table = table, name = name, color = color}local url ="https://" .. domain .."/api.php?" ..table.concat({"secret=" .. params.secret,"type=" .. params.type,"table=" .. params.table,"name=" .. params.name,"color=" .. params.color}, "&")local response = {}local res, code, headers, status = http.request { url = url, sink = ltn12.sink.table(response)}if res thenprint("Success!")print(table.concat(response))elseprint("Error...")end
Perfect! It seems that everything went correctly. Now it remains to adjust the code to your liking.
Create a Group Permission
Use this LUA example to generate a permission via API requests. Note that creating a group is the first step to obtain the ID of it. After obtaining the ID, we will place it in group = ''. Requirements:
GROUP (The ID of the group.)
PERMISSION (The permission to insert.)
local http =require("socket.http")local ltn12 =require("ltn12")local domain ="license.devbybit.com"local secret ="PUT_YOUR_SECRET_KEY"local type ="create"local table ="group_permission"local group ="6"local permission ="dbb.*"local params = { secret = secret, type =type, table = table, group = group, permission = permission}local url ="https://" .. domain .."/api.php?" ..table.concat({"secret=" .. params.secret,"type=" .. params.type,"table=" .. params.table,"group=" .. params.group,"permission=" .. params.permission}, "&")local response = {}local res, code, headers, status = http.request { url = url, sink = ltn12.sink.table(response)}if res thenprint("Success!")print(table.concat(response))elseprint("Error...")end
Perfect! It seems that everything went correctly. Now it remains to adjust the code to your liking.
Create a Group User
Use this LUA example to insert a user via API requests. Note that creating a group is the first step to obtain the ID of it. After obtaining the ID, we will place it in group = ''. Requirements:
GROUP (The ID of the group.)
USER (The ID of the user.)
local http =require("socket.http")local ltn12 =require("ltn12")local domain ="license.devbybit.com"local secret ="PUT_YOUR_SECRET_KEY"local type ="create"local table ="group_user"local group ="6"local user ="1"local params = { secret = secret, type =type, table = table, group = group, user = user}local url ="https://" .. domain .."/api.php?" ..table.concat({"secret=" .. params.secret,"type=" .. params.type,"table=" .. params.table,"group=" .. params.group,"user=" .. params.user}, "&")local response = {}local res, code, headers, status = http.request { url = url, sink = ltn12.sink.table(response)}if res thenprint("Success!")print(table.concat(response))elseprint("Error...")end
Perfect! It seems that everything went correctly. Now it remains to adjust the code to your liking.
Create a Code
Use this LUA example to insert a user via API requests. This only works for LICENSE and ADDONS codes. Request codes will have to be generated manually. Requirements:
LICENSE OPTION
SUBTYPE (Option of the code [license / addons] In this case 'license'.)
PRODUCT (The name of the product.)
MAXIPS (The maximum IPs for the license.)
EXPIRE (Expiration in days, place a number greater than 1.)
ADDONS OPTION
SUBTYPE (Option of the code [license / addons] In this case 'addons'.)
ADDONS (It is mandatory and all must be placed in order and without spaces. For example: option1#option2#option.3#optio.ns4 etc.)
local http =require("socket.http")local ltn12 =require("ltn12")local domain ="license.devbybit.com"local secret ="PUT_YOUR_SECRET_KEY"local type ="create"local table ="code"local subtype ="license"local product ="Blackout"local maxips ="15"local expire ="366"local addons ="Options1#Unlimited#option..23#Option/15"local params = { secret = secret, type =type, table = table, subtype = subtype, product = product, maxips = maxips, expire = expire,-- addons = addons -- Use this if required}local url ="https://" .. domain .."/api.php?" ..table.concat({"secret=" .. params.secret,"type=" .. params.type,"table=" .. params.table,"subtype=" .. params.subtype,"product=" .. params.product,"maxips=" .. params.maxips,"expire=" .. params.expire,-- "addons=" .. params.addons -- Use this if required}, "&")local response = {}local res, code, headers, status = http.request { url = url, sink = ltn12.sink.table(response)}if res thenprint("Success!")print(table.concat(response))elseprint("Error...")end
Perfect! It seems that everything went correctly. Now it remains to adjust the code to your liking.
I hope this helps with your project. Keep in mind that these are example codes and are not solid bases well done. But it is an example to learn the functionality and adapt your codes.