TagMangoTagMango Docs
Community

Comment on a post, or reply to a comment

POST
/api/v1/external/community/channels/{channelId}/posts/{postId}/comments

Create a top-level comment on a post, or a reply to an existing comment — give repliedComment for a reply, omit it for a top-level comment. comment is the primary content and is required unless images is given — it's only optional for an image-only comment.

Authored as the creator by default: there is no concept of an individual acting fan/UAM user for an API-key request, so commentedBy is the creator unless actingUserId is given — see that field's own description to comment as a specific subscriber instead.

This runs through the exact same creation path as a comment made from the dashboard — the same notifications to the post author and any mentioned members, and the same gamification points. Fails with a 400 if commenting is disabled on the post, if neither comment nor images is given, if actingUserId is a creator/team-member account, or if it doesn't have access to this channel.

External access policy

An API key and an authorized white-label host are required. Both tier and plan requirements are enforced.

These requirements apply to the white-label creator for backend-to-backend access. TagMango platform access is not supported.

  • Plans: Unrestricted.

  • Tiers: Unrestricted.

AuthorizationBearer <token>

In: header

Path Parameters

channelId*string

Id of the community channel the post belongs to

postId*string

Id of the post the comment belongs to

Header Parameters

x-whitelabel-host*string

Host name of the dashboard, ex: mydomain.tagmango.com

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/community/channels/61e97c146cf2b4d8c68f3a40/posts/61e97c146cf2b4d8c68f3a4a/comments" \  -H "x-whitelabel-host: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "_id": "string",
  "creator": "string",
  "channel": "string",
  "post": "string",
  "mentions": [
    "string"
  ],
  "repliedComment": "string",
  "comment": "string",
  "images": [
    "string"
  ],
  "totalLikes": 0,
  "totalReplies": 0,
  "updatedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "isEdited": false,
  "commentedBy": {
    "name": "John Doe",
    "profilePicUrl": "https://linktoprofilepic.com/pic.jpg",
    "_id": "string",
    "isModerator": true
  }
}
{
  "code": 400,
  "type": "Bad Request",
  "statusMessage": "BAD_REQUEST",
  "success": false,
  "message": "Invalid request",
  "result": "Invalid request"
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "result": "Invalid token",
  "success": false
}
{
  "code": 403,
  "type": "Forbidden",
  "statusMessage": "FORBIDDEN",
  "errorCode": "WORKSHOP_MANGO_FORBIDDEN",
  "message": "You can not access this api with a TagMango account, only available for whitelabel hosts",
  "result": "You can not access this api with a TagMango account, only available for whitelabel hosts",
  "success": false
}
{
  "code": 429,
  "type": "Too Many Requests",
  "statusMessage": "TOO_MANY_REQUESTS",
  "message": "Request limit exceeded. try after 10 seconds",
  "result": "Request limit exceeded. try after 10 seconds",
  "success": false
}