在RingCentral中,如果我们有2-3个不同的扩展,那么获得名称和所有可用扩展的详细信息的最佳API调用是什么?
例如,如果两个扩展是101和103,其中101属于John,103属于Peter,那么什么API调用会给出所有这些细节?
可以用Node.js完成吗?有什么推荐信吗?我正在为Node.js到处寻找参考资料,但没有运气。细节不多
发布于 2020-09-19 13:54:10
您可以使用Get扩展列表API来获取记录数组中的所有扩展细节。
参考文献:https://developers.ringcentral.com/api-reference/Extensions/listExtensions
对于Node编码示例:
var SDK = require('ringcentral
RINGCENTRAL_CLIENTID = 'your-app-client-id'
RINGCENTRAL_CLIENTSECRET = 'your-app-client-secret'
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com'
RINGCENTRAL_USERNAME = 'your username'
RINGCENTRAL_PASSWORD = 'your password'
RINGCENTRAL_EXTENSION = '101'
var rcsdk = new SDK({
server: RINGCENTRAL_SERVER,
appKey: RINGCENTRAL_CLIENTID,
appSecret: RINGCENTRAL_CLIENTSECRET
});
var platform = rcsdk.platform();
platform.login({
username: RINGCENTRAL_USERNAME,
password: RINGCENTRAL_PASSWORD,
extension: RINGCENTRAL_EXTENSION
})
.then(function(resp) {
read_user_info
});
function read_user_info(){
platform.get('/account/~/extension')
.then(function (resp) {
var jsonObj = resp.json()
for (var record of jsonObj.records){
console.log(JSON.stringify(record))
console.log("======")
}
})
.catch(function(e){
console.log(e.message)
});
}请参考以下内容:
https://community.ringcentral.com/questions/9528/listing-the-extension-details.html
https://stackoverflow.com/questions/63968991
复制相似问题