簡體   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