Skip to main content

Getting Started

info

This and following pages are about the Website API. If you would like to know more about how to use the API in your Start App, visit Getting Started here instead.

Learn how to use your API key to make successful website API calls and avoid rate limits or blocks. Basic Authentication is required for all requests.

warning

To ensure security and accountability, always use your own account credentials. Avoid giving admin access to restricted users, as this compromises both integrity and traceability.

All API requests must include your API key, username, and a SHA-256 hashed password in the request body. Requests missing any of these will be rejected and may result in your IP being blocked.

Example:

If your API key is 123456abcd, your username is test, and your password is super secret, the JSON object should look like:

{
"apiKey": "123456abcd",
"username": "test",
"password": "EABD522910CCDD77AEF079FEFF0C7BB6486F6AB207AE6D3ED9E671208C92AB0F"
}

To hash your password, use a tool like this SHA-256 generator. Be sure to select Hex (uppercase) for the output format.

Request format

To fight against scrapers, tooling and bad actors, the JSON structure is not being sent in plaintext and is encoded in Base64 with a prefix instead to our servers.

Encode the JSON object in Base64 and add the prefix PanelRequest to create a valid body.

Example:

Let's try sending a request to list all Apps:

  1. Check the app docs and look for the list request.
  2. Use all object parameters and set the correct data for optional fields.
  3. Encode it.

After following the steps, the structure:

{
"apiKey": "123456abcd",
"username": "test",
"password": "EABD522910CCDD77AEF079FEFF0C7BB6486F6AB207AE6D3ED9E671208C92AB0F",
"type": "app",
"action": "list"
}

Should encode to this:

PanelRequesteyJBUElLZXkiOiIxMjM0NTZhYmNkIiwidXNlcm5hbWUiOiJ0ZXN0IiwicGFzc3dvcmQiOiJFQUJENTIyOTEwQ0NERDc3QUVGMDc5RkVGRjBDN0JCNjQ4NkY2QUIyMDdBRTZEM0VEOUU2NzEyMDhDOTJBQjBGIiwidHlwZSI6ImFwcCIsImFjdGlvbiI6Imxpc3QifQ==

Code Examples

async function sendRequest() {
const payload = {
apiKey: "<API Key>",
username: "<username>",
password: "<SHA-256 encoded password in uppercase>",
type: "app",
action: "list",
};

// Convert the JSON to a string and encode it
const jsonString = JSON.stringify(payload);
const encoded = "PanelRequest" + btoa(jsonString);

try {
// Send request with body
const response = await fetch("https://api.dtc.zone", {
method: "POST",
headers: {
"Content-Type": "text/plain",
},
body: encoded,
});

if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}

// data should be a JSON if the response is OK
const data = await response.json();
console.log(data);
} catch (error) {
console.error("JS error: " + error.message);
}
}