繁体   English   中英

使用JS-SDK调用RingCentral Call-Log API

[英]Calling RingCentral Call-Log API using the JS-SDK

我正在使用以下功能来使用JS SDK测试API调用。 我在控制台日志中返回的内容如下。 您能否检查我的代码,让我知道这里的问题。

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

此API返回的响应JSON是: [object Object]

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

    });

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

您在哪里实例化SDK?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM