HTTP Verb: GET

Available statuses: 200 OK, 204 No Content, 404 Not Found

Object: Document

Location: n/a

Formats: XML, JSON

Returns a list of attachments associated with the ticket.

Params

Not available

Examples

Request JSON, using cURL utility:

curl -i -H "Authorization: Bearer _token" https://api.assembla.com/v1/spaces/_space_id/tickets/_number/attachments.json

Response

HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Thu, 19 Jul 2012 11:46:28 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...

[
  {
    "name": "Screenshot",
    "filename": "screenshot.jpg",
    "content_type": "image/jpg",
    "created_by": "dd_iFeDNur4PMj5bfBjDYC",
    "id": "bUtq946fKr4PCc5bfBjDYC",
    "version": 1,
    "filesize": 42608,
    "updated_by": "dd_iFeDNur4PMj5bfBjDYC",
    "description": "Description goes here",
    "cached_tag_list": "",
    "position": 0,
    "url": "https://www.assembla.com/spaces/_space_id/documents/_id/download/_id",
    "created_at": "2013-07-09T05:35:57Z",
    "updated_at": "2013-07-09T05:35:57Z",
    "ticket_id": 285,
    "attachable_type": "Ticket",
    "has_thumbnail": false,
    "space_id": "d6_muWDNyr4PMj5bfBjDYC",
    "attachable_id": 285,
    "attachable_guid": null
  },
  ...
]

JSON is formatted here for readability, in a real response JSON body is inline with no indentation.

Request XML, using cURL utility:

curl -i -H "Authorization: Bearer _token" https://api.assembla.com/v1/spaces/_space_id/tickets/_number/attachments.xml

Response

HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Thu, 19 Jul 2012 11:44:49 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...

<?xml version="1.0" encoding="UTF-8"?>
<documents type="array">
  <document>
    <name>Screenshot</name>
    <filename>screenshot.jpeg</filename>
    <content-type>image/jpg</content-type>
    <created-by>dd_iFeDNur4PMj5bfBjDYC</created-by>
    <id>bUtq946fKr4PCc5bfBjDYC</id>
    <version type="integer">1</version>
    <filesize type="integer">42608</filesize>
    <updated-by>dd_iFeDNur4PMj5bfBjDYC</updated-by>
    <description>Description goes here</description>
    <cached-tag-list></cached-tag-list>
    <position type="integer">0</position>
    <url>https://www.assembla.com/spaces/_space_id/documents/_id/download/_id</url>
    <created-at type="datetime">2013-07-09T05:35:57Z</created-at>
    <updated-at type="datetime">2013-07-09T05:35:57Z</updated-at>
    <ticket-id type="integer">285</ticket-id>
    <attachable-type>Ticket</attachable-type>
    <has-thumbnail type="boolean">false</has-thumbnail>
    <space-id>d6_muWDNyr4PMj5bfBjDYC</space-id>
    <attachable-id type="integer">285</attachable-id>
    <attachable-guid nil="true"></attachable-guid>
  </document>
  ...
</documents>

Description for each field: Document object fields reference