Im making a trello database for my admin and I got almost everything working except for delete.
How would you specify the delete request?
https://developers.trello.com/reference/#delete-card
Reason im not using a PREMADE trello module is because I can't find one that works so I started making my own. I looked through one of them and there delete method sends a request to herokuapp which I assume sends a standard cURL request instead of using roblox HTTPService.
Any help would be appreciated.
Perhaps this can help, from your linked docs: https://developers.trello.com/reference/#delete-card
var data = null; var xhr = new XMLHttpRequest(); xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("DELETE", "https://api.trello.com/1/cards/id"); xhr.send(data);
This is the javascript called. Then if we look at: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open
we see
Syntax XMLHttpRequest.open(method, url) method The HTTP request method to use, such as "GET", "POST", "PUT", "DELETE", etc. Ignored for non-HTTP(S) URLs. url A DOMString representing the URL to send the request to.
So that leaves you with the following problem. Roblox only has PostAsync and GetAsync, the delete request from the REST api is not implemented. See here: https://devforum.roblox.com/t/http-put-and-delete/11575/2
In the above board, people suggest you set the DELETE request through the URL, and indeed, the REST api should allow you to do anything through a POST request, including a DELETE request. I guess if nothing else works out you could always set up a php script somewhere that does the DELETE request for you when you POST to it from Roblox.
Hope this helps you out! Good luck!
So going off what Nonaz_jr was saying I did manage to find a way to get the delete function to work without having to use PHP but using plain lua
function T:RemoveCardUpdate(cardId) local http = game:GetService("HttpService") local request = { Url = "https://api.trello.com/1/cards/"..cardId.."?key="..key.."&token="..token, Method = "DELETE" } local Response = http:RequestAsync(request) end
I put this at the bottom of a Trello API model that you can get some of the functions on it don't actually work which is why I implemented my own version of the delete one.
Here is the model: https://www.roblox.com/library/214265621/Trello-API-Original
put the code at the bottom before the return function and you can follow its set up procedure and then you'll be good it at least works for me and what I am doing so I don't know if this will work for you and hopefully this helps anyone else coming along in the future.