2.8 KiB
2.8 KiB
Box Routing Reference
App name: box
Base URL proxied: api.box.com
API Path Pattern
/box/2.0/{resource}
Common Endpoints
Get Current User
GET /box/2.0/users/me
Get User
GET /box/2.0/users/{user_id}
Get Folder
GET /box/2.0/folders/{folder_id}
Root folder ID is 0.
List Folder Items
GET /box/2.0/folders/{folder_id}/items
GET /box/2.0/folders/{folder_id}/items?limit=100&offset=0
Create Folder
POST /box/2.0/folders
Content-Type: application/json
{
"name": "New Folder",
"parent": {"id": "0"}
}
Update Folder
PUT /box/2.0/folders/{folder_id}
Content-Type: application/json
{
"name": "Updated Name",
"description": "Description"
}
Copy Folder
POST /box/2.0/folders/{folder_id}/copy
Content-Type: application/json
{
"name": "Copied Folder",
"parent": {"id": "0"}
}
Delete Folder
DELETE /box/2.0/folders/{folder_id}
DELETE /box/2.0/folders/{folder_id}?recursive=true
Get File
GET /box/2.0/files/{file_id}
Download File
GET /box/2.0/files/{file_id}/content
Update File
PUT /box/2.0/files/{file_id}
Copy File
POST /box/2.0/files/{file_id}/copy
Delete File
DELETE /box/2.0/files/{file_id}
Create Shared Link
PUT /box/2.0/folders/{folder_id}
Content-Type: application/json
{
"shared_link": {"access": "open"}
}
List Collaborations
GET /box/2.0/folders/{folder_id}/collaborations
Create Collaboration
POST /box/2.0/collaborations
Content-Type: application/json
{
"item": {"type": "folder", "id": "123"},
"accessible_by": {"type": "user", "login": "user@example.com"},
"role": "editor"
}
Search
GET /box/2.0/search?query=keyword
Events
GET /box/2.0/events
Trash
GET /box/2.0/folders/trash/items
DELETE /box/2.0/files/{file_id}/trash
DELETE /box/2.0/folders/{folder_id}/trash
Collections
GET /box/2.0/collections
GET /box/2.0/collections/{collection_id}/items
Recent Items
GET /box/2.0/recent_items
Webhooks
GET /box/2.0/webhooks
POST /box/2.0/webhooks
DELETE /box/2.0/webhooks/{webhook_id}
Pagination
Offset-based pagination:
GET /box/2.0/folders/0/items?limit=100&offset=0
Response:
{
"total_count": 250,
"entries": [...],
"offset": 0,
"limit": 100
}
Notes
- Root folder ID is
0 - File uploads use
upload.box.com(different base URL) - Delete operations return 204 No Content
- Some operations require enterprise admin permissions
- Use
fieldsparameter to select specific fields