0.0.1-beta.1 • Published 9 months ago

tb-openapi-sdk v0.0.1-beta.1

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Teambition Openapi SDK

中文

English

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应用的idstring-
appSecret应用的密码string-
basePath请求 API 网关地址,例如公有云为(https://open.teambition.com/api), 私有云一般为(https://PRIVATE_DOMAIN/gateway)Domain | string-