【发布时间】:2018-10-14 04:16:07
【问题描述】:
我想使用 shell 脚本和 curl 从 RingCentral 提取呼叫数据。然后我会将其放入 ELK 中,以使用 Kibana 构建仪表板。但是,我不知道我在用 API 做什么。有没有人可以让我开始或一些示例代码来执行此操作?
我目前正在努力使用 curl 进行身份验证以获取令牌。目前,我不断收到不受支持的授权类型。我在沙盒中设置了应用程序和“仅服务器无 UI”。
我已经使用 bash shell 从 Centos 7 机器上运行了它。
这是尝试过的代码:
curl -X POST "https://platform.devtest.ringcentral.com/restapi/oauth/token"; \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "my client id:my client secret" \
-d "username=username&password=password&extension=<extension>&grant_type=password"
我将用户名和密码留空,因为我不确定那是什么。
输出如下:
{
"error" : "invalid_request",
"error_description" : "Unsupported grant type",
"errors" : [ {
"errorCode" : "OAU-250",
"message" : "Unsupported grant type"
} ]
}./rctest1.sh: line 2: -H: command not found
【问题讨论】:
-
请提供一些您迄今为止尝试过的示例。
-
我们可以使用更多信息,例如什么外壳、什么操作系统以及您已经尝试过的代码,以及带有错误消息的输出日志。你有没有在 RingCentral GitHub 存储库中探索过:github.com/ringcentral
-
我正在编辑原始帖子。我还将根据您的帖子查看 github.com 站点。谢谢
标签: shell api curl oauth-2.0 ringcentral