0

I'm trying to get the list of all projects in my BIM360 Team Hub. However, I found that the API call doesn't give me the entire projects. I tried to find where the discrepancy came from, and I suspect the creation date of a project could be relevant. I found a lot of projects that were created before 2018 weren't included in my 'GET projects' response, even though I'm a project admin of all those projects.

Can anyone advise on this? Thanks!

Yongjoon Kim
  • 107
  • 1
  • 8

1 Answers1

0

How many projects do you have? Your project number might exceed the default maximum limit, please try to add a querying string page[limit].

e.g.

https://developer.api.autodesk.com/project/v1/hubs/:hub_id/projects?page[limit]=100

Commonly, you may see the following pagination fields while your total projects are too many to display, then you need to increase the display number by adding a querying string page[limit]:

"links": {
    "self": {
      "href": "/project/v1/hubs/a.hub.id.123/projects"
    },
    "first": {
        "href": "project/v1/hubs/a.hub.id.123/projects?page%5Bnumber%5D=0&page%5Blimit%5D=2"
    },
    "prev": {
        "href": "/project/v1/hubs/a.hub.id.123/projects?page%5Bnumber%5D=0&page%5Blimit%5D=2"
    },
    "next": {
        "href": "/project/v1/hubs/a.hub.id.123/projects?page%5Bnumber%5D=2&page%5Blimit%5D=2"
    }
  },

Ref: https://forge.autodesk.com/en/docs/data/v2/developers_guide/pagination/#project-and-data-service-pagination

Update

If the above doesn't work for you, you may pass an extra request header x-request-id while calling https://developer.api.autodesk.com/project/v1/hubs/:hub_id/projects. This parameter can be any string, but I will advise you to use the combination of your name or company name plus a random GUID. e.g.

curl -v 'https://developer.api.autodesk.com/project/v1/hubs/:hub_id/projects' \
  -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
  -H 'x-request-id: yongjoon-4a539a6a-14bb-4ddd-b32e-74e430aff590' \

Afterward, pass the x-request-id to us. We will consult our engineering team for insights and backend logs. Thanks!

Eason Kang
  • 6,155
  • 1
  • 7
  • 24
  • Hi Eason, thanks for the comment. Yes, I've been using pagination for this. The problem is not the pagination, but some projects not being included in the response even though I'm already added to the BIM360 project as an admin, which ends up losing almost 1000 projects in my final result. What would be the resolution for this? – Yongjoon Kim Apr 13 '20 at 15:31
  • @YongjoonKim Thank you for letting me know that. I have updated my answer, please consider proving the `x-request-id` to me for checking backend log. In addition, I will need your `email account (ADSK ID)` and the `hub id`, **but it's not properly posted here. Please send them to forge[DOT]help[AT]atuodesk[DOT]com**. I will catch you in our case system. Thank you! – Eason Kang Apr 14 '20 at 04:07
  • Thank you so much! I'll try that and send your team a direct email! – Yongjoon Kim Apr 14 '20 at 06:55