Get Comments

Get CommentsGET /comments.json

Retrieves multiple comments from a record in an app.
URI
https://{subdomain}.kintone.com/k/v1/record/comments.json
URI for Guest Space Apps
https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/record/comments.json

Permissions

The user or API Token must have permission to view the record to retrieve comments.

Request Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
app Integer or String Yes The App ID.
record Integer or String Yes The Record ID.
order String Optional The sort order of the Comment ID. Specifying "asc" will sort the comments in ascending order, and "desc" will sort the comments in descending order.
offset Integer Optional This skips the retrieval of the first number of comments.
"offset": 30 skips the first 30 comments, and retrieves from the 31st comment. There is no maximum for this value.
limit Integer Optional The number of records to retrieve.
"limit": 5 will retrieve the first 5 comments. The default and maximum is 10 comments.

Sample Request using Query Strings

The query string is sent by joining the request parameters with an "&", and an URL encoded query value.

HTTP Query String

app=1&record=1

Request Header

GET /k/v1/record/comments.json? app=1&record=1 HTTP/1.1
Host: example.kintone.com:443
X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=
Authorization: Basic a2ludG9uZTpkZXZlbG9wZXI=

Content-Type header is not needed.

Sample Request using JSON

Request Header

GET /k/v1/record/comments.json HTTP/1.1
Host: example.kintone.com:443
X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=
Authorization: Basic a2ludG9uZTpkZXZlbG9wZXI=
Content-Type: application/json

Specify application/json for the Content-Type.

Sample Body

{
    "app": 1,
    "record": 1,
    "order": "desc",
    "offset": 0,
    "limit": 10
}

Response Parameters

PARAMETER VALUE DESCRIPTION
comments Array An array of comments. An empty array is returned if no conditions are met.
comments[].id Integer The Comment ID.
comments[].text String The comment including the line feed codes.
If a"@" will be omitted and the name after "@" will be remained as string in the comment when the mention is placed in the comment. Repeating mention will be repeated as same time as they are appeared in the comment.
comments[].createdAt String The created date and time of the comment.
comments[].creator Object An object including information of the comment creator.
comments[].creator.code String The comment creator's user code (log in name).
comments[].creator.name String The comment creator's user name (display name).
comments[].mentions Array An array including information of mentioned users.
comments[].mentions[].code String The code of the mentioned user, group or organization.
comments[].mentions[].type String The type of the mention.
  • USER: User
  • GROUP: Group
  • ORGANIZATION: Department
older Boolean Information of older comments:
  • true: Older comments exist.
  • false: Older comments do not exist (i.e. the first comment)
newer Boolean Information of newer comments:
  • true: Newer comments exist.
  • false: Newer comments do not exist. (i.e. the last comment)

Sample Response

{
    "comments": [
        {
            "id": "3",
            "text": "user14 Thank you! Looks great.",
            "createdAt": "2016-05-09T18:29:05Z",
            "creator": {
                "code": "user13",
                "name": "user13"
            },
            "mentions": [
                {
                    "code": "user14",
                    "type": "USER"
                }
            ]
        },
        {
            "id": "2",
            "text": "user13 Global Sales APAC Taskforce \nHere is today's report.",
            "createdAt": "2016-05-09T18:27:54Z",
            "creator": {
                "code": "user14",
                "name": "user14"
            },
            "mentions": [
                {
                    "code": "user13",
                    "type": "USER"
                },
                {
                    "code": "Global Sales_1BNZeQ",
                    "type": "ORGANIZATION"
                },
                {
                    "code": "APAC Taskforce_DJrvzu",
                    "type": "GROUP"
                }
            ]
        }
    ],
    "older": false,
    "newer": false
}

Limitations

  • The maximum number of records that can be retrieved with the Get Comments API is 10.
  • An error will return if the commenting feature of the app is turned off.
  • For other limitations, check the limitations on this page
Was this article helpful?
0 out of 0 found this helpful
Comments
Please sign in to leave a comment.