https://tpm28.com/betterx/
curl -X GET "https://tpm28.com/betterx/users/johndoe"
Response:
{
"exists": true
}
curl -X POST "https://tpm28.com/betterx/users" -H "Content-Type: application/json" -d "{\"username\": \"johndoe\", \"token\": \"abc123\"}"
Response (201 Created):
{
"id": 1,
"username": "johndoe",
"token": "abc123",
"status": 1,
"appVersion": null,
"usedMoreThanHour": false,
"country": null
}
curl -X GET "https://tpm28.com/betterx/users/johndoe/status"
Response:
{
"status": 1
}
curl -X PUT "https://tpm28.com/betterx/users/johndoe/status?token=abc123" -H "Content-Type: application/json" -d "{\"status\": 0}"
curl -X PUT "https://tpm28.com/betterx/users/johndoe/app-update?token=abc123" -H "Content-Type: application/json" -d "{\"version\": \"1.0.0\", \"usedMoreThanHour\": true}"
curl -X PUT "https://tpm28.com/betterx/users/johndoe/location?token=abc123" -H "Content-Type: application/json" -d "{\"country\": \"France\"}"
curl -X POST "https://tpm28.com/betterx/users/johndoe/heartbeat?token=abc123"
The heartbeat must be sent every minute. If no heartbeat is received for more than one minute, the user's status will automatically change to "Inactive" (1).
curl -X GET "https://tpm28.com/betterx/connect-request"
Response:
{
"auth_url": "https://api.twitter.com/oauth/authorize?oauth_token=...",
"token": "<oauth_token>"
}
After user authorization, use the oauth_token and oauth_verifier to get the access token:
curl -X GET "https://tpm28.com/betterx/get-token?oauth_token=YOUR_TOKEN&oauth_verifier=YOUR_VERIFIER"
Response:
{
"oauth_token": "...",
"oauth_token_secret": "...",
"user_id": "...",
"screen_name": "..."
}
- 200 OK: Request successful
- 201 Created: User created successfully
- 400 Bad Request: Error in request (e.g., user already exists)
- 401 Unauthorized: Invalid or missing token
- 404 Not Found: User not found
- 0: Active
- 1: Inactive
- 2: DoNotDisturb