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

2023-12-05

我创建了一个用于读取会议列表的应用程序,尽管我已设置权限,但我收到以下错误Meetings.

API:

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

Error:

{
  "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"
}
  • Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefMeetingsList.html

用户与应用程序权限

当应用程序通过 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。您可以通过调用权限检查接口来检查您的用户是否拥有该权限,如下:

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

您将得到如下响应。这successful属性将显示true or false取决于用户是否具有特定权限。如果您看到此错误,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"
    ]
  }
}
  • Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefCheckUserPermissions

2. 查找权限的显示名称

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

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

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

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

或者,您可以进行 API 调用来获取权限列表并查找permissionId这是Meetings这里。在下面的回复摘录中,"displayName":"Meetings App Access"设置为"id":"Meetings".

GET /restapi/v1.0/dictionary/permission

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

{
  "uri":"https://platform.ringcentral.com/restapi/v1.0/dictionary/permission?page=1&perPage=100",
  "records":[
    {
      "uri":"https://platform.ringcentral.com/restapi/v1.0/dictionary/permission/Meetings",
      "id":"Meetings",
      "displayName":"Meetings App Access",
      "assignable":true,
      "readOnly":false,
      "siteCompatible":"Independent",
      "category":{
        "uri":"https://platform.ringcentral.com/restapi/v1.0/dictionary/permission-category/Meetings",
        "id":"Meetings"
      },
      "includedPermissions":[

      ]
    }
  ]
}
  • Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefDictionaryPermissionList.html

3.给用户添加权限

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

在线帐户门户位于:

  • 生产环境:https://service.ringcentral.com
  • 沙箱环境:https://service.devtest.ringcentral.com

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

  • KB: 如何设置用户角色和权限?如何为用户分配特定角色?

它在 UI 中看起来如下所示:

enter image description here

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

RingCentral Meetings API 错误 - “用户需要拥有所请求资源的 [会议] 权限” 的相关文章

随机推荐