RingCentral Meetings API错误-“用户需要对请求的资源具有[会议]权限”

时间:2018-06-21 21:57:18

标签: permissions user-permissions ringcentral

我已经创建了一个用于阅读会议列表的应用程序,尽管我已为Meetings设置了权限,但在下面却遇到此错误。

API:

GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/meeting

错误:

{
  "errorCode":"CMN-408",
  "message":"In order to call this API endpoint, user needs to have [Meetings] permission for requested resource.",
  "errors":[
    {
      "errorCode":"CMN-408",
      "message":"In order to call this API endpoint, user needs to have [Meetings] permission for requested resource.",
      "permissionName":"Meetings"
    }
  ],
  "permissionName":"Meetings"
}

1 个答案:

答案 0 :(得分:0)

用户与应用权限

应用程序通过REST API请求访问会议等用户资源时,将使用与该应用程序和授权该应用程序的用户相关联的访问令牌。 API可能需要应用程序和用户权限。如下所示,当权限返回错误user needs to have时,表示需要用户权限。

In order to call this API endpoint, user needs to have [Meetings] permission \
for requested resource.

有三个解决方案:

  1. 检查用户权限
  2. 查找权限的显示名称
  3. 向用户添加权限

1。检查用户权限

括号内的文本为permissionId。您可以通过调用权限检查API来检查您的用户是否具有此权限,如下所示:

GET /restapi/v1.0/account/~/extension/~/authz-profile/check?permissionId=Meetings

您将收到如下响应。 successful属性将显示truefalse,具体取决于用户是否具有特定权限。如果看到此错误,则应将successful设置为false

{
  "uri":"https://platform.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222/authz-profile/check?permissionId=Meetings&targetExtensionId=11111111",
  "successful":true,
  "details":{
    "permission":{
      "uri":"https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/Meetings",
      "id":"Meetings",
      "assignable":true,
      "readOnly":false,
      "siteCompatible":"Independent"
    },
    "effectiveRole":{
      "uri":"https://platform.ringcentral.com/restapi/v1.0/dictionary/user-role/3",
      "id":"3"
    },
    "scopes":[
      "Self"
    ]
  }
}

2。查找权限的显示名称

要向用户添加此权限,必须获取该权限的显示名称,该名称将通过在线帐户门户(用于生产的https://service.ringcentral.com)添加此权限时使用。

您可以通过调用权限的字典端点(其中permissionIdMeetings来获取此信息,如下所示。

GET /restapi/v1.0/dictionary/permission/{permissionId}
GET /restapi/v1.0/dictionary/permission/Meetings

响应将具有displayName属性,指示“会议应用程序访问”是在线帐户门户中的UI权限。

或者,您可以进行API调用以获取权限列表,并在此处查找permissionId的{​​{1}}。在下面的响应摘录中,为Meetings设置了"displayName":"Meetings App Access"

"id":"Meetings"

您将收到如下响应。为了简洁起见,我删除了所有其他权限:

GET /restapi/v1.0/dictionary/permission

3。向用户添加权限

现在转到RingCentral在线帐户门户并确保用户在其角色中具有此权限。

在线帐户门户位于:

登录后,请按照以下说明查找用户的角色,并确保该角色具有“会议应用程序访问”权限:

用户界面中的外观如下:

enter image description here