Document Library
all catenda projects have a document library, use the document library to store files and folders all items in the document library are library items a library item can be a file or a folder a folder can contain other folders and files the parentid of a file is the library item id of the folder it is stored in file library items can have multiple revisions each revision is a separate file list documents use the list library items endpoint with the following supported parameters to limit the result parentid associations labels search createdatfrom createdatto revisioncreatedatfrom revisioncreatedatto include subfolders scope upload a file use the create library item endpoint to upload a file prepare request header set the necessary fields of the json object and set the value to the request header bimsync params { "name" "document name", "parentid" "parent folder id", "document" { "type" "file", "filename" "document pdf" }, "failondocumentexists" false // optional, defaults to false } make request attach the file to the request and set the content type header to application/octet stream curl x post \\ 'https //api catenda com/v2/projects/{project id}/libraries/{library id}/items' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your access token' \\ \ header 'content type application/octet stream' \\ \ header 'bimsync params {"name" "document name","parentid" "parent folder id","document" {"type" "file","filename" "document pdf"},"failondocumentexists"\ false}' \\ \ data binary '@/path/to/document pdf' upload a file revision use the create library item revision endpoint to upload a new revision of a file download a file use the get library item endpoint to download a file make request set the accept header to application/octet stream curl x get \\ 'https //api catenda com/v2/projects/{project id}/libraries/{library id}/items/{item id}' \\ \ header 'accept application/octet stream' \\ \ header 'authorization bearer your access token' update a file use the update library item endpoint with the following supported parameters name parentid labelstoadd labelstoremove create a folder use the create library item endpoint to create a folder prepare request body set the necessary fields of the json request body { "name" "folder name", "type" "folder", "parentid" "parent folder id", "document" { "type" "folder" } } make request send a post request to the endpoint curl x post \\ 'https //api catenda com/v2/projects/{project id}/libraries/{library id}/items' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your access token' \\ \ header 'content type application/json' \\ \ data raw '{ "name" "folder name", "type" "folder", "parentid" "parent folder id", "document" { "type" "folder" } }' update a folder use the update library item endpoint with the following supported parameters name