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 GET for retrieving resources
  • Use POST for creating resources
  • Use PUT for updating resources
  • Use DELETE for 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

StatusDescription
200 OKRequest succeeded
201 CreatedResource created successfully
400 Bad RequestInvalid request parameters
401 UnauthorizedMissing or invalid authentication
403 ForbiddenInsufficient permissions
404 Not FoundResource not found
500 Internal Server ErrorServer 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.


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:

If you have created a library for the Tether API and would like it listed here, please contact us.

Was this page helpful?