Learn how to connect to your storage buckets using API keys
First, login to get your JWT token:
curl -X POST https://baraclouds.com/api/login \
-H "Content-Type: application/json" \
-d '{"username":"YOUR_USERNAME","password":"YOUR_PASSWORD"}'
Loading...
Go to API Keys Page to generate a permanent API key.
API keys can be used instead of JWT tokens for programmatic access.
curl -X GET https://baraclouds.com/api/buckets \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X GET https://baraclouds.com/api/buckets \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X POST https://baraclouds.com/api/buckets \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"name": "my-new-bucket"}'
curl -X POST https://baraclouds.com/api/buckets/MY_BUCKET/upload \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@/path/to/your/file.txt"
curl -X GET https://baraclouds.com/api/buckets/MY_BUCKET/files \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X GET "https://baraclouds.com/api/storage/OBJECT_ID/download" \
-H "Authorization: Bearer YOUR_TOKEN" -o downloaded_file.txt
curl -X DELETE https://baraclouds.com/api/storage/OBJECT_ID \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X DELETE https://baraclouds.com/api/buckets/BUCKET_NAME \
-H "Authorization: Bearer YOUR_TOKEN"
import requests
# Your token from login
TOKEN = "your_jwt_token_here"
# List buckets
response = requests.get(
"https://baraclouds.com/api/buckets",
headers={"Authorization": f"Bearer {TOKEN}"}
)
print(response.json())
# Upload a file
files = {'file': open('myfile.txt', 'rb')}
response = requests.post(
"https://baraclouds.com/api/buckets/my-bucket/upload",
headers={"Authorization": f"Bearer {TOKEN}"},
files=files
)
print(response.json())