diff --git a/src/dtable-web-api.js b/src/dtable-web-api.js index 77ee0124..a306a6c0 100644 --- a/src/dtable-web-api.js +++ b/src/dtable-web-api.js @@ -1464,10 +1464,10 @@ class DTableWebAPI { return this.req.get(url); } - addEmailSendTask(dtableUuid, account_name, send_to, message, subject, copy_to, reply_to, attachments, html_message, need_message_id, in_reply_to, images_info) { + addEmailSendTask(dtableUuid, account_id, send_to, message, subject, copy_to, reply_to, attachments, html_message, need_message_id, in_reply_to, images_info) { let url = this.server + '/api/v2.1/dtable-message/' + dtableUuid + '/email/'; let data = { - 'account_name': account_name, + 'account_id': account_id, 'send_to': send_to, 'message': message, 'subject': subject, @@ -1496,22 +1496,22 @@ class DTableWebAPI { return this._sendPostRequest(url, data, { headers: { 'Content-Type': 'application/json' } }); } - addWechatSendTask(dtableUuid, account_name, message, msg_type) { + addWechatSendTask(dtableUuid, account_id, message, msg_type) { let url = this.server + '/api/v2.1/dtable-message/' + dtableUuid + '/wechat/'; let data = { 'message': message, - 'account_name': account_name, + 'account_id': account_id, 'msg_type': msg_type, }; return this._sendPostRequest(url, data, { headers: { 'Content-Type': 'application/json' } }); } - addDingtalkSendTask(dtableUuid, account_name, message) { + addDingtalkSendTask(dtableUuid, account_id, message) { let url = this.server + '/api/v2.1/dtable-message/' + dtableUuid + '/dingtalk/'; let data = { 'message': message, - 'account_name': account_name, + 'account_id': account_id, }; return this._sendPostRequest(url, data, { headers: { 'Content-Type': 'application/json' } }); @@ -1649,18 +1649,18 @@ class DTableWebAPI { return this._sendPostRequest(url, data, { headers: { 'Content-Type': 'application/json' } }); } - getThirdPartyAccountsDetail(dtableUuid, account_name) { - let url = this.server + '/api/v2.1/third-party-accounts/' + dtableUuid + '/detail/?account_name=' + encodeURIComponent(account_name); + getThirdPartyAccountsDetail(workspace_id, account_id) { + let url = this.server + '/api/v2.1/workspace/' + workspace_id + '/third-party-accounts/' + account_id + '/'; return this.req.get(url); } - listThirdPartyAccounts(dtableUuid) { - let url = this.server + '/api/v2.1/third-party-accounts/' + dtableUuid + '/'; + listThirdPartyAccounts(workspace_id) { + let url = this.server + '/api/v2.1/workspace/' + workspace_id + '/third-party-accounts/'; return this.req.get(url); } - addThirdPartyAccount(dtableUuid, account_name, accout_type, detail) { - let url = this.server + '/api/v2.1/third-party-accounts/' + dtableUuid + '/'; + addThirdPartyAccount(workspace_id, account_name, accout_type, detail) { + let url = this.server + '/api/v2.1/workspace/' + workspace_id + '/third-party-accounts/'; let data = { 'account_name': account_name, 'account_type': accout_type, @@ -1669,8 +1669,8 @@ class DTableWebAPI { return this._sendPostRequest(url, data, { headers: { 'Content-Type': 'application/json' } }); } - updateThirdPartyAccount(dtableUuid, account_id, account_name, account_type, detail) { - let url = this.server + '/api/v2.1/third-party-accounts/' + dtableUuid + '/' + account_id + '/'; + updateThirdPartyAccount(workspace_id, account_id, account_name, account_type, detail) { + let url = this.server + '/api/v2.1/workspace/' + workspace_id + '/third-party-accounts/' + account_id + '/'; let data = { 'account_name': account_name, 'account_type': account_type, @@ -1679,8 +1679,8 @@ class DTableWebAPI { return this.req.put(url, data, { headers: { 'Content-Type': 'application/json' } }); } - deleteThirdPartyAccount(dtableUuid, account_id) { - let url = this.server + '/api/v2.1/third-party-accounts/' + dtableUuid + '/' + account_id + '/'; + deleteThirdPartyAccount(workspace_id, account_id) { + let url = this.server + '/api/v2.1/workspace/' + workspace_id + '/third-party-accounts/' + account_id + '/'; return this.req.delete(url); }