Apideck 节点.js SDK
⚠️ 废弃通知:此SDK已贬值,将于2025年5月31日存档. 请向 新建 SDK 在这个日期之前 在2025年5月31日之后,这个寄存器将被存档,不再收到任何更新. 为了在过渡期间支持你,请参见我们 移徙指南。 。 。 .
目录
安装
使用 npm 安装最新的 SDK :
$ npm install @apideck/node
或者亚伦
$ yarn add @apideck/node
开始
该模块支持所有Apideck API端点. 关于API的完整信息, 头 页:1 文档。 。 。 .
配置
一个新的 Apideck 实例通过在所需的设置中传递到配置中而初始化 .
import Apideck from '@apideck/node';
const apideck = new Apideck({
apiKey: '<insert-api-key-here>',
appId: '<insert-application-id-here>',
consumerId: '<insert-consumer-id-here>'
})
const { crm } = apideck
顶级参数(apiKey除外)可以在特定资源调用中被覆盖.
// Declare Unify Api to use
const { crm } = apideck
// Override consumerId serviceId as declared in initial configuration for this operation.
const response = await crm.contactsAll({
// serviceId: 'salesforce', // optional
limit: '10'
})
示例
获取所有联系人列表并用新地址更新第一个记录 .
import Apideck, { PhoneNumberType } from '@apideck/node';
const apideck = new Apideck({
apiKey: '<insert-api-key-here>',
appId: '<insert-application-id-here>',
consumerId: '<insert-consumer-id-here>'
})
const { crm } = apideck
const { data } = await crm.contactsAll({
limit: 10
})
const result = await crm.contactsUpdate({
id: data[0].id!,
contact: {
name: "John Doe",
first_name: "John",
last_name: "Doe",
addresses: [{
city: "Hoboken",
line1: "Streetname 19",
state: "NY"
}],
phone_numbers: [{
number: '0486565656',
phoneType: PhoneNumberType.Home
}]
}
})
console.info(result)
Apideck 统一爱皮斯
目前有以下Apis:
会计Api
读取 AccountApi 的全部文档 这里。 。 。 .
阿兹阿皮
读取 AtsApi 的全部文档 这里。 。 。 .
连接符Api
读取连接符Api的全部文档 这里。 。 。 .
CrmApi 图像
读取 CrmApi 的全部文档 这里。 。 。 .
电子商务Api
读取 EcommerceApi 的全部文档 这里。 。 。 .
文件图像Api
读取文件StorageApi的全部文档 这里。 。 。 .
红外线
读取 HrisApi 的全部文档 这里。 。 。 .
问题跟踪Api
读取问题跟踪的完整文档 这里。 。 。 .
铅Api
读取 leadApi 的全部文档 这里。 。 。 .
波斯阿皮语Name
读取 PosApi 的全部文档 这里。 。 。 .
斯姆萨皮语Name
读取 SmsApi 的全部文档 这里。 。 。 .
默认阿皮
读取 VaultApi 的全部文档 这里。 。 。 .
网络地图Api
读取 WebhookApi 的全部文档 这里。 。 。 .
用户
上传文件
使用文件存储 API 上传文件的工具 . uploadFile 将自动为大于 4MB 的文件使用上传会话。 较小的文件会用简单的上传呼叫上传.
示例使用
const apideck = new Apideck({
apiKey: '<insert-api-key-here>',
appId: '<insert-application-id-here>',
consumerId: '<insert-consumer-id-here>'
});
const file = await apideck.utils.uploadFile({
serviceId: 'dropbox',
file: buffer, // Buffer | string
name: "test.jpg",
size: fileSize, // file size in bytes
contentType: "image/jpg", // optional
});
支助
打开一个 问题来啊!