Hiya DevForum!
So I have this short batch of code just to test contact with Pastebin’s API to see if I can make a paste from Roblox.
local urlEncode = function(str) return game:GetService('HttpService'):UrlEncode(str) end
local username = 'KiansjetRBX2'
local password = 'Pretend there is a password here'
local apiKey = 'bbc9e5660fae808edb770cdb4ebbdd45'
local loginUrl = 'https://pastebin.com/api/api_login.php'
local data = 'api_dev_key='..urlEncode(apiKey)..'&api_user_name='..urlEncode(username)..'&api_user_password='..urlEncode(password)
print(game:GetService('HttpService'):PostAsync(loginUrl,data))
-- Output is: Bad API request, invalid api_dev_key
I highly doubt that the problem is with my API key however. I’ve tried 2 other accounts with different API keys, and all have led me to the same error. (POSTing to the url with a blank string yields the same error) This leads me to believe that I am doing something wrong. I looked around a bit and I found this paste in which the author seems to be trying to do the exact same thing I’m doing (line 47), except in plain lua. Can anyone help with why Pastebin (apparently) can’t read the data I’m sending it?