hi, i am attempting to make a basic mod system with airtable. I am trying to make a request that adds an extra record to the list I created. However, when I fire the function I get a 422 unprocessable entity error. I double checked and I am correctly encoding the table body but it still says the body is incorrect.
here is the current code I have that prints the 422 error
function Moderation.banPlayer(Player, reason)
local success, response = pcall(function()
local dictionaryResponse = HttpService:RequestAsync({
Url = URL,
Method = "POST",
Headers = {
["Content-Type"] = "application/json",
["Authorization"] = "BEARER HERE"
},
Body = HttpService:JSONEncode({
["records"] = {
["fields"] = {
["UserId"] = "2",
["Reason"] = "reason"
},
},
})
})
print(dictionaryResponse)
end)
if not success then
warn(response)
else
Moderation.kickBannedPlayer(Player)
end
Just for reference here is the API documentation’s version of the data I should be sending.