Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
342 lines (291 sloc) 11.9 KB

Templates

Endpoints:

Get Templates

  • GET /templates.json will return a paginated list of active Templates visible to the current user sorted by most recently created Template first.

Optional parameters:

  • status - when set to archived or trashed, will return archived or trashed Templates visible to the current user.
Example JSON Response
[
  {
    "id": 2085958501,
    "status": "active",
    "created_at": "2016-12-05T14:44:30.888Z",
    "updated_at": "2016-12-05T14:44:31.670Z",
    "name": "Honcho Onboarding",
    "description": "Getting started on the right foot",
    "url": "https://3.basecampapi.com/195539477/templates/2085958501.json",
    "app_url": "https://3.basecamp.com/195539477/templates/2085958501"
  }
]
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/templates.json

Get a Template

  • GET /templates/1.json will return the Template with the given ID, granted they have access to it.
Example JSON Response
{
  "id": 2085958501,
  "status": "active",
  "created_at": "2016-12-05T14:44:30.888Z",
  "updated_at": "2016-12-05T14:44:31.670Z",
  "name": "Honcho Onboarding",
  "description": "Getting started on the right foot",
  "url": "https://3.basecampapi.com/195539477/templates/2085958501.json",
  "app_url": "https://3.basecamp.com/195539477/templates/2085958501",
  "dock": [
      {
          "id": 548670657,
          "title": "Campfire",
          "name": "chat",
          "enabled": true,
          "position": 1,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/chats/548670657.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/chats/548670657"
      },
      {
          "id": 548670658,
          "title": "Message Board",
          "name": "message_board",
          "enabled": true,
          "position": 2,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/message_boards/548670658.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/message_boards/548670658"
      },
      {
          "id": 548670659,
          "title": "To-dos",
          "name": "todoset",
          "enabled": true,
          "position": 3,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/todosets/548670659.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/todosets/548670659"
      },
      {
          "id": 548670661,
          "title": "Schedule",
          "name": "schedule",
          "enabled": true,
          "position": 4,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/schedules/548670661.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/schedules/548670661"
      },
      {
          "id": 548670662,
          "title": "Automatic Check-ins",
          "name": "questionnaire",
          "enabled": true,
          "position": 5,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/questionnaires/548670662.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/questionnaires/548670662"
      },
      {
          "id": 548670666,
          "title": "Docs & Files",
          "name": "vault",
          "enabled": true,
          "position": 6,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/vaults/548670666.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/vaults/548670666"
      },
      {
          "id": 548670667,
          "title": "Email Forwards",
          "name": "inbox",
          "enabled": false,
          "position": null,
          "url": "https://3.basecampapi.com/195539477/buckets/2085958501/inboxes/548670667.json",
          "app_url": "https://3.basecamp.com/195539477/buckets/2085958501/inboxes/548670667"
      }
  ]  
}
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/templates/1.json

Create a Template

  • POST /templates.json with at least a name, and optionally a description, to create a new Template.
Example JSON Request
{
  "name": "New Starter Checklist",
  "description": "Things every new starter should do"
}
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"New Starter Checklist","description":"Things every new starter should do in their first week"}' \
  https://3.basecampapi.com/$ACCOUNT_ID/templates.json

This will return 201 Created with the current JSON representation of the Template if the creation was a success. See the Get a Template endpoint for more info. Templates follow the same account limits as projects. If the account is on a free subscription and you're trying to create a new Template you'll see a 507 Insufficient Storage and a response of:

{
  "error": "The project/team limit for this account has been reached."
}

If you hit that error, the user will need to upgrade their subscription to any plan, which all have unlimited Templates.

Update a Template

  • PUT /templates/1.json will allow updating of a Template's name and description.
Example JSON Request
{
  "name": "New Starter First Week Checklist",
  "description": "Things every new starter should do in their first week"
}

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

Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"New Starter First Week Checklist","description":"Things every new starter should do in their first week"}' -X PUT \
  https://3.basecampapi.com/$ACCOUNT_ID/templates/2085958506.json

