Create folder ZIP file
POST
/folder/{folderId}/zip-file
const url = 'https://api.colourbox.com/folder/1/zip-file';const options = {method: 'POST', headers: {Authorization: 'CBX-SIMPLE-TOKEN Token=<token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.colourbox.com/folder/1/zip-file \ --header 'Authorization: CBX-SIMPLE-TOKEN Token=<token>'Create a zip file from the folder. The zip file will contain all files and sub folders.
The creation of the zip file is asynchronous and will take some time to complete. Poll for
the status with GET /zip-file/{job_id} or keep posting to this endpoint. Both return the
exact same data. The job_id contains a slash (e.g. f/3kq9...); put it in the URL as is,
without URL-encoding it.
Authorizations
Section titled “Authorizations”- simple_token
- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”folderId
required
integer
Query Parameters
Section titled “Query Parameters”share_hash
string
The share hash of a shared folder. Not needed if you have read access to the folder.
Responses
Section titled “Responses”The state of the ZIP job
Media typeapplication/json
object
job_id
Used to poll the status of the zip file
string
state
string
url
GET this URL to retrieve the zip file, once state is DONE
string
valid_until
UNIX timestamp
integer
Example
{ "state": "PENDING"}