tb-openapi-sdk
v0.0.1-beta.1
Published
OpenAPI client for tb-openapi-sdk
Downloads
1
Maintainers
Readme
Teambition Openapi SDK
tb-openapi-sdk
Teambition 开放 API SDK,请求客户端使用的是 axios.
安装
npm
npm install tb-openapi-sdk --save
yarn
yarn add tb-openapi-sdk
如何使用
API 调用示例
import {Configuration, ApiClient} from '@ali/tb-openapi-sdk'
const appId = "YOU_APP_ID"
const appSecret = "YOU_APP_SECRET"
const cfg = new Configuration({appId: appId, appSecret: appSecret })
const client = new ApiClient(cfg);
const orgId = "YOU_ORG_ID"
client.tbsOrg.getOrgInfo({
header: {
xTenantId: orgId,
},
query: {
orgId: orgId
},
}).then(({data}) => {
console.log(data)
}).catch(error => {
console.info(error)
})
Configuration
构造参数:
| 参数 | 描述 | 类型 | 必须 | 默认 | | ---- | ---- | ---- | ---- | ---- | | appId | 应用的id | string | 是 | - | | appSecret | 应用的密码 | string | 是 | - | | basePath | 请求 API 网关地址,例如公有云为(https://open.teambition.com/api), 私有云一般为(https://PRIVATE_DOMAIN/gateway) | Domain | string | 否 | - |