Uploading
Small uploads in one request, resumable uploads in parts, and checking which names already exist.
| Method | Path | Summary |
|---|---|---|
| POST | /api/v2/uploads/check | Which of these names already exist in a folder (so the client can ask "replace or keep both" before uploading) |
| POST | /api/v2/upload | Upload a small file |
| POST | /api/v2/uploads | Start a resumable upload |
| GET | /api/v2/uploads/:uid | Which parts of an upload have arrived |
| PUT | /api/v2/uploads/:uid/parts/:n | Send one part of an upload |
| POST | /api/v2/uploads/:uid/complete | Finish a resumable upload |
| DELETE | /api/v2/uploads/:uid | Abandon 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
| Name | Type | Description |
|---|---|---|
parent | any | |
parent_id | integer | |
site | any | |
site_id | integer | |
names | array of any |
Response 200
| Field | Type | Description |
|---|---|---|
existing | array 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":[]}'JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/uploads/check', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({"parent":"…","parent_id":7,"site":"…","site_id":7,"names":[]}),
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/drive/api/v2/uploads/check",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
json={"parent":"…","parent_id":7,"site":"…","site_id":7,"names":[]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
$body = '{"parent":"…","parent_id":7,"site":"…","site_id":7,"names":[]}'
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/check' -Headers $headers -ContentType 'application/json' -Body $body#Upload a small file
POST
/api/v2/uploadThe 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
| Name | Type | Description |
|---|---|---|
parent | any | The folder to upload into. |
parent_id | integer | |
site | any | The library to upload into. |
site_id | integer | |
namerequired | string | The file name. |
conflict | any | If 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"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/upload?name=Example%20name', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/drive/api/v2/upload?name=Example%20name",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/upload?name=Example%20name' -Headers $headers#Start a resumable upload
POST
/api/v2/uploadsResumable: 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
| Name | Type | Description |
|---|---|---|
size | number | The file's size in bytes. |
name | string | The file name. |
conflict | string | rename or replace. |
type | string | Its MIME type. |
part_size | number | The size of each part you'll send. |
Response 201
| Field | Type | Description |
|---|---|---|
id | integer | |
part_size | any | |
parts | array of any | |
received | any |
Example response
JSON
{
"id": 42,
"part_size": null,
"parts": [],
"received": null
}Errors
| Status | Message |
|---|---|
| 400 | size 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}'JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/uploads', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({"size":12.5,"name":"Example name","conflict":"string","type":"string","part_size":12.5}),
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/drive/api/v2/uploads",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
json={"size":12.5,"name":"Example name","conflict":"string","type":"string","part_size":12.5},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
$body = '{"size":12.5,"name":"Example name","conflict":"string","type":"string","part_size":12.5}'
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads' -Headers $headers -ContentType 'application/json' -Body $body#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
| Name | Type | Description |
|---|---|---|
uidrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
id | integer | |
part_size | any | |
parts | array of any | |
received | any |
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"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1', {
method: 'GET',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.get(
"https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method GET -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1' -Headers $headers#Send one part of an upload
PUT
/api/v2/uploads/:uid/parts/:nThe 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
| Name | Type | Description |
|---|---|---|
uidrequired | integer | |
nrequired | number |
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"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/parts/12.5', {
method: 'PUT',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.put(
"https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/parts/12.5",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method PUT -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/parts/12.5' -Headers $headers#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
| Name | Type | Description |
|---|---|---|
uidrequired | integer |
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"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/complete', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/complete",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1/complete' -Headers $headers#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
| Name | Type | Description |
|---|---|---|
uidrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
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"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1', {
method: 'DELETE',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.delete(
"https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method DELETE -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/uploads/1' -Headers $headersWas this page helpful?
Thanks for your feedback.