autodesk-data-management

What are the required headers and body to upload a new item?


I'm calling the /data/v1/projects/:ProjectId:/storage endpoint to create a new storage entry for Data Management API, but I'm getting invalid/missing parameters.

What's the required header & body for this call to work?


Solution

  • Call endpoint /data/v1/projects/:ProjectId:/storage with

    Header:

    'Authorization': 'Bearer ' + token,
    'Content-Type': 'application/vnd.api+json',
    'Accept': 'application/vnd.api+json'
    

    Body:

    {
        data: {
            type: 'object',
            attributes: {
                name: theFileNameHere
            },
            relationships: {
                target: {
                    data: {
                        type: 'folders',
                        id: folderIdHere
                    }
                }
            }
        }
    }
    

    More details here