So I’m trying to use Soldier’s ranking API for automatic promotion and stuff, and I used the code below.
local http = game:GetService("HttpService")
local api = "https://api.soldier-bot.tk/ranking/rank"
local auth = ""
local data = {
['robloxId'] = 1200418133;
['username'] = "DhaniWork";
['rank'] = 2
}
local encodedData = http:JSONEncode(data)
http:PostAsync(api, encodedData, Enum.HttpContentType.ApplicationJson, false, {['apikey'] = auth})
player:Kick("You have been promoted.")
(I removed the auth key and changed the username to another person.)
I believe I did it as intended in the picture below.
Which I took from a code written by the API owner, and now it just errors “Unauthorized”. So I believe I’m gonna ask the person who made the API instead.