API Integration
Tether provides a comprehensive REST API that can be integrated with any programming language or framework using standard HTTP requests. No SDK installation is required - simply make HTTP requests to our endpoints.
Making API requests
The Tether API follows RESTful conventions and uses JSON for request and response bodies. You can use any HTTP client to interact with the API.
Using cURL
cURL example
curl https://your-tether-instance.com/api/contacts \
-H "Authorization: Bearer {your-token}" \
-H "Content-Type: application/json"
Using JavaScript/Node.js
JavaScript fetch example
const response = await fetch('https://your-tether-instance.com/api/contacts', {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();
Using Python
Python requests example
import requests
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.get(
'https://your-tether-instance.com/api/contacts',
headers=headers
)
data = response.json()
Using PHP
PHP example
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://your-tether-instance.com/api/contacts',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
]
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
API conventions
Base URL
All API endpoints are prefixed with /api. For example:
- Contacts:
/api/contacts - Conversations:
/api/conversation - Messages:
/api/messages
Authentication
All requests (except webhooks and public endpoints) require a JWT token in the Authorization header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Request format
- Use
GETfor retrieving resources - Use
POSTfor creating resources - Use
PUTfor updating resources - Use
DELETEfor removing resources
Request bodies should be JSON with the Content-Type: application/json header.
Response format
All responses are JSON. Successful responses include the requested data:
{
"contacts": [...],
"totalContacts": 150,
"totalPages": 15,
"currentPage": 1
}
Error responses include an error message:
{
"error": "Not found",
"message": "The requested resource was not found"
}
HTTP status codes
| Status | Description |
|---|---|
200 OK | Request succeeded |
201 Created | Resource created successfully |
400 Bad Request | Invalid request parameters |
401 Unauthorized | Missing or invalid authentication |
403 Forbidden | Insufficient permissions |
404 Not Found | Resource not found |
500 Internal Server Error | Server error |
Rate limiting
The API implements rate limiting to ensure fair usage. If you exceed the rate limit, you will receive a 429 Too Many Requests response. Wait before retrying your request.
If you need higher rate limits for your integration, contact Tether support to discuss your requirements.
Community libraries
While Tether does not provide official SDKs, the community has created wrapper libraries for various languages. These are not officially supported but may be helpful:
Community libraries are maintained by third parties. Review their documentation and security practices before using them in production.
If you have created a library for the Tether API and would like it listed here, please contact us.