Skip to content

Latest commit

 

History

History
216 lines (188 loc) · 8.86 KB

uploads.md

File metadata and controls

216 lines (188 loc) · 8.86 KB

Uploads

Endpoints:

Get uploads

  • GET /buckets/1/vaults/2/uploads.json will return a paginated list of active uploads in the project with an ID of 1 and the vault with ID of 2.
Example JSON Response
[
  {
    "id": 9007199254741761,
    "status": "active",
    "created_at": "2016-07-19T21:36:12.137Z",
    "updated_at": "2016-07-19T21:36:15.412Z",
    "title": "company-logo.png",
    "inherits_status": true,
    "type": "Upload",
    "url": "https://3.basecampapi.com/195539477/buckets/2085958498/uploads/9007199254741761.json",
    "app_url": "https://3.basecamp.com/195539477/buckets/2085958498/uploads/9007199254741761",
    "bookmark_url": "https://3.basecampapi.com/195539477/my/bookmarks/BAh7CEkiCGdpZAY6BkVUSSIuZ2lkOi8vYmMzL1JlY29yZGluZy8xMDY0MDkxNTM5P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg1yZWFkYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--a96c68e0b0a985bd924462ea91fc2ab4d77d320e.json",
    "subscription_url": "https://3.basecampapi.com/195539477/buckets/2085958498/recordings/9007199254741761/subscription.json",
    "comments_count": 0,
    "comments_url": "https://3.basecampapi.com/195539477/buckets/2085958498/recordings/9007199254741761/comments.json",
    "position": 1,
    "parent": {
      "id": 9007199254741442,
      "title": "Docs & Files",
      "type": "Vault",
      "url": "https://3.basecampapi.com/195539477/buckets/2085958498/vaults/9007199254741442.json",
      "app_url": "https://3.basecamp.com/195539477/buckets/2085958498/vaults/9007199254741442"
    },
    "bucket": {
      "id": 2085958498,
      "name": "The Leto Laptop",
      "type": "Project"
    },
    "creator": {
      "id": 1007299143,
      "attachable_sgid": "BAh7CEkiCGdpZAY6BkVUSSIrZ2lkOi8vYmMzL1BlcnNvbi8xMDA3Mjk5MTQzP2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--919d2c8b11ff403eefcab9db42dd26846d0c3102",
      "name": "Victor Cooper",
      "email_address": "[email protected]",
      "personable_type": "User",
      "title": "Chief Strategist",
      "bio": "Don't let your dreams be dreams",
      "created_at": "2016-09-09T22:58:27.559Z",
      "updated_at": "2016-09-09T22:58:31.296Z",
      "admin": true,
      "owner": true,
      "time_zone": "America/Chicago",
      "avatar_url": "https://3.basecamp-static.com/195539477/people/BAhpBEcqCjw=--c632b967cec296b87363a697a67a87f9cc1e5b45/avatar-64-x4",
      "company": {
        "id": 1033447817,
        "name": "Honcho Design"
      }
    },
    "description": "<div>Check out the new logo</div>",
    "filename": "company-logo.png",
    "content_type": "image/png",
    "byte_size": 1281,
    "width": 164,
    "height": 39,
    "download_url": "https://3.basecampapi.com/195539477/buckets/2085958498/uploads/9007199254741761/download/company-logo.png",
    "app_download_url": "https://3.basecamp.com/195539477/buckets/2085958498/uploads/9007199254741761/download/company-logo.png"
  }
]
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/buckets/1/vaults/2/uploads.json

Get an upload

  • GET /buckets/1/uploads/2.json will return the upload with an ID of 2 in the project with an ID of 1.
