0.0.5 • Published 7 years ago
topdmc-client v0.0.5
Topdmc OpenAPI Client
Getting Started
npm install topdmc-client
var SDK = require('topdmc-client');
Documentation
(Coming soon)
Examples
var Client = require('topdmc-client');
var client = new Client({
clientId: '{clientId}',
clientSecret: '{clientSecret}',
});
// 生成授权的地址
var url = client.authorizeURL({
track_id: 200,
authorize_type: 'play',
location: 'http://www.xxx.com/music/35420596/153343016560064.mp3'
});
// 获取歌曲映射关系
client.tracks.mapping.get({
track_id: 20001
}).then(function (body) {
console.log(body);
}, function (err) {
console.log(err);
});
//ES6 yield
let mapping = yield client.tracks.mapping.get({
track_id: 20001
});
License
Copyright (c) 2015 topdmc
Licensed under the MIT license.