English
Appearance
/public/content/{contentId}/comment
Post a comment on a specific piece of content, optionally with an image. The comment is published directly to the platform and includes an ID, message, author, and timestamp.
Authorization: Basic Base64(AccessKey:SecretKey)
contentId
string
accountId
text
image
commentId
object
The same format as the Image Object of Send Message.
url
mimetype
image/jpeg
image/png
thumbnail
The image is sent by URL
The url must be public and point straight at the file. You can host the image in Repliz Storage, see the Storage Upload guide.
{ "accountId": "680affa5ce12f2f72916f67e", "text": "Thank you for your comment!", "image": { "url": "https://storage.repliz.com/uploads/repliz-thank-you.png", "thumbnail": "https://storage.repliz.com/uploads/repliz-thank-you-thumbnail.png", "mimetype": "image/png" } }
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 '{"accountId":"680affa5ce12f2f72916f67e","text":"This is a comment"}'
import axios from 'axios'; const contentId = '113958387982006_942538351814577'; const response = await axios.post(`https://api.repliz.com/public/content/${contentId}/comment`, { "accountId": "680affa5ce12f2f72916f67e", "text": "This is a comment" }, { auth: { username: 'YOUR_ACCESS_KEY', password: 'YOUR_SECRET_KEY' } }); console.log(response.data);
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({ "accountId": "680affa5ce12f2f72916f67e", "text": "This is a comment" }) }); const data = await response.json(); console.log(data);
{ "commentId": "942538351814577_1677536300098026" }
// Account Not Found { "code": 404, "message": "account not found" } // Comment Not Found { "code": 404, "message": "comment not found" }
{ "code": 401, "message": "unauthorized" }
Create Comment
POST/public/content/{contentId}/commentPost a comment on a specific piece of content, optionally with an image. The comment is published directly to the platform and includes an ID, message, author, and timestamp.
Endpoint Details
Authorization: Basic Base64(AccessKey:SecretKey))Parameters
contentIdstringRequest Body
accountIdstringtextstringimageis attached.commentIdstringimageobjecttext. See Image Object.Image Object
The same format as the Image Object of Send Message.
urlstringmimetypestringimage/jpegorimage/png.thumbnailstringtextis posted.textis posted.The image is sent by URL
The
urlmust be public and point straight at the file. You can host the image in Repliz Storage, see the Storage Upload guide.Example Request
Response