Skip to API content
TalkLabs API Docs v3
Recipes
POST Comments

Create / Update Conversation

If a conversation with the specified ID already exists, this will update it.

POST /api/v3/{appid}/comment/conversations

If a conversation with the specified ID already exists, this will update it.

Custom fields can be set, and can be overwritten. However, once a custom field is used it can not be set to no value (empty string).

BODY Properties

  • owneruserid : (optional) The application's userid representing the user who created the converation. If provided, this user is considered the "owner" and has full rights over the conversation space.

  • conversationid : (required) The conversation ID. This must be a URL friendly string (cannot contain / ? or other URL delimiters). Maximum length is 250 characters.

  • replaceconversationid: (optional) If you are updating an existing conversation, this will replace the ID of the conversation with the new URL friendly string and will update all comments having the old ID with the new conversation ID. For good performance, use this sparingly to avoid waiting while all affected comments are updated.

  • property : (required) The property this conversation is associated with. It is any string value you want. Typically this is the domain of your website for which you want to use commenting, if you have more than one. Examples:

    • dev, uat, stage, prod

    • website, mobile

    • site1.com, site2.com

  • moderation : (required) Specify if pre or post moderation is to be used

  • maxreports : (optional, default = 3) If this number of users flags a content item in this conversation, the item is disabled and sent to moderator queue for review

  • title : (optional) The title of the conversation

  • maxcommentlen: (optional) The maximum allowed length of a comment. Default is 256 characters. Maximum value is 10485760 (10 MB)

  • open: (optional, defaults to true) If the conversation is open people can add comments.

  • enableprofanityfilter: (optional, defaults to true) Filters comments for known profanities and replaces them with * chars.

  • added: (optional) If this timestamp is provided then the whenadded field will be overridden. You should only use this when migrating data; data is timestamped automatically. Example value: "2020-05-02T08:51:53.8140055Z"

  • customid : (optional) 250 characters for a custom ID for your app. This field is indexed for high performance object retrieval.

  • customtype : (optional) Custom type string.

  • custompayload : (optional) Custom payload string.

  • customfield1 : (optional) User custom field 1. Store any string value you want here, limit 1024 bytes.

  • customfield2 : (optional) User custom field 2. Store any string value you want here, limit 1024 bytes.

  • customtags : (optional) A comma delimited list of tags

Request

Parameters

Values in the path and query string.

appid path
string TalkLabs ID required

The appid of your app

Example: your-app-id
Request

JSON body

Send as application/json.

conversationId
string TalkLabs ID required

The TalkLabs assigned conversation ID.

ownerUserId
string customer-defined
property
string required
moderation
integer · int32 required

Defaults to postmoderation

maxReports
integer · int32
title
string
maxCommentLen
integer · int32
open
boolean
enableProfanityFilter
boolean
added
string · date-time
customType
string
customId
string customer-defined

A customer defined ID chosen by your application. TalkLabs stores it so you can retrieve the resource without keeping its TalkLabs ID.

customPayload
string
customField1
string
customField2
string
customTags
string[]
replaceConversationId
string
Request example
{
  "property": "<comment_property>",
  "moderation": "post",
  "title": "Sample Conversation",
  "open": true,
  "conversationId": "conversation-id"
}
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
404 Not Found ApiResult
500 Internal Server Error ApiResult
Example response · 200
{
  "message": "Inserted",
  "errors": {},
  "data": {
    "kind": "comment.conversation",
    "appid": "5ededa7086c2920e6ccc06f8",
    "owneruserid": "",
    "conversationid": "demo-conversation-id",
    "property": "sportstalk247.com/apidemo",
    "moderation": "post",
    "maxreports": 0,
    "enableprofanityfilter": true,
    "title": "Sample Conversation",
    "maxcommentlen": 512,
    "commentcount": 0,
    "open": true,
    "added": "2020-06-09T19:32:28.6308249Z",
    "whenmodified": "2020-06-09T19:32:28.6308249Z",
    "customtype": "",
    "customid": "/articles/2020-03-01/article1/something-very-important-happened",
    "customtags": [
      "taga",
      "tagb"
    ],
    "custompayload": "{ num : 0 }",
    "customfield1": "/sample/userdefined1/emojis/😂🤣❤😍😒",
    "customfield2": "/sample/userdefined2/intl/characters/äöüÄÖÜß"
  }
}
Search all 118 endpoints Try “join room”, “moderate”, or “POST”.
Request environment

Connect your application

These values fill request examples and the API console. They stay in this browser tab and are never sent to TalkLabs until you run a request.

Credentials are stored in sessionStorage, not in cookies or analytics.