Skip to content

Message Comment ​

POSThttps://api.repliz.com/public/content/{contentId}/message

Send a private message (DM) to the person who wrote a comment on your post, also called a private reply. The comment itself gets no public reply.

WARNING

Message comment is only supported on Facebook and Instagram. Meta allows one private reply per comment, and the person has to answer before you can send more.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey))
  • Access Tier: Gold+

Parameters ​

ParameterTypeRequiredDescription
contentIdstringYesID of the post on the platform, the id from Get Content, for example 113958387982006_942538351814577 on Facebook.

Request Body ​

FieldTypeRequiredDescription
accountIdstringYesID of the connected Facebook or Instagram account that owns the post, the _id from Get Account.
commentIdstringYesID of the comment on the platform, the id from Get Comment. The DM goes to the person who wrote it.
textstringNoText of the DM. Leave it out when you send button.
buttonobjectNoA message with link buttons instead of plain text, with text, an optional image, and 1 to 3 buttons, the same as the Button Object of Send Message.

Example Request ​

bash
curl -X POST "https://api.repliz.com/public/content/113958387982006_942538351814577/message" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "680affa5ce12f2f72916f67e",
    "commentId": "18083576267346315",
    "text": "Hello there, this is from Repliz"
  }'
javascript
import axios from 'axios';

const contentId = '113958387982006_942538351814577';

const response = await axios.post(
  `https://api.repliz.com/public/content/${contentId}/message`,
  {
    accountId: '680affa5ce12f2f72916f67e',
    commentId: '18083576267346315',
    text: 'Hello there, this is from Repliz',
  },
  {
    auth: {
      username: 'YOUR_ACCESS_KEY',
      password: 'YOUR_SECRET_KEY',
    },
  },
);

console.log(response.data);
javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');

const contentId = '113958387982006_942538351814577';

const response = await fetch(`https://api.repliz.com/public/content/${contentId}/message`, {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    accountId: '680affa5ce12f2f72916f67e',
    commentId: '18083576267346315',
    text: 'Hello there, this is from Repliz',
  }),
});

const data = await response.json();
console.log(data);

Response ​

json
{
  "messageId": "m_vN5eeDcgmLq8bDeIvh08FKDllBn-ZQje_xFEJPRwKTwzH9Og2HlvRGj_quroDpxF_fKYDuK-zJjqU6sxLZHuDw"
}
json
// Account Not Found
{
  "code": 404,
  "message": "account not found"
}

// Comment Not Found
{
  "code": 404,
  "message": "comment not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}