Package Exports
- yunpian-sdk
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yunpian-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
YunPian SDK For Node.js
Minimum, Flexible, Scalable.
支持Lazy Require。
Table of Contents generated with DocToc
安装和使用
国际惯例:
npm install yunpian-sdk --save
公共参数:
var options = {
apikey: 'xxxxxxx'
};
ES5:
var YUNPIAN = require('yunpian-sdk');
// 加载全部方法
var user = new YUNPIAN.USER({
apikey: 'xxxx'
});
// 或加载某些方法
var user = new YUNPIAN.USER({
apikey: 'xxxx'
}, ['get', 'set']);
// 或加载某个方法
var user = new YUNPIAN.USER({
apikey: 'xxxx'
}, 'get');
user.set({
emergency_contact: 'Willin',
emergency_mobile: '1xxxxxxxxxx'
}).then(function(result){
// xxxx
});
ES7:
import {USER} from 'yunpian-sdk';
const user = new USER({
apikey: 'xxxx'
});
// Within Async Func
(async() => {
const user = await user.get();
// xxxx
const result = await user.set({
emergency_contact: 'Willin',
emergency_mobile: '1xxxxxxxxxx'
});
// xxxx
});
已支持的接口
USER - 账户API
API文档参考: https://www.yunpian.com/api2.0/user.html
ES7 示例:
import {USER} from 'yunpian-sdk';
const user = new USER({
apikey: 'xxxx'
});
(async() => {
const result = await user.set({
});
// xxxx
})();
TPL - 模板API
API文档参考: https://www.yunpian.com/api2.0/tpl.html
SMS - 短信API
API文档参考: https://www.yunpian.com/api2.0/sms.html
VOICE - 语音API
API文档参考: https://www.yunpian.com/api2.0/voice.html
FLOW - 流量API
API文档参考: https://www.yunpian.com/api2.0/flow.html
License
MIT