首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用JS-SDK调用RingCentral调用日志接口

使用JS-SDK调用RingCentral调用日志接口
EN

Stack Overflow用户
提问于 2017-12-15 09:56:19
回答 1查看 88关注 0票数 0

我正在使用下面的函数通过JS SDK测试API调用。我在控制台日志中得到的结果如下所示。你可以检查我的代码,让我知道这里有什么问题吗?

此接口返回的响应为:[object Object]

此接口返回的JSON响应为:[object Object]

代码语言:javascript
复制
app.get('/log', function(req, res) {

var authData = rcsdk.platform().auth().data();
rcsdk.platform().auth().setData(authData);
token_json = authData['access_token'] ? 
JSON.stringify(authData.access_token, null, ' ') : '';
response = token_json;

console.log("Before the/account/~/extension/~/presence");

rcsdk.platform().get('/account/~/extension/~/call-
log').then(function(apiResponse){
// If you want the response object
console.log("The response returned by this API is : " + 
apiResponse.response());
   // If you want the response object as JSON
console.log("The response JSON returned by this API is : " + 
apiResponse.json());
}); 

console.log("Outside the API Request");

res.render('index', {
authorize_uri: rcsdk.platform().authUrl({
 brandId: process.env.RC_APP_BRAND_ID,        // optional
  redirectUri: process.env.RC_APP_REDIRECT_URL // optional if 1 
configured
}),
redirect_uri: process.env.RC_APP_REDIRECT_URL,
token_json: token_json,
dibyendu_roy: response
});

    // Render home page with params

    });
EN

回答 1

Stack Overflow用户

发布于 2017-12-15 23:44:02

我不知道你想在这里实现什么。为什么从rcsdk.platform获取authData,然后用setData()重新设置它

SDK在哪里实例化?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47824745

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档