Appearance
Quick Start
Make your first Repliz API calls in under five minutes. This guide walks you through the basics.
Step 1: Verify Your Credentials
First, confirm your API credentials are working by fetching your connected accounts:
bash
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)"javascript
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);javascript
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:
json
{
"docs": [
{
"_id": "69800c55117d9be562a32680",
"name": "Kaboom",
"username": "kaboombakudan",
"isConnected": true,
"type": "tiktok"
}
],
"totalDocs": 6,
"limit": 20,
"totalPages": 1,
"page": 1
}Step 2: Check Your Account Stats
See how many accounts you have connected across all platforms:
bash
curl -X GET "https://api.repliz.com/public/account/count" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"javascript
const response = await axios.get('https://api.repliz.com/public/account/count', {
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY'
}
});javascript
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:
json
{
"total": 15,
"facebook": 6,
"youtube": 1,
"instagram": 2,
"threads": 2,
"tiktok": 3,
"linkedin": 1,
"twitter": 0,
"shopee": 0,
"limit": 1
}Step 3: Fetch Comments
Pull comments that have been collected and stored in Repliz:
bash
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)"javascript
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'
}
});javascript
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}`
}
});Step 4: Reply to a Comment
Send a reply to a specific comment:
bash
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!" }'javascript
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'
}
});javascript
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!'
})
});Response Format
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 |
Error Handling
When something goes wrong, the API returns a JSON object with a code and message:
json
{
"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 |
What's Next?
- Read the Introduction to get a deeper understanding of how Repliz works
- Explore the full API Reference for every endpoint
- Check the Guides for common integration patterns
