api-1099207_00.js { "app": 12343, "record": 4, "comment": { "text": "来自应用管理员的通知。\n请确认。", "mentions": [ { "code": "zhou", "type": "USER" }, { "code": "市场部", "type": "ORGANIZATION" }, { "code": "devnet运营组
{ "app": 12343, "record": 4, "comment": { "text": "来自应用管理员的通知。\n请确认。", "mentions": [ { "code": "zhou", "type": "USER" }, { "code": "市场部", "type": "ORGANIZATION" }, { "code": "devnet运营组", "type": "GROUP" } ] } }api-1099207_01.js
{ "id": 3 }api-1099207_02.js
var body = { "app": 1, "record": 1001, "comment": { "text": "来自应用管理员的通知。\n请确认。", "mentions": [ { "code": "zhou", "type": "USER" }, { "code": "市场部", "type": "ORGANIZATION" }, { "code": "devnet运营部", "type": "GROUP" } ] } } kintone.api(kintone.api.url('/k/v1/record/comment', true), 'POST', body, function(resp) { //success console.log(resp); }, function(error) { //error console.log(error); });api-1099207_03.js
var body = { "app": 1, "record": 1001, "comment": { "text": "来自应用管理员的通知。\n请确认。", "mentions": [ { "code": "zhou", "type": "USER" }, { "code": "市场部", "type": "ORGANIZATION" }, { "code": "devnet运营组", "type": "GROUP" } ] }, // CSRF TOKEN: 在kintone执行API(POST, PUT, DELETE)时需要设置 "__REQUEST_TOKEN__": kintone.getRequestToken() }; var url = 'https://{subdomain}.cybozu.com/k/v1/record/comment.json'; var xhr = new XMLHttpRequest(); xhr.open('POST', url); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onload = function() { if (xhr.status === 200) { // success console.log(JSON.parse(xhr.responseText)); } else { // error console.log(JSON.parse(xhr.responseText)); } }; xhr.send(JSON.stringify(body));