我们已尝试使用 JavaScript SDK 连接到 RingCentral 中的 RingCentral 令牌认证 URL。
https://platform.devtest.ringcentral.com/restapi/oauth/token
我们收到 Http 400(Bad Request) - Unauthorized for this grant type 错误。
400 Bad Request
{
"error": "unauthorized_client",
"error_description": "Unauthorized for this grant type",
"errors": [
{
"errorCode": "OAU-251",
"message": "Unauthorized for this grant type"
}
]
}
这是我的代码:
var SDK = require('ringcentral');
var rcsdk = new SDK({
server: SDK.server.sandbox,
appKey: 'appkey',
appSecret: 'appSecret',
redirectUri: ''
});
rcsdk.platform()
.login({
username: 'phone number', // phone number in full format
extension: 101, // leave blank if direct number is used
password: 'password'
})
.then(function(response) {
console.log(response)
})
.catch(function(e) {
console.log(e.message || 'Server cannot authorize user');
});
提前致谢