English
English
Appearance
English
English
Appearance
Make your first Repliz API calls in under five minutes. This guide walks you through the basics.
First, confirm your API credentials are working by fetching your connected accounts:
curl -X GET "https://api.repliz.com/public/account?page=1&limit=20" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"import axios from 'axios';
const response = await axios.get('https://api.repliz.com/public/account', {
params: { page: 1, limit: 20 },
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY'
}
});
console.log(response.data);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch('https://api.repliz.com/public/account?page=1&limit=20', {
headers: {
'Authorization': `Basic ${credentials}`
}
});
const data = await response.json();
console.log(data);A successful response returns a paginated list of your connected accounts:
{
"docs": [
{
"_id": "69800c55117d9be562a32680",
"name": "Kaboom",
"username": "kaboombakudan",
"isConnected": true,
"type": "tiktok"
}
],
"totalDocs": 6,
"limit": 20,
"totalPages": 1,
"page": 1
}See how many accounts you have connected across all platforms:
curl -X GET "https://api.repliz.com/public/account/count" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"const response = await axios.get('https://api.repliz.com/public/account/count', {
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY'
}
});const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch('https://api.repliz.com/public/account/count', {
headers: {
'Authorization': `Basic ${credentials}`
}
});Response:
{
"total": 15,
"facebook": 6,
"youtube": 1,
"instagram": 2,
"threads": 2,
"tiktok": 3,
"linkedin": 1,
"twitter": 0,
"shopee": 0,
"limit": 1
}Pull comments that have been collected and stored in Repliz:
curl -X GET "https://api.repliz.com/public/comment?page=1&limit=20&status=pending" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"const response = await axios.get('https://api.repliz.com/public/comment', {
params: { page: 1, limit: 20, status: 'pending' },
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY'
}
});const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch('https://api.repliz.com/public/comment?page=1&limit=20&status=pending', {
headers: {
'Authorization': `Basic ${credentials}`
}
});Send a reply to a specific comment:
curl -X POST "https://api.repliz.com/public/comment/COMMENT_ID" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{ "text": "Thank you for your comment!" }'const commentId = 'COMMENT_ID';
const response = await axios.post(`https://api.repliz.com/public/comment/${commentId}`, {
text: 'Thank you for your comment!'
}, {
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY'
}
});const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const commentId = 'COMMENT_ID';
const response = await fetch(`https://api.repliz.com/public/comment/${commentId}`, {
method: 'POST',
headers: {
'Authorization': `Basic ${credentials}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'Thank you for your comment!'
})
});List endpoints return a paginated response with this structure:
| Field | Type | Description |
|---|---|---|
docs | array | The result items |
totalDocs | number | Total number of documents |
limit | number | Items per page |
totalPages | number | Total number of pages |
page | number | Current page |
hasPrevPage | boolean | Whether there's a previous page |
hasNextPage | boolean | Whether there's a next page |
prevPage | number | null | Previous page number |
nextPage | number | null | Next page number |
When something goes wrong, the API returns a JSON object with a code and message:
{
"code": 404,
"message": "account not found"
}Common HTTP status codes:
| Code | Meaning |
|---|---|
200 | Success |
204 | Success (No Content) |
400 | Bad Request (invalid parameters) |
401 | Unauthorized (check your credentials) |
404 | Not Found (the resource doesn't exist) |
500 | Internal Server Error |