Add Comment

Add a comment to a record in an app.

MethodPOST
URLhttps://{subdomain}.kintone.com/k/v1/record/comment.json
URL(guest space)https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/record/comment.json
Authentication Password Authentication, API Token Authentication, Session Authentication
Content-Typeapplication/json

Contents

Permissions

The user or API Token must have permission to view the record to add a comment.

Request Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
app Integer or String Yes The App ID.
record Integer or String Yes The Record ID.
comment Object Yes An object including comment details.
comment.text String Yes The comment text. The maximum characters of the comment is 65535.
comment.mentions Array of Objects Optional An array including information to mention other users.
comment.mentions[].code String Optional The code the user, group or organization that will be mentioned. The maximum number of mentions is 10. The mentioned users will be placed in front of the comment text when the API succeeds.
comment.mentions[].type String Optional The type of the mentioned target.
  • USER: User
  • GROUP: Group
  • ORGANIZATION: Department

Sample Request

JavaScript (using Kintone REST API Request)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
var body = {
  'app': 1,
  'record': 1,
  'comment': {
    'text': 'sample comment',
    'mentions': [{
      'code': 'Administrator',
      'type': 'USER'
    }],
  }
};

kintone.api(kintone.api.url('/k/v1/record/comment.json', true), 'POST', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

curl Sample

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
curl -X POST 'https://{subdomain}.kintone.com/k/v1/record/comment.json' \
  -H 'X-Cybozu-API-Token: L08xCvTh7A1EVm3rZimF98R8VLP3k4lMlzELqyCx' \
  -H 'Content-Type: application/json' \
  -d '{
    "app": 1,
    "record": 1,
    "comment": {
      "text": "sample comment",
      "mentions": [{
        "code": "Administrator",
        "type": "USER"
      }]
    }
  }'

Response Parameters

PARAMETER VALUE DESCRIPTION
id String The Comment ID.

Sample Response

Body

The ID of the added comment will be returned.

1
2
3
{
  "id": "4"
}

Sample comment added by API Token.

Limitations

  • If an API Token is used to post a comment, the comment will be posted by the "Administrator" user.
  • If the mentioned name has a localized name setting, and the language of the localized name is the same as the comment poster's language settings, the mentioned name will be posted as the localized name.
  • Inactive/deleted users, departments, and groups cannot be mentioned.
  • An error will return if the commenting feature of the app is turned off.
  • For other limitations, check the limitations on this page.