hlyapi
v0.0.2
Published
汇联易 webapi sdk
Downloads
4
Readme
汇联易webapi nodejs SDK
huilianyi webapi nodejs sdk.
- 项目地址:github
Usgae
汇联易的开发者文档地址:https://opendocs.huilianyi.com/
$ npm install hlyapi --save
配置信息
appId
和appSecret
需要超级管理员进入到管理后台
-> 侧边栏的设置
->安全设置
才能看到- baseURL: https://api.huilianyi.com // 汇联易webapi请求地址
- appId: 企业ID
- appSecret: 企业密钥
{
baseURL: 'https://api.huilianyi.com',
appId: 'i am app id from huilianyi',
appSecret: 'i am app secret from huilianyi'
}
const HlyApi = require('hlyapi')
const config = require('config').huilianyi // 配置信息参照上面⬆️
const hlyApi = new HylApi(config)
hlyApi.auth().then(token => {
// cookie 建议本地缓存 避免每次请求都重新获取
hlyApi.listExpenseReport({
// 报销单明细增量查询
startDate: '2018-01-03 17:32:31',
endDate: '2018-06-24 16:56:32'
}, token).then(res => {
console.log(res.data)
})
})
// 支持await
const HlyApi = require('hlyapi')
const config = require('config').huilianyi // 配置信息参照上面⬆️
const hlyApi = new HylApi(config)
const authToken = await hlyApi.auth()
const options = {
startDate: '2018-01-03 17:32:31',
endDate: '2018-06-24 16:56:32'
}
const result = await hlyApi.listExpenseReport(options)
console.log(result.data)
Contact
- Email: [email protected]
- github: https://github.com/CNBlackJ
Change Log
- 2019-06-13:
- token鉴权
- list: 报销单明细增量查询/借款单明细增量查询/报销单报表/费用明细报表/差旅申请报表/差旅申请报表/差旅申请报表