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 the upload parameters can be sent either in the bimsync params request header or as a part of the request body prepare upload parameters set the necessary fields of the json object { "name" "document name", "parentid" "parent folder id", "document" { "type" "file", "filename" "document pdf" }, "failondocumentexists" false // optional, defaults to false } make request with the parameters in the header set the value to the bimsync params request header, 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' http header values are limited to iso 8859 1, so non ascii characters in document filename must be percent encoded — blåbær pdf is sent as bl%c3%a5b%c3%a6r pdf name is not percent decoded on this route, so encoding it stores the literal bl%c3%a5b%c3%a6r to use non ascii characters in name , send the parameters in the request body instead make request with the parameters in the body send the parameters as a bimsync params part and the file as a file part, with content type multipart/form data part bodies are read as utf 8, so non ascii filenames need no percent encoding and values are taken verbatim — a filename containing a literal percent sign, such as 100%20final pdf , is stored as written (the header route would read it as 100 final pdf ) send the bimsync params part before the file part the upload is streamed rather than held in memory, so parameters arriving after the file are rejected with a 400 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' \\ \ form 'bimsync params={"name" "blåbær","parentid" "parent folder id","document" {"type" "file","filename" "blåbær pdf"},"failondocumentexists"\ false};type=application/json' \\ \ form 'file=@/path/to/blåbær pdf' with form , curl sets content type multipart/form data and its boundary itself — do not set that header yourself upload a file revision use the create library item revision endpoint to upload a new revision of a file the upload parameters can be sent in the bimsync params request header or as a request body part, exactly as when uploading a file curl x post \\ 'https //api catenda com/v2/projects/{project id}/libraries/{library id}/items/{item id}/revisions' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your access token' \\ \ form 'bimsync params={"name" "blåbær pdf"};type=application/json' \\ \ form 'file=@/path/to/blåbær pdf' 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