Skip to content

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:

FieldTypeDescription
docsarrayThe result items
totalDocsnumberTotal number of documents
limitnumberItems per page
totalPagesnumberTotal number of pages
pagenumberCurrent page
hasPrevPagebooleanWhether there's a previous page
hasNextPagebooleanWhether there's a next page
prevPagenumber | nullPrevious page number
nextPagenumber | nullNext 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:

CodeMeaning
200Success
204Success (No Content)
400Bad Request (invalid parameters)
401Unauthorized (check your credentials)
404Not Found (the resource doesn't exist)
500Internal 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