Basecamp API

Messages & Comments API Calls

Comment

/msg/comment/#{comment_id}

Retrieve a specific comment by its id.

Response

<comment>
  ...
</comment>

Comments

/msg/comments/#{message_id}

Return the list of comments associated with the specified message.

Response

<comments>
  <comment>
    ...
  </comment>
  <comment>
    ...
  </comment>
  ...
</comments>

Create comment

/msg/create_comment

Create a new comment, associating it with a specific message.

XML Request

<request>
  <comment>
    <post-id>#{post_id}</post-id>
    <body>#{body}</body>
  </comment>
</request>

YAML Request

---
comment:
  post-id: #{post_id}
  body: #{body}

Response

<comment>
  ...
</comment>

Create message

/projects/#{project_id}/msg/create

Creates a new message, optionally sending notifications to a selected list of people. Note that you can also upload files using this function, but you need to upload the files first and then attach them. See the description at the top of this document for more information.

XML Request

<request>
  <post>
    <category-id>#{category_id}</category-id>
    <title>#{title}</title>
    <body>#{body}</body>
    <extended-body>#{extended_body}</extended-body>
    <use-textile>1</use_textile> <!-- omit to not use textile -->
    <private>1</private> <!-- only for firm employees -->
  </post>
  <notify>#{person_id}</notify>
  <notify>#{person_id}</notify>
  ...
  <attachments>
    <name>#{name}</name> <!-- optional -->
    <file>
      <file>#{temp_id}</file> <!-- the id of the previously uploaded file -->
      <content-type>#{content_type}</content-type>
      <original_filename>#{original_filename}</original-filename>
    </file>
  </attachments>
  <attachments>...</attachments>
  ...
</request>

YAML Request

---
post:
  category-id: #{category_id}
  title: #{title}
  body: #{body}
  extended-body: #{extended_body}
  use-textile: #{true|false}
  private: #{true|false}
notify:
  - #{person_id}
  - #{person_id}
  ...
attachments:
  - name: #{name}
    file:
      file: #{temp_id}
      content-type: #{content_type}
      original-filename: #{original_filename}
  ...

Response

<post>
  ...
</post>

Delete comment

/msg/delete_comment/#{comment_id}

Delete the comment with the given id.

Response

<comment>
  ...
</comment>

Delete message

/msg/delete/#{message_id}

Delete the specified message from the project.

Response

<post>
  ...
</post>

Message

/msg/get/#{message_ids}

This will return information about the referenced message. If the id is given as a comma-delimited list, one record will be returned for each id. In this way you can query a set of messages in a single request. Note that you can only give up to 25 ids per request--more than that will return an error.

Response

<posts>
  <post>
    ...
  </post>
  <post>
    ...
  </post>
  ...
</posts>

Message archive

/projects/#{project_id}/msg/archive

This will return a summary record for each message in a project. If you specify a category_id, only messages in that category will be returned. (Note that a summary record includes only a few bits of information about a post, not the complete record.)

XML Request

<request>
  <project-id>#{project_id}</project-id>
  <!-- optional -->
  <category-id>#{optional_category_id}</category-id>
</request>

YAML Request

---
project-id: #{project_id}
# optional
category-id: #{optional_category_id}

Response

<posts>
  <post>
    ... <!-- abbreviated post -->
  </post>
  <post>
    ... <!-- abbreviated post -->
  </post>
  ...
</posts>

Message archive per category

/projects/#{project_id}/msg/cat/#{category_id}/archive

This will return a summary record for each message in a particular category. (Note that a summary record includes only a few bits of information about a post, not the complete record.)

Response

<posts>
  <post>
    ... <!-- abbreviated post -->
  </post>
  <post>
    ... <!-- abbreviated post -->
  </post>
  ...
</posts>

Update comment

/msg/update_comment

Update a specific comment. This can be used to edit the content of an existing comment.

XML Request

<request>
  <comment_id>#{comment_id}</comment_id>
  <comment>
    <body>#{body}</body>
  </comment>
</request>

YAML Request

---
comment_id: #{comment_id}
comment:
  body: #{body}

Response

<comment>
  ...
</comment>

Update message

/msg/update/#{message_id}

Updates an existing message, optionally sending notifications to a selected list of people. Note that you can also upload files using this function, but you have to format the request as multipart/form-data. (See the ruby Basecamp API wrapper for an example of how to do this.)

XML Request

<request>
  <post>
    <category-id>#{category_id}</category-id>
    <title>#{title}</title>
    <body>#{body}</body>
    <extended-body>#{extended_body}</extended-body>
    <use-textile>1</use-textile> <!-- omit to not use textile -->
    <private>1</private> <!-- only for firm employees -->
  </post>
  <notify>#{person_id}</notify>
  <notify>#{person_id}</notify>
  ...
</request>

YAML Request

---
post:
  category-id: #{category_id}
  title: #{title}
  body: #{body}
  extended-body: #{extended_body}
  use-textile: #{true|false}
  private: #{true|false}
notify:
  - #{person_id}
  - #{person_id}
  ...

Response

<post>
  ...
</post>