I have a roblox studio lua script but the api is outdated

noreality
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2024

this is script please fix it because it says 404 not found: local cardsData = trello.GetRequest("https://api.trello.com/1/lists" .. trello.BanListID .. "/cards")
local cardsList = httpService:JSONDecode(cardsData)

seprate script but both need to be fixed

 

local trello = {}
trello.Key = script.Key.Value
trello.Secret = script.Secret.Value
trello.QueryParams = "key=" .. trello.Key .. "&token=" .. trello.Secret -- Add equal sign here
trello.BanListID = "cant say"
local httpService = game:GetService("HttpService")
function trello.GetRequest(url)
local request = url .. "?" .. trello.QueryParams
local response = httpService:GetAsync(request)
return response
end
function trello.PostRequest(url, queryData)
queryData['key'] = trello.Key
queryData['token'] = trello.Secret
for name, value in pairs(queryData) do
if not string.match(url, "?") then
url = url .. "?" .. name .. "=" .. value
else
url = url .. "&" .. name .. "=" ..  value
end
end
local request = {
['Url'] = url,
['Method'] = "POST", -- Fix typo here
['Headers'] = {
['Accept'] = "applications/json"
},
['Data'] = httpService:JSONEncode(queryData) -- Set Data field to queryData
}
local response = httpService:RequestAsync(request)
return response
end
return trello

 

4 answers

1 vote
Premium Solutions November 7, 2024

It seems that there are a few issues with your script. Here are the modifications that should fix the errors:

1. **404 Not Found**: This might be due to an incorrect URL format. Make sure there’s a `/` after `lists` in the URL.
2. **Typo in Method**: Ensure `Method` is set correctly.
3. **Data Field**: Use the `Body` field instead of `Data` for `RequestAsync`.

Here’s an updated version of your script with fixes:

```lua
local trello = {}
local httpService = game:GetService("HttpService")

-- Set up keys and tokens
trello.Key = script.Key.Value
trello.Secret = script.Secret.Value
trello.QueryParams = "key=" .. trello.Key .. "&token=" .. trello.Secret
trello.BanListID = "cant say"

-- Function to get data from Trello
function trello.GetRequest(url)
local requestUrl = url .. "?" .. trello.QueryParams
local response = httpService:GetAsync(requestUrl)
return response
end

-- Function to post data to Trello
function trello.PostRequest(url, queryData)
queryData['key'] = trello.Key
queryData['token'] = trello.Secret

-- Build query parameters
for name, value in pairs(queryData) do
if not string.match(url, "?") then
url = url .. "?" .. name .. "=" .. value
else
url = url .. "&" .. name .. "=" .. value
end
end

-- Set up request parameters
local request = {
Url = url,
Method = "POST",
Headers = {
["Accept"] = "application/json"
},
Body = httpService:JSONEncode(queryData) -- Use Body field instead of Data
}

-- Send the request
local response = httpService:RequestAsync(request)
return response
end

-- Example of how to use GetRequest with corrected URL
local cardsData = trello.GetRequest("https://api.trello.com/1/lists/" .. trello.BanListID .. "/cards")
local cardsList = httpService:JSONDecode(cardsData)

return trello
```

**Key changes**:
- Added a `/` after `"lists"` in the URL in `GetRequest`.
- Changed `Data` to `Body` in `RequestAsync`.
- Fixed `application/json` typo and other minor syntax adjustments.

This should resolve the issues and make your script compatible with the updated API. Visit taradownloader for more details.

0 votes
Ban Sake October 9, 2024

 I would say there are multiple executors there online that incorporate lua script and can elevate your scripting experience. to name a few are Fluxus, delta, and codex,

 

0 votes
Caspar Wallstab
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2024

Interesting thing is that hydrogenexecutor.app still be able to bypass the jira

0 votes
Mutya A
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 25, 2024

Hi there,

I tested the API endpoint you are using and it's working well. For any 404 errors, please look at typo errors in the full URI you are making the Get request to. In this case it is missing the '/' after the '1/lists':


trello.GetRequest("https://api.trello.com/1/lists" .. trello.BanListID .. "/cards")  

For the rest of the script, I would highly recommend to review the information provided below and make sure you are using the correct API for making a Post request. 

[Trello API] Get Cards in a List:
https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-cards-get 

Also, for any coding or developer related inquiries, you can share your questions in our Trello developer community. We have a number of Trello Engineers that are active there, and they'd be happy to give some guidance for more advanced topics like these: https://community.developer.atlassian.com/c/trello

I hope this helps, but let us know if you have any questions!
----------------
If this post helps with your query, then please consider the Accept answer or Like button to help the other users find it more quickly.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events