Reseller API Endpoint
The Reseller API is available at a dedicated endpoint for reseller and partner operations.
Endpoint
https://handbooks.io/api/graphql-reseller
Making Requests
All requests to the Reseller API should be:
- Method:
POST - Content-Type:
application/json - X-Api-Token:
<your_api_key> - Body: JSON object with
query/mutation
Basic Request Structure
{
"query": "query { health { status } }",
"variables": {}
}
Example with Variables
{
"query": "query GetCustomer($userId: String!) { handbookCustomer(userId: $userId) { email name } }",
"variables": {
"userId": "user_123"
}
}
Using cURL
curl -X POST https://handbooks.io/api/graphql-reseller \
-H "Content-Type: application/json" \
-H "X-Api-Token: your_api_token_here" \
-d '{
"query": "query { health { status timestamp } }"
}'
Using JavaScript/TypeScript
const response = await fetch('https://handbooks.io/api/graphql-reseller', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Token': 'your_api_token_here',
},
body: JSON.stringify({
query: `
query {
health {
status
timestamp
}
}
`,
}),
});
const data = await response.json();
Using GraphQL Clients
Apollo Client
import { ApolloClient, InMemoryCache, gql } from '@apollo/client';
const client = new ApolloClient({
uri: 'https://handbooks.io/api/graphql-reseller',
headers: {
'X-Api-Token': 'your_api_token_here',
},
cache: new InMemoryCache(),
});
const { data } = await client.query({
query: gql`
query {
health {
status
timestamp
}
}
`,
});
GraphQL Request
import { request, gql } from 'graphql-request';
const endpoint = 'https://handbooks.io/api/graphql-reseller';
const query = gql`
query {
health {
status
timestamp
}
}
`;
const data = await request(endpoint, query, {}, {
'X-Api-Token': 'your_api_token_here',
});
Response Format
All responses follow the GraphQL specification:
Success Response
{
"data": {
"health": {
"status": "ok",
"timestamp": "2025-01-15T10:30:00Z"
}
}
}
Error Response
{
"errors": [
{
"message": "Invalid token",
"extensions": {
"code": "UNAUTHENTICATED"
}
}
],
"data": null
}
Rate Limiting
Currently, there are no strict rate limits, but we recommend:
- Batching requests when possible
- Implementing retry logic with exponential backoff
- Caching responses when appropriate
For high-volume usage, please contact [email protected] to discuss rate limits and best practices.