2 problems to solve in this thread:
- BIM360 Issues API call is not working when it's been working for months
- API calls with 3-legged token returns empty
data
, while with 2-legged token returns like normal.
Context: I have a pipeline that runs everyday and call Issues API to retrieve project issues and all relevant data such as project info and issues_type. This has been running smoothly for a year now. (Yes, I do know that issues/v1 is recently deprecated)
On Feb. 6th, 2023, I encountered a response when using the 3-legged-token to call GET /issues (v1 and v2):
{
"title": "User not found",
"details": "user not found",
"metadata": {}
}
To debug, I tried running each API call in the procedure, by following this tutorial to GET /hubs and GET /containerID https://aps.autodesk.com/en/docs/bim360/v1/tutorials/issuesv2/retrieve-container-id/.
I got this when I call GET /hubs:
GET /project/v1/hubs
Authorization: "Bearer <3-legged token>"
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs"
}
},
"data": [], <---- Uh oh
"meta": {
"warnings": [
{
"Id": null,
"HttpStatusCode": "403",
"ErrorCode": "BIM360DM_ERROR",
"Title": "Unable to get hubs from BIM360DM EMEA.",
"Detail": "You don't have permission to access this API",
"AboutLink": null,
"Source": null,
"meta": null
}
]
}
}
The meta.warnings
field with an error code is not uncommon.
I tried calling GET /hubs again but with the 2-legged token:
GET /project/v1/hubs
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/"
}
},
"data": [
{
"type": "hubs",
"id": "<hidden>",
"attributes": {
"name": "User Hub",
"extension": {
"type": "hubs:autodesk.bim360:Account",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.bim360:Account-1.0"
},
"data": {}
},
"region": "US"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/<hidden>"
}
},
"relationships": {
"projects": {
"links": {
"related": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/<hidden>/projects"
}
}
}
}
}
],
"meta": {
"warnings": [
{
"Id": null,
"HttpStatusCode": "403",
"ErrorCode": "BIM360DM_ERROR",
"Title": "Unable to get hubs from BIM360DM EMEA.",
"Detail": "You don't have permission to access this API",
"AboutLink": null,
"Source": null,
"meta": null
}
]
}
}
Notice that :
- With 3-legged token
data
returns[]
. - With 2-legged token
data
returns a hub object.
I tried refreshing token and checking permissions to BIM360, but nothing has changed.
TL;DR AutoDesk deprecated the Issues API, but then the API call to GET /hubs with 3-legged token returns []
, but with 2-legged token returns desired hub-object.