Create and Publish Comment
You can optionally make this comment into a reply by passing in the optional replyto field.
You can optionally make this comment into a reply by passing in the optional replyto field.
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).
URL Arguments
- comment_conversation_id : (required) The ID of the comment stream to publish the comment to. See the Create / Update Conversation method for rules around conversationid.
BODY Properties
userid : (required) The application's userid representing the user who submitted the comment
body : (required) The body of the comment (the message). Supports unicode characters including EMOJIs and international characters.
replyto : (optional) The ID of the comment that this is a reply to.
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"
OPTIONAL BODY Properties to Create or Update a User
If the user with matching userid does not exist, the user will be created. If the user does exist, that user will be updated with whatever values you provide from this list
userid: Required. If the userid is new then the user will be created. If the userid is already in use in the database then the user will be updated.
handle: (Optional) If you are creating a user and you don't specify a handle, the system will generate one for you (using Display Name as basis if you provide that). If you request a handle and it's already in use a new handle will be generated for you and returned. Handle is an easy to type unique identifier for a user, for example @GeorgeWashington could be the handle but Display Name could be "da prez numero uno".
displayname: Optional. This is the desired name to display, typically the real name of the person.
pictureurl: Optional. The URL to the picture for this user.
profileurl: Optional. The profileurl for this user.
displayname : (required if creating a new user, otherwise optional) The non-unique name to display when showing the user's name
pictureurl : (optional) A URL to the user's photo
profileurl : (optional) A URL to the user's profile
role: Optional. Valid roles are "user" (default), "moderator" and "admin".
usercustomtags: Optional. A list of strings to attach to the user object.
customid : (optional) 250 characters for a custom ID for your app. This field is indexed for high performance object retrieval. If used, it must be unique to the scope of your application.
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
RESPONSE CODES
200 | OK : Sweet, sweet success.
204 | NoContent : The content was blocked because it contained profanity and filtermode was set to 'block'.
400 | BadRequest : Something is wrong with your request. View response message and errors list for details.
403 | Forbidden : The userid issuing the request is banned from commenting.
409 | Conflict : The customid of your event is already in use.
Parameters
Values in the path and query string.
appid path The TalkLabs application ID assigned to your account.
Example:your-app-id conversationid path The TalkLabs assigned conversation ID.
Example:conversation-id JSON body
Send as application/json.
userId The customer defined user ID from your application or identity system.
body added commentType customType customId A customer defined ID chosen by your application. TalkLabs stores it so you can retrieve the resource without keeping its TalkLabs ID.
customPayload customField1 customField2 customTags handle displayName pictureUrl profileUrl role userCustomTags {
"body": "Hello, World!",
"userId": "u-8842"
} Common variations
Historical examples filtered through the current request schema.
Create and Publish Comment
{
"body": "Hello, World!",
"userId": "u-8842"
} Create and Publish Comment (with mention)
{
"body": "Hello @honestabe!",
"userId": "u-8842"
} Create and Publish Comment (profanity test)
{
"body": "No, you're misunderstaning me, Prince Valiant. I'm saying if you were a sheep, would you fuck a sheep, if you were another sheep? We can't tolerate that in Scunthorpe.",
"userId": "u-8842"
} Create and Publish Comment (and create new user)
{
"body": "Intl: äöüÄÖÜß | Emojis: 😂🤣❤😍😒",
"handle": "dave_m",
"userId": "u-8842"
} Status codes
Every JSON response uses the API result envelope.
200 OK ApiResult 400 Bad Request ApiResult 403 Forbidden ApiResult 404 Not Found ApiResult 405 Method Not Allowed ApiResult 409 Conflict ApiResult 500 Internal Server Error ApiResult {
"message": "Success",
"errors": {},
"data": {
"kind": "comment.comment",
"id": "5edfe37586c2921148f128fc",
"appid": "5ededa7086c2920e6ccc06f8",
"conversationid": "demo-conversation-id",
"commenttype": "comment",
"added": "2020-06-09T19:31:01.5810693Z",
"modified": "2020-06-09T19:31:01.5810693Z",
"userid": "u-8842",
"user": {
"kind": "app.user",
"userid": "u-8842",
"handle": "dave_m",
"handlelowercase": "georgew",
"displayname": "Dave M.",
"pictureurl": "https://example.com/users/u-8842s/photos/original/a9/c7/a6/44-1-george-washington-18-1549729902.jpg",
"profileurl": "https://example.com/users/u-8842shington",
"banned": false
},
"body": "Hello, World! This is a comment with international characters and emojis. Intl: äöüÄÖÜß | Emojis: 😂🤣❤😍😒",
"originalbody": "",
"hashtags": [],
"customtype": "my-custom-type",
"customid": "",
"custompayload": "{ num : 0 }",
"customtags": [
"taga",
"tagb"
],
"customfield1": "/sample/userdefined1/emojis/😂🤣❤😍😒",
"customfield2": "/sample/userdefined2/intl/characters/äöüÄÖÜß",
"edited": false,
"censored": false,
"deleted": false,
"parentid": "",
"hierarchy": [],
"mentions": [],
"reactions": [],
"likecount": 0,
"replycount": 0,
"votecount": 0,
"votescore": 0,
"votes": [],
"moderation": "na",
"active": true,
"reports": []
}
}