Uploading

Small uploads in one request, resumable uploads in parts, and checking which names already exist.

MethodPathSummary
POST/api/v2/uploads/checkWhich of these names already exist in a folder (so the client can ask "replace or keep both" before uploading)
POST/api/v2/uploadUpload a small file
POST/api/v2/uploadsStart a resumable upload
GET/api/v2/uploads/:uidWhich parts of an upload have arrived
PUT/api/v2/uploads/:uid/parts/:nSend one part of an upload
POST/api/v2/uploads/:uid/completeFinish a resumable upload
DELETE/api/v2/uploads/:uidAbandon an upload

#Which of these names already exist in a folder (so the client can ask "replace or keep both" before uploading)

POST/api/v2/uploads/check
Address
https://<your-org>.brambleit.cloud/drive/api/v2/uploads/check
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Request body JSON

NameTypeDescription
parentany
parent_idinteger
siteany
site_idinteger
namesarray of any

Response 200

FieldTypeDescription
existingarray of any
Example response
JSON
{
  "existing": []
}

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/check' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parent":"…","parent_id":7,"site":"…","site_id":7,"names":[]}'

#Upload a small file

POST/api/v2/upload

The request body is the file's bytes; everything else is in the query string.

Address
https://<your-org>.brambleit.cloud/drive/api/v2/upload
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Query parameters

NameTypeDescription
parentanyThe folder to upload into.
parent_idinteger
siteanyThe library to upload into.
site_idinteger
namerequiredstringThe file name.
conflictanyIf the name is taken: rename (keep both) or replace (a new version).

Response 201

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/upload?name=Example%20name' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Start a resumable upload

POST/api/v2/uploads

Resumable: start, send parts (retry any), complete.

Address
https://<your-org>.brambleit.cloud/drive/api/v2/uploads
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Request body JSON

NameTypeDescription
sizenumberThe file's size in bytes.
namestringThe file name.
conflictstringrename or replace.
typestringIts MIME type.
part_sizenumberThe size of each part you'll send.

Response 201

FieldTypeDescription
idinteger
part_sizeany
partsarray of any
receivedany
Example response
JSON
{
  "id": 42,
  "part_size": null,
  "parts": [],
  "received": null
}

Errors

StatusMessage
400size is required

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads' \
  -H "X-API-Key: $BRAMBLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"size":12.5,"name":"Example name","conflict":"string","type":"string","part_size":12.5}'

#Which parts of an upload have arrived

GET/api/v2/uploads/:uid
Address
https://<your-org>.brambleit.cloud/drive/api/v2/uploads/:uid
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Path parameters

NameTypeDescription
uidrequiredinteger

Response 200

FieldTypeDescription
idinteger
part_sizeany
partsarray of any
receivedany
Example response
JSON
{
  "id": 42,
  "part_size": null,
  "parts": [],
  "received": null
}

Example request

Bash
curl -X GET 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Send one part of an upload

PUT/api/v2/uploads/:uid/parts/:n

The request body is the raw bytes of part n (numbered from 1).

Address
https://<your-org>.brambleit.cloud/drive/api/v2/uploads/:uid/parts/:n
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Path parameters

NameTypeDescription
uidrequiredinteger
nrequirednumber

Response 200

Example request

Bash
curl -X PUT 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/parts/12.5' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Finish a resumable upload

POST/api/v2/uploads/:uid/complete
Address
https://<your-org>.brambleit.cloud/drive/api/v2/uploads/:uid/complete
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Path parameters

NameTypeDescription
uidrequiredinteger

Response 201

Example request

Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/complete' \
  -H "X-API-Key: $BRAMBLE_KEY"

#Abandon an upload

DELETE/api/v2/uploads/:uid
Address
https://<your-org>.brambleit.cloud/drive/api/v2/uploads/:uid
Requires
Signed-in session, X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.

Path parameters

NameTypeDescription
uidrequiredinteger

Response 200

FieldTypeDescription
okboolean
Example response
JSON
{
  "ok": true
}

Example request

Bash
curl -X DELETE 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1' \
  -H "X-API-Key: $BRAMBLE_KEY"