简体   繁体   English

如何在Postman上为BIM360张贴或修补用户角色和access_level

[英]How to POST or PATCH users role and access_level for BIM360 on Postman

I have been successful in creating a new Account User from following this tutorial: https://forge.autodesk.com/en/docs/bim360/v1/reference/http/users-POST/#example , and have used the PATCH method to set their status to active on Postman. 我已通过遵循本教程成功创建了新的Account Userhttps : //forge.autodesk.com/en/docs/bim360/v1/reference/http/users-POST/#example ,并且使用了PATCH方法将其状态设置为在Postman上active状态。

I would like to set their role and access_level but I am having trouble doing so. 我想设置他们的roleaccess_level但是这样做很麻烦。 I have followed the link below to try and perform this function, but it requires the user to already be a BIM 360 Project Admin for it to work. 我已点击下面的链接尝试执行此功能,但是它要求用户已经是BIM 360 Project Admin才能正常工作。

https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-user_id-PATCH/ https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-user_id-PATCH/

I also tried following the next link below to add a User to a project, but I am getting errors that I am unsure how to fix. 我还尝试按照下面的下一个链接将用户添加到项目中,但是我收到无法确定如何修复的错误。

https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-import-POST/ https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-import-POST/

URI: https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import URI: https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import projects /: https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import users / https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import

Method: PATCH 方法: PATCH

Authorization: ******************************************* 授权: *********************************************

Content-Type: application/json 内容类型: application/json

x-user-id: {{user_id}} x-user-id: {{user_id}}

Body: 身体:

{
  "email": "john.smith@mail.com",
  "services": {
  "document_management": {
      "access_level": "account_admin"
    }
  },
  "company_id": ************************************,
  "industry_roles": [
    ************************************
  ]
}

(The id for industry_role is IT). industry_role的ID为IT)。

Error: 错误:

{
  "code": 1004,
  "message": "this user doesn't exist."
}

I am unsure how I am getting this error since the User Id used for x-user-id is the same user_id associated with the email given in the request body. 我不确定如何收到此错误,因为用于x-user-id与与请求正文中提供的email相关联的user_id是相同的。 Is there a way to fix this or another method I can use? 有没有办法解决这个问题或我可以使用的另一种方法?

The x-user-id header is not for specifying the user to import but rather: x-user-id标头不是用于指定要导入的用户,而是:

x-user-id string In a two-legged authentication context, the app has access to all users specified by the administrator in the SaaS integrations UI. x-user-id字符串在两足身份验证上下文中,该应用程序可以访问管理员在SaaS集成UI中指定的所有用户。 By providing this header, the API call will be limited to act on behalf of only the user specified. 通过提供此标头,API调用将被限制为仅代表指定的用户执行操作。

Remove this field if that's not what you intended. 如果这不是您想要的,请删除此字段。

Verify the user id and email match each other via /GET users and /GET users:userid . 通过/ GET users/ GET users:userid验证user idemail是否彼此匹配。

And be sure to provide either the user's email or the user ID and don't provide them both: 并且确保提供用户的电子邮件或用户ID,并且不要同时提供它们:

Note that you need to specify either an email, or a user_id. 请注意,您需要指定电子邮件或user_id。 However, you cannot specify both. 但是,您不能同时指定两者。

See doc here 在这里查看文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM