We are following the tutorial for uploading a file, but can't seem to get the last step to complete successfully (Step 5: Create the first version of the uploaded file). We are able to successfully resolve the target project and folder, create a storage location, and upload the file the storage location.
We then attempt to call the endpoint to create a version of the file in the folder.
POST https://developer.api.autodesk.com/data/v1/projects/{the project id}/items
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "items",
"attributes": {
"displayName": "Sample.jpg",
"extension": {
"type": "items:autodesk.core:File",
"version": "1.0"
}
},
"relationships": {
"tip": {
"data": {
"type": "versions",
"id": "1"
}
},
"parent": {
"data": {
"type": "folders",
"id": "{the project id}"
}
}
}
},
"included": [
{
"type": "versions",
"id": "1",
"attributes": {
"name": "Sample.jpg",
"extension": {
"type": "versions:autodesk.core:File",
"version": "1.0"
}
},
"relationships": {
"storage": {
"data": {
"type": "objects",
"id": "{object id return from file upload}"
}
}
}
}
]
}
The response is always 400 (bad request) with the following details:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "ed1ae266-ebe5-4414-999a-8b6302317639",
"status": "400",
"code": "BAD_INPUT",
"title": "One or more input values in the request were bad",
"detail": "Request input is invalid for this operation."
}
]
}
Any help is greatly appreciated.