With the Coding Hut API, you can make bots to help with Coding Hut and get data from the website. In thisWiki Post, we will show you how to use the Coding Hut API. You can also get a Dev Token used for the Coding Hut API endpoints needing authentication (and linking your Account of course).
API Progress
The API is still work in progress. Currently only Authentication and Orders is available.
Authentication - Logging In
To authenticate, you need to add an authentication url parameter. If your api has local storage support, you can authenticate once on the Account page and not need to do it again until the local data expires. Otherwise, you can simply add it to the end of every request. The url parameter you need to add is:
devKey - The devKey parameter lets you authenticate using your Developer Key you generated in the Account menu. You use devKey as the first part, then your API Token after. Here’s an example with a fake API Key on the account page:
https://scratch-coding-hut.github.io/account.html?devKey=ABCDEF-DEV-kEy-GoeS-HErE
Endpoints
Orders API
GET
https://scratch-coding-hut.github.io/api/orders
With the Orders API you can see how many orders were done and are pending by a staff member.
Authentication - Not necessary
URL Parameters
username - specify the username in this parameter - here’s an example:
https://scratch-coding-hut.github.io/api/orders?username=MyScratchedAccount
Example Response:
{"status": 500, "completed-orders": 6, "pending-orders": 0}
Page JavaScript Access: Required. This means that when the data is getting fetched, JavaScript needs to be enabled.