Document upload to BIM360 Document Management

Document upload to BIM360 Document Management

Anonymous
Not applicable
659 Views
0 Replies
Message 1 of 1

Document upload to BIM360 Document Management

Anonymous
Not applicable

While uploading document with file extension as 'items:autodesk.core:File' and version type as 'versions:autodesk.core:File' or 'versions:autodesk.a360:CompositeDesign' throws 400 Bad request.

In API, 3 API call to upload document, first to create storage location, second to upload file in storage location and third to create file with version. First 2 calls have success response, third call throws error like '

One or more input values in the request were bad'. Instead if i give file extension as 'items:autodesk.bim360:File' and version type as 'versions:autodesk.bim360:File', it uploads new file to BIM360. What is the correct input for 'versions:autodesk.core:File' or 'versions:autodesk.a360:CompositeDesign' versions?
These are my API calls:
1. Create storage location
Body: {"jsonapi":{"version":"1.0"},"data":{"type":"objects","attributes":{"name":"new_pdf_check_file1.pdf"},"relationships":{"target":{"data":{"type":"folders","id":"urn:adsk.wipprod:fs.folder:co.1z5Dfh8OScePT6vJTctIxA"}}}}}
Headers:
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
2. Upload file to storage location
Body:  "This is a small demonstration .pdf file -
just for use in the Virtual Mechanics tutorials. More text. And more
text. And more text. And more text. And more text.
And more text. And more text. And more text. And more text. And more
text. And more text. Boring, zzzzz. And more text. And more text. And
more text. And more text. And more text. And more text. And more text.
And more text. And more text."
Headers:
Accept: application/json
3. Create first version of file in BIM360
Body: {"jsonapi":{"version":"1.0"},"data":{"type":"items","attributes":{"displayName":"new_pdf_check_file1.pdf","extension":{"type":"items:autodesk.core:File","version":"1.0"}},"relationships":{"tip":{"data":{"type":"versions","id":"1"}},"parent":{"data":{"type":"folders","id":"urn:adsk.wipprod:fs.folder:co.1z5Dfh8OScePT6vJTctIxA"}}}},"included":[{"type":"versions","id":"1","attributes":{"name":"new_pdf_check_file1.pdf","extension":{"type":"versions:autodesk.core:File","version":"1.0"}},"relationships":{"storage":{"data":{"type":"objects","id":"urn:adsk.objects:os.object:wip.dm.prod/dfd99262-1930-4139-ab53-73e84e4ec775.pdf"}}}}]}
Headers:
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
0 Likes
660 Views
0 Replies
Replies (0)