Trash a Template

  • DELETE /templates/1.json will mark the Template with the given ID as trashed.

Trashed Templates will be deleted from Basecamp 3 after 30 days. No parameters required. Returns 204 No Content if successful.

Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -X DELETE \
  https://3.basecampapi.com/$ACCOUNT_ID/templates/2085958507.json

Create a Project Construction

To create a project given a template, you need to create a project construction.

  • POST /templates/:template_id/project_constructions.json with at least a project name, and optionally a description.
Example JSON Request
{
  "project": {
    "name": "Marketing ",
    "description": "2016-2017 Strategy"
  }
}
Copy as cURL
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"project":{"name":"Marketing Campaign","description":"For Client: Xyz Corp Conference"}}' -X POST \
  https://3.basecampapi.com/$ACCOUNT_ID/templates/2085958507/project_constructions.json

If creation was successful, this returns 201 Created along with the current JSON representation of the project construction.

{
  "id": 598194959,
  "status": "pending",
  "url": "https://3.basecampapi.com/195539477/templates/2085958501/project_constructions/598194959.json"
}

Get a Project Construction

  • GET /templates/1/project_constructions/2.json will return the project construction with an ID of 2 for the template with an ID of 1.

This endpoint can be polled at regular intervals (no more than once a second) to see when construction is complete. When complete, the construction will have a status of "completed" and will provide information about the newly-created project:

{
  "id": 598194959,
  "status": "completed",
  "url": "https://3.basecampapi.com/195539477/templates/2085958501/project_constructions/598194959.json",
  "project": {
    "id": 2085958504,
    "status": "active",
    "created_at": "2016-12-05T14:48:30.095Z",
    "updated_at": "2016-12-05T14:48:34.389Z",
    "name": "New project from template",
    "description": "Getting started on the right foot",
    "purpose": "topic",
    "bookmark_url": "https://3.basecampapi.com/195539477/my/bookmarks/BAh7CEkiCGdpZAY6BkVUSSIrZ2lkOi8vYmMzL0J1Y2tldC8yMDg1OTU4NTA0P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg1yZWFkYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--357b1722d49059567e702967739410b154580b1c.json",
    "url": "https://3.basecampapi.com/195539477/projects/2085958504.json",
    "app_url": "https://3.basecamp.com/195539477/projects/2085958504",
    "dock": [
      {
        "id": 9007199254741942,
        "title": "Campfire",
        "name": "chat",
        "enabled": true,
        "position": 1,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/chats/9007199254741942.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/chats/9007199254741942"
      },
      {
        "id": 9007199254741943,
        "title": "Message Board",
        "name": "message_board",
        "enabled": true,
        "position": 2,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/message_boards/9007199254741943.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/message_boards/9007199254741943"
      },
      {
        "id": 9007199254741944,
        "title": "To-dos",
        "name": "todoset",
        "enabled": true,
        "position": 3,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/todosets/9007199254741944.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/todosets/9007199254741944"
      },
      {
        "id": 9007199254741949,
        "title": "Schedule",
        "name": "schedule",
        "enabled": true,
        "position": 4,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/schedules/9007199254741949.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/schedules/9007199254741949"
      },
      {
        "id": 9007199254741950,
        "title": "Automatic Check-ins",
        "name": "questionnaire",
        "enabled": true,
        "position": 5,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/questionnaires/9007199254741950.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/questionnaires/9007199254741950"
      },
      {
        "id": 9007199254741953,
        "title": "Docs & Files",
        "name": "vault",
        "enabled": true,
        "position": 6,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/vaults/9007199254741953.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/vaults/9007199254741953"
      },
      {
        "id": 9007199254741954,
        "title": "Email Forwards",
        "name": "inbox",
        "enabled": false,
        "position": null,
        "url": "https://3.basecampapi.com/195539477/buckets/2085958504/inboxes/9007199254741954.json",
        "app_url": "https://3.basecamp.com/195539477/buckets/2085958504/inboxes/9007199254741954"
      }
    ]
  }
}
You can’t perform that action at this time.