1

我创建了一个用于阅读会议列表的应用程序,尽管我已经设置了Meetings.

接口:

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"
}
4

1 回答 1

1

用户与应用权限

当应用程序通过 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属性将显示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用于生产)获取将用于添加此权限的权限的显示名称。

您可以通过调用权限的字典端点来获取此信息,permissionId如下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":[

      ]
    }
  ]
}

3. 给用户添加权限

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

在线帐户门户位于:

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

它在 UI 中将如下所示:

在此处输入图像描述

于 2018-06-21T23:12:59.130 回答