GDColon / GDBrowser

A website that lets you browse all of Geometry Dash's online features, and more!
https://gdbrowser.com
MIT License
333 stars 161 forks source link

The API, again #224

Closed masckmaster2007 closed 2 years ago

masckmaster2007 commented 2 years ago

ok so i am working into a GDBrowser, in batch i mainly use cURL for requests now i have 2 problems

  1. Can you give me an example of curl request to check if X account ID is valid with Y password. I use set on batch and so it will autofill, i just need the adress for checking credentials
  2. I would want to do a request of an username and answer me with the id only like : curl https://gdbrowser.com/... and get an awnser of 9609232 Help would be appreciated, and don't worry, i will add you to the credits Kind regards
tim-1108 commented 2 years ago

I don't know why you would want to do it in Batch, but ok.

  1. There is no direct API endpoint for checking account credentials. So I recommend using POST on https://gdbrowser.com/like just as detailed in the example, as it always returns a 200 OK code even if the comment/level has already been liked by that account and a 400 Bad Request code if something is incorrect (in this case the password or account ID).

Using cURL this should look something like this: curl -X POST https://gdbrowser.com/like -H "Content-Type: application/x-www-form-urlencoded" -d "ID=42602304&like=1&type=2&extraID=7485599&accountID=<accountID>&password=<password>"

  1. Fetching account IDs is incredibly easy and just requires you to send a request with the username to https://gdbrowser.com/api/profile/ with the username included in the request. As detailed in the Docs, the JSON response contains the accountID property (There is no endpoint for getting only the account ID).

I hope this could help you, even though this dosen't really fall into the category of an issue on GitHub :)