Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Created September 21, 2011 14:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trevorturk/1232220 to your computer and use it in GitHub Desktop.
Save trevorturk/1232220 to your computer and use it in GitHub Desktop.
Basecamp API: example uploading a file and attaching to a message
curl -v -H 'Accept: application/xml' -F Filedata=@/path/to/file https://trevorturk.basecamphq.com/upload
curl -v -H 'Accept: application/xml' -H 'Content-Type: application/xml' -u TOKEN:X \
-d "
<post>
<title>Test</title>
<body>Test</body>
<attachments>
<file>
<file>ID_FROM_FIRST_REQUEST</file>
<original-filename>ORIGINAL_FILENAME</original-filename>
</file>
</attachments>
</post>" \
https://trevorturk.basecamphq.com/projects/PROJECT_ID/posts.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment