Comment Model
General comment structure of the record on kintone restAPI
Comment
Constructor
Parameter
(none)
Methods
getId()
Get the Comment ID.
Parameter
(none)
Return
Integer
Sample code
get the Comment ID.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, offsset); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); Integer commentID = comment.getId();
getText()
Get the comment including the line feed codes.
Parameter
(none)
Return
String
Sample code
get the comment including the line feed codes.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); String commentText = comment.getText();
getCreatedAt()
Get the created date and time of the comment.
Parameter
(none)
Return
Date
Sample code
get the created date and time of the comment.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); Date commentCreatedAt = comment.getCreatedAt();
getCreator()
Get an object including information of the comment creator.
Parameter
(none)
Return
Sample code
get an object including information of the comment creator.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); Member commentCreator = comment.getCreator();
getMentions()
Get an array including information of mentioned users.
Parameter
(none)
Return
List<CommentMention>
Sample code
get an array including information of mentioned users.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); List commentMentions = comment.getMentions();
CommentContent
Constructor
Parameter
(none)
Methods
setText(String text)
set the comment including the line feed codes.
Parameter
Name | type | Description |
---|---|---|
text | String | The comment including the line feed codes. |
Return
(none)
Sample code
set the comment including the line feed codes.
Source code// execute ADD RECORD_COMMENT API Integer app = 1; Integer record = 1; CommentContent comment = new CommentContent(); ArrayListmentionList = new ArrayList (); CommentMention mention = new CommentMention(); mention.setCode("sample_user"); mention.setType("USER"); mentionList.add(mention); comment.setText("test comment"); comment.setMentions(mentionList); AddCommentResponse response = kintoneRecordManager.addComment(app, record, comment);
setMentions(List<CommentMention> mentions)
Get an array including information of mentioned users.
Parameter
Name | type | Description |
---|---|---|
mentions | List<CommentMention> | An array including information of mentioned users. |
Return
(none)
Sample code
get an array including information of mentioned users.
Source code// execute ADD RECORD_COMMENT API Integer app = 1; Integer record = 1; CommentContent comment = new CommentContent(); ArrayListmentionList = new ArrayList (); CommentMention mention = new CommentMention(); mention.setCode("sample_user"); mention.setType("USER"); mentionList.add(mention); comment.setText("test comment"); comment.setMentions(mentionList); AddCommentResponse response = kintoneRecordManager.addComment(app, record, comment);
CommentMention
Constructor
Parameter
(none)
Methods
getCode()
Get the code of the mentioned user, group or organization.
Parameter
(none)
Return
String
Sample code
get the code of the mentioned user, group or organization.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); List commentMentions = comment.getMentions(); CommentMention mention = commentMentions.get(0); String mentionUserCode = mention.getCode();
setCode(String code)
set the comment including the line feed codes.
Parameter
Name | type | Description |
---|---|---|
code | String | The code of the mentioned user, group or organization. |
Return
(none)
Sample code
set the comment including the line feed codes.
Source code// execute ADD RECORD_COMMENT API Integer app = 1; Integer record = 1; CommentContent comment = new CommentContent(); ArrayListmentionList = new ArrayList (); CommentMention mention = new CommentMention(); mention.setCode("sample_user"); mention.setType("USER"); mentionList.add(mention); comment.setText("test comment"); comment.setMentions(mentionList); AddCommentResponse response = kintoneRecordManager.addComment(app, record, comment);
getType()
Get the type of the mentioned user, group or organization.
Parameter
(none)
Return
String
Sample code
get the type of the mentioned user, group or organization.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; v GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, offsset); ArrayListresultComments = response.getComments(); Comment comment = resultComments.get(0); List commentMentions = comment.getMentions(); CommentMention mention = commentMentions.get(0); String mentionUserType= mention.getType();
setType(String type)
Get an array including information of mentioned users.
Parameter
Name | type | Description |
---|---|---|
type | String | The type of the mentioned user, group or organization. |
Return
(none)
Sample code
get an array including information of mentioned users.
Source code// execute ADD RECORD_COMMENT API Integer app = 1; Integer record = 1; CommentContent comment = new CommentContent(); ArrayListmentionList = new ArrayList (); CommentMention mention = new CommentMention(); mention.setCode("sample_user"); mention.setType("USER"); mentionList.add(mention); comment.setText("test comment"); comment.setMentions(mentionList); AddCommentResponse response = kintoneRecordManager.addComment(app, record, comment);
GetCommentsResponse
Constructor
Parameter
(none)
Methods
getComments()
Get the comments List on a record.
Parameter
(none)
Return
ArrayList<Comment>
Sample code
get the comments List on a record.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); ArrayListresultComments = response.getComments();
getOlder()
Get information of older comments.
Parameter
(none)
Return
Boolean
Sample code
get information of older comments.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); Boolean resultOlderFlg = response.getOlder();
getNewer()
Get information of newer comments.
Parameter
(none)
Return
Boolean
Sample code
get information of newer comments.
Source code// execute GET RECORD_COMMENTS API Integer appID = 1; Integer recordID = 1; String order = "asc"; Integer offsset = 1; Integer limit = 2; GetCommentsResponse response = kintoneRecordManager.getComments(appID, recordID, order, offsset, limit); Boolean resultNewerFlg = response.getNewer();
AddCommentResponse
Constructor
Parameter
(none)
Methods
getId()
Get the ID of comment which have just created.
Parameter
(none)
Return
Integer
Sample code
get the ID of comment which have just created.
Source code// execute ADD RECORD_COMMENT API Integer app = 1; Integer record = 1; CommentContent comment = new CommentContent(); ArrayListmentionList = new ArrayList (); CommentMention mention = new CommentMention(); mention.setCode("sample_user"); mention.setType("USER"); mentionList.add(mention); comment.setText("test comment"); comment.setMentions(mentionList); AddCommentResponse response = kintoneRecordManager.addComment(app, record, comment); Integer resultId = response.getId();