autodesk-forgeautodesk-construction-cloud

ACC users:import endpoint does nothing in ACC


I am calling ACC's users:import endpoint to add multiple users to a project at once (I am currently adding only 2 users). After I make the call (via 2-legged Oauth), the endpoint returns a jobId like it says it should in the docs See Doc Here, but the added users never show up in the project on ACC. I have tried this with multiple different projects (which I have confirmed are active) with multiple different users, but the change never reflects in ACC. I have also tried the call with and without a project admin included. Below is the exact request and response that I performed/received (with potentially sensitive values replaced with {} ):

URL: https://developer.api.autodesk.com/construction/admin/v2/projects/{project_id_here}/users:import

Headers: {
  "Authorization": "Bearer {token_here}",
  "Content-Type": "application/json",
  "User-Id": "{user_id_here}"
}

Data: {
  "users": [
    {
      "firstName": "nya",
      "lastName": "nyaa",
      "email": "nya.nyaa@mail.com",
      "companyId": {company_id_here},
      "roleIds": [
        "287d5cc2-9008-462c-96e5-c9491db85d97",
        "cda845af-05f0-4c46-9108-71b993946c35",
        "b8e84a73-7506-4d3f-b221-93691df2a359"
      ],
      "products": [
        {
          "key": "projectAdministration",
          "access": "none"
        },
        {
          "key": "designCollaboration",
          "access": "member"
        },
        {
          "key": "build",
          "access": "member"
        },
        {
          "key": "cost",
          "access": "member"
        },
        {
          "key": "modelCoordination",
          "access": "member"
        },
        {
          "key": "docs",
          "access": "member"
        },
        {
          "key": "insight",
          "access": "member"
        },
        {
          "key": "takeoff",
          "access": "member"
        }
      ]
    },
    {
      "firstName": "nya",
      "lastName": "two",
      "email": "nya.two@mail.com",
      "companyId": {company_id_here},
      "roleIds": [
        "287d5cc2-9008-462c-96e5-c9491db85d97",
        "cda845af-05f0-4c46-9108-71b993946c35",
        "b8e84a73-7506-4d3f-b221-93691df2a359"
      ],
      "products": [
        {
          "key": "projectAdministration",
          "access": "none"
        },
        {
          "key": "designCollaboration",
          "access": "member"
        },
        {
          "key": "build",
          "access": "member"
        },
        {
          "key": "cost",
          "access": "member"
        },
        {
          "key": "modelCoordination",
          "access": "member"
        },
        {
          "key": "docs",
          "access": "member"
        },
        {
          "key": "insight",
          "access": "member"
        },
        {
          "key": "takeoff",
          "access": "member"
        }
      ]
    }
  ]
}

Received response:
{
  "jobId": "1956810c-40da-4d20-853d-5010ce9c0697"
}

Solution

  • It turns out the issue was with the roleID's. These were not valid roles in the project, but Autodesk currently provides no clear means of finding the roleID's for a given project and the docs for these requests do not mention how to retrieve the roleID's. Luckily, someone else here recently had the same issue and found out that the roleID retrieval endpoint for BIM 360 still works for ACC (for now at least), so this can be used to retrieve the roleID's to make sure that they are valid in this request. What's clear though is that the Autodesk docs seriously need to be updated and that this endpoint in my original question is missing some proper error handling.