I am currently using Data Connector endpoints via the BIM 360 API to pull submittal data for on-prem archival post-project close (since there still aren't Submittal endpoints in the API). The other related submittal aspects have been easy enough, but I've hit a roadblock with fetching the associated attachments. The submittals_attachments.csv only contains the guid for the attachment, not the URN that can be used to obtain the S3URL for download. Is there an endpoint that accepts non-URN formatted IDs for items and returns metadata that contains a proper urn?
Or, better yet, is there a resource that explains how the URN is generated that can be used to construct the urn? I've seen different URN formats so far and it isn't clear exactly what each part means (E.g. urn:adsk.objects:os.object:wip.dm.prod/xxxxxxxx-40q5-4eb9-a4a3-xxxxxxxxxxxx.pdf vs urn:adsk.wipprod:dm.lineage:6bVr4EVDSaOpykczeQYR2Q vs urn:adsk.wipprod:fs.folder:co.uvDiLQ5DRYidDQ_EFW1OOg.) I would think each attachment has a proper URN regardless of exposure via the API, being that the files are easily passed to the S3URL endpoints when you click the site UI's download button. If there's a predictable way to build the URN then perhaps that can be passed to the download endpoints like normal.
GET https://developer.api.autodesk.com/data/v1/projects/[PROJECTID]/items/ad0fdf7e-dbe8-437d-afcc-1ba72c6b842b
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "ad0fdf7e-dbe8-437d-afcc-1ba72c6b842b",
"status": "400",
"code": "BAD_INPUT",
"title": "One or more input values in the request were bad",
"detail": "The provided urn is invalid."
}
]
}
Works with known urns of attachments obtained via Issues and RFI endpoints so it appears to be an itemId format issue.
After discussing this with our engineering team, this issue should be fixed now. You should be able to see upload_urn
for BIM360 Submittals Attachments in the extracted submittals_attachments.csv
like below:
============================
First, just to clarify. There is no equality between OSS Object id and item URN, unfortunately. (saying urn:adsk.objects:os.object:wip.dm.prod/xxxxxxxx-40q5-4eb9-a4a3-xxxxxxxxxxxx.pdf
vs urn:adsk.wipprod:dm.lineage:6bVr4EVDSaOpykczeQYR2Q
)
And then now going back to the question:
What is your ad0fdf7e-dbe8-437d-afcc-1ba72c6b842b
?
Once we have the object id already for downloading the file from Data Management (saying urn:adsk.objects:os.object:wip.dm.prod/xxxxxxxx-40q5-4eb9-a4a3-xxxxxxxxxxxx.pdf
), so you don't need to call the GET items
API. Please follow this step Get the S3 URL of the tutorial to download the attachment.
// Call this endpoint with the 3-legged access token
curl -X GET -H "Authorization: Bearer nFRJxzCD8OOUr7hzBwbr06D76zAT..." "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/xxxxxxxx-40q5-4eb9-a4a3-xxxxxxxxxxxx.pdf/signeds3download"
// Download the file with the URL you get from the response.
{
"status": "complete",
"url": "https://cdn.us.oss.api.autodesk.com/....",
"params": {
"content-type": "application/octet-stream",
"content-disposition": "attachment; filename=\"xxxxxxxx-40q5-4eb9-a4a3-xxxxxxxxxxxx.pdf\""
},
"size": 344843,
"sha1": "a039f6b8....af76bb"
}