Comment Model

General comment structure of the record on kintone restAPI

Comment

Constructor

Parameter

(none)

Methods

getId

Get the Comment ID.

Declaration

func getId() -> Int?

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    Integer commentID = comment.getId();

getText

Get the comment including the line feed codes.

Declaration

func getText() -> String?

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    String commentText = comment.getText();

getCreatedAt

Get the created date and time of the comment.

Declaration

func getCreatedAt() -> Date?

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    Date commentCreatedAt = comment.getCreatedAt();

getCreator

Get an object including information of the comment creator.

Declaration

func getCreator() -> Member?

Parameter

(none)

Return

Member

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    Member commentCreator = comment.getCreator();

getMentions

Get an array including information of mentioned users.

Declaration

func getMentions() -> [CommentMention]?

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    List commentMentions = comment.getMentions();

CommentContent

Constructor

Parameter

(none)

Methods

setText

set the comment including the line feed codes.

Declaration

func setText(_ text: String)

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();
    ArrayList mentionList = 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

Get an array including information of mentioned users.

Declaration

func setMentions(_ mentions: [CommentMention]?)

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();
    ArrayList mentionList = 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.

Declaration

func getCode() -> String?

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    List commentMentions = comment.getMentions();
    CommentMention mention = commentMentions.get(0);
    String mentionUserCode = mention.getCode();

setCode

set the comment including the line feed codes.

Declaration

func setCode(_ code: String)

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();
    ArrayList mentionList = 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.

Declaration

func getType() -> String?

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);

    ArrayList resultComments = response.getComments();
    Comment comment = resultComments.get(0);
    List commentMentions = comment.getMentions();
    CommentMention mention = commentMentions.get(0);
    String mentionUserType= mention.getType();

setType

Get an array including information of mentioned users.

Declaration

func setType(_ type: String)

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();
    ArrayList mentionList = 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.

Declaration

func getComments() -> [Comment]?

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);

    ArrayList resultComments = response.getComments();

getOlder

Get information of older comments.

Declaration

func getOlder() -> Bool

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.

Declaration

func getNewer() -> Bool

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.

Declaration

func getId() -> Int?

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();
    ArrayList mentionList = 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();