Example JSON Response
{
  "id": 9007199254741761,
  "status": "active",
  "created_at": "2016-07-19T21:36:12.137Z",
  "updated_at": "2016-07-19T21:36:15.412Z",
  "title": "company-logo.png",
  "inherits_status": true,
  "type": "Upload",
  "url": "https://3.basecampapi.com/195539477/buckets/2085958498/uploads/9007199254741761.json",
  "app_url": "https://3.basecamp.com/195539477/buckets/2085958498/uploads/9007199254741761",
  "bookmark_url": "https://3.basecampapi.com/195539477/my/bookmarks/BAh7CEkiCGdpZAY6BkVUSSIuZ2lkOi8vYmMzL1JlY29yZGluZy8xMDY0MDkxNTM5P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg1yZWFkYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--a96c68e0b0a985bd924462ea91fc2ab4d77d320e.json",
  "subscription_url": "https://3.basecampapi.com/195539477/buckets/2085958498/recordings/9007199254741761/subscription.json",
  "comments_count": 0,
  "comments_url": "https://3.basecampapi.com/195539477/buckets/2085958498/recordings/9007199254741761/comments.json",
  "position": 1,
  "parent": {
    "id": 9007199254741442,
    "title": "Docs & Files",
    "type": "Vault",
    "url": "https://3.basecampapi.com/195539477/buckets/2085958498/vaults/9007199254741442.json",
    "app_url": "https://3.basecamp.com/195539477/buckets/2085958498/vaults/9007199254741442"
  },
  "bucket": {
    "id": 2085958498,
    "name": "The Leto Laptop",
    "type": "Project"
  },
  "creator": {
    "id": 1007299143,
    "attachable_sgid": "BAh7CEkiCGdpZAY6BkVUSSIrZ2lkOi8vYmMzL1BlcnNvbi8xMDA3Mjk5MTQzP2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--919d2c8b11ff403eefcab9db42dd26846d0c3102",
    "name": "Victor Cooper",
    "email_address": "[email protected]",
    "personable_type": "User",
    "title": "Chief Strategist",
    "bio": "Don't let your dreams be dreams",
    "created_at": "2016-09-09T22:58:27.559Z",
    "updated_at": "2016-09-09T22:58:31.296Z",
    "admin": true,
    "owner": true,
    "time_zone": "America/Chicago",
    "avatar_url": "https://3.basecamp-static.com/195539477/people/BAhpBEcqCjw=--c632b967cec296b87363a697a67a87f9cc1e5b45/avatar-64-x4",
    "company": {
      "id": 1033447817,
      "name": "Honcho Design"
    }
  },
  "description": "<div>Check out the new logo</div>",
  "filename": "company-logo.png",
  "content_type": "image/png",
  "byte_size": 1281,
  "width": 164,
  "height": 39,
  "download_url": "https://3.basecampapi.com/195539477/buckets/2085958498/uploads/9007199254741761/download/company-logo.png",
  "app_download_url": "https://3.basecamp.com/195539477/buckets/2085958498/uploads/9007199254741761/download/company-logo.png"
}
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/buckets/1/uploads/2.json

Create an upload

  • POST /buckets/1/vaults/2/uploads.json creates an upload in the project with ID 1 and under the vault with an ID of 2.

Required parameters: attachable_sgid for an uploaded attachment. See the Create an attachment endpoint for more info on uploading attachments.

Optional parameters:

  • description - containing information about the upload. See our Rich text guide for what HTML tags allowed.
  • base_name - an new file name for the upload. base_name should be a file name without an extension (e.g. "pizza" for "pizza.png").

This endpoint will return 201 Created with the current JSON representation of the upload if the creation was a success. See the Get an upload endpoint for more info on the payload.

Example JSON Request
{
  "attachable_sgid": "BAh2CEkiCGdpZAY6BkVUSSIsZ2lkOi7vYmMzL0F0dGFjaG1lbnQvNzM4NDcyNj9leHBpcmVzX2luBjsAVEkiDHB1cnBvc2UGOwBUSSIPYXR0YWNoYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--13982201abe18044c897e32979c7dccfe8add9c1",
  "description": "<div><strong>Yum</strong></div>",
  "base_name": "yummy_pizza"
}
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"attachable_sgid":"BAh…9c1","description":"<div><strong>Yum</strong></div>","base_name":"yummy_pizza"}' \
  https://3.basecampapi.com/$ACCOUNT_ID/buckets/1/vaults/2/uploads.json

Update an upload

  • PUT /buckets/1/uploads/2.json allows changing the description and base_name of the upload with an ID of 2 in the project with ID 1.

This endpoint will return 200 OK with the current JSON representation of the upload if the update was a success. See the Get an upload endpoint for more info on the payload.

Example JSON Request
{
  "description": "<div>Meh</div>",
  "base_name": "old_pizza"
}
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"description":"<div>Meh</div>","base_name":"old_pizza"}' -X PUT \
  https://3.basecampapi.com/$ACCOUNT_ID/buckets/1/uploads/2.json