Skip to content

Create Comment

POST /public/content/{contentId}/comment

Post a comment on a specific piece of content. The comment is published directly to the platform and includes an ID, message, author, and timestamp.

Endpoint Details

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

Parameters

ParameterTypeRequiredDescription
contentIdstringYesThe unique identifier of the content/post.

Request Body

FieldTypeRequiredDescription
accountIdstringYesThe unique identifier of the target account to post to.
textstringYesThe message text content to send.
commentIdstringNoThe ID of the parent comment (required when replying to an existing comment).

Example Request

bash
curl -X POST "https://api.repliz.com/public/content/113958387982006_942538351814577/comment" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{}'
javascript
import axios from 'axios';

const contentId = '113958387982006_942538351814577';

const response = await axios.post(`https://api.repliz.com/public/content/${contentId}/comment`, {}, {
  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}/comment`, {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({})
});

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

Response

json
{
  "commentId": "942538351814577_1677536300098026"
}
json
// Account
{
  "code": 404,
  "message": "account not found"
}

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