Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Getting the following errors with Trello?

Asked by 9 years ago

Below is the code I'm using, the actual "Trello Key" has been removed since it is a private key. The rest of the code is intact. Following the code is the exact "output" I received which contains the error which has stumped me. "07:23:47.557 - Key name is too long"

local Encode = LoadLibrary("RBXUtility").EncodeJSON
local DataStore = game:GetService("DataStoreService"):GetDataStore("Applications")
local DataToSend = {}

function Send()
    DataToSend["Name"] = game.StarterGui.ScreenGui.TextBox.Text

    local JSON = Encode(DataToSend)
    DataStore:UpdateAsync("https://api.trello.com/1/board/PRIVATETRELLOKEY",function(Old)
        local New = Old or {}
        table.insert(New,JSON)
        return New
    end)

    print("Sent")
end

script.Parent.MouseButton1Down:connect(Send)

Errors/Output: 07:23:47.556 - RbxUtility.EncodeJSON is deprecated, please use Game:GetService('HttpService'):JSONEncode() instead. 07:23:47.557 - Key name is too long 07:23:47.558 - Script 'Players.Player.PlayerGui.ScreenGui.TextButton.Trello', Line 9 07:23:47.558 - Stack End 07:23:47.559 - Disconnected event because of exception

1 answer

Log in to vote
3
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

DataStore keys can only be 50 characters. Your key (when you add the private trello key) is longer than 50 characters.

Why are you using DataStore? It doesn't send HTTP requests. You should be using HttpService if you want to send requests to the Trello website.

0
Thanks! iRealizm 25 — 9y
Ad

Answer this question