API Integration
API Overview
TDS.SO provides a REST API for programmatically managing all system features. The API supports creating redirects, managing domains, retrieving statistics, and other operations.
Base URL
https://dashboard.tds.so/api/v2/
Authentication
All API requests must include the token
parameter — your API key, which can be obtained in the settings section of the dashboard.
Store your API key securely and do not share it with third parties.
API Methods
Create Template
Endpoint: POST /create/template
Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
token | Yes | string | API key |
setting_name | Yes | string | Template name |
setting_description | No | string | Template description |
redirect_type | No | string | Redirect type (meta, js, 301, 302, iframe, etc.) |
redirect_delay | No | integer | Redirect delay (1-10 sec) |
- Request Example
- Response
POST /api/v2/create/template
token=your_api_key&setting_name=Test_Template&redirect_type=meta
{
"response": {
"template": {
"bot_list": "baidu,google,yandex,mail,vk,ok,blacklist",
"excluded_country": "",
"show_robot": 1,
"is_ban_check": 1
},
"name": "Test_Template",
"id": 19
}
}
Create Redirect
Endpoint: POST /create/redirect
Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
token | Yes | string | API key |
redirect_domains | Yes | string | Redirect domains (comma-separated) |
link_lists | Yes | string | Target URLs (comma-separated) |
template | No | string/int | Template ID or name |
- Request Example
- Response
POST /api/v2/create/redirect
token=your_api_key&redirect_domains=domain1.com,domain2.com&link_lists=https://target1.com
{
"response": {
"valid": ["http://domain1.com/xyz123"],
"invalid": ["domain2.com"]
}
}
Retrieve Data
Link List
Endpoint: GET /get/links
Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
token | Yes | string | API key |
offset | No | integer | Number of records (1-100) |
template_id | No | integer | Template ID |
Domain List
Endpoint: GET /get/domains
Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
token | Yes | string | API key |
template_id | No | integer | Template ID |
Domain Management
Check Domains
Endpoint: POST /domains/check
Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
token | Yes | string | API key |
domains_list | Yes | string | Domain list (comma-separated) |
check_vk | No | boolean | VK ban check |
Delete Domains
Endpoint: POST /domains/delete
Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
token | Yes | string | API key |
domains_list | Yes | string | Domain list (comma-separated) |
Error Handling
All errors are returned in JSON format with error
and error_id
fields:
{
"error": "Invalid token",
"error_id": 2
}
Error Codes
error_id | Description |
---|---|
0 | Panel expired |
1 | Required field not filled |
2 | Invalid API key |
3 | Invalid method name |
4 | Empty response |
5 | Parameter validation error |
Usage Examples
PHP
$token = 'your_api_key';
$url = 'https://dashboard.tds.so/api/v2/create/template';
$data = [
'token' => $token,
'setting_name' => 'Test Template',
'redirect_type' => 'meta'
];
$response = file_get_contents($url . '?' . http_build_query($data));
$result = json_decode($response, true);
Python
import requests
token = 'your_api_key'
url = 'https://dashboard.tds.so/api/v2/create/template'
data = {
'token': token,
'setting_name': 'Test Template',
'redirect_type': 'meta'
}
response = requests.post(url, data=data)
result = response.json()
JavaScript
const token = 'your_api_key';
const url = 'https://dashboard.tds.so/api/v2/create/template';
const data = {
token: token,
setting_name: 'Test Template',
redirect_type: 'meta'
};
fetch(url + '?' + new URLSearchParams(data))
.then(response => response.json())
.then(result => console.log(result));
Usage Recommendations
- Error Handling
- Always check for the
error
field in the response - Implement retries for network failures
- Use timeouts for requests
- Optimization
- Cache results where possible
- Group requests for bulk operations
- Use pagination for large lists
- Security
- Store your API key securely
- Use HTTPS for all requests
- Restrict access to your API key
Start by testing the API on a small scale before deploying it to production.