GET /v1/spaces/:space_id/documents/:id
HTTP Verb: GET
Available statuses: 200 OK, 404 Not Found
Object: Document
Location: n/a
Formats: XML, JSON
Get a document by id
Params
No params available
Examples
Request JSON, using cURL utility:
curl -i -H "Authorization: Bearer _token" https://api.assembla.com/v1/spaces/_space_id/documents/_id.json
Response
HTTP/1.1 200 OK
Server: nginx/0.7.68
Date: Tue, 24 Jul 2012 11:24:40 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
..
{
"id":"aCCzYOimar4AEzsfS5feCJ",
"filename":"30012009.jpg",
"attachable_type":null,
"space_id":"c7s6iqyBWr4kvosfS5feCJ",
"filesize":387776,
"description":"",
"version":1,
"cached_tag_list":"",
"updated_at":"2011-12-07T10:42:08Z",
"content_type":"image/jpeg",
"attachable_id":null,
"updated_by":"bgnP_qA1Gr2QjIaaaHk9wZ",
"name":"30012009.jpg",
"url":"https://www.assembla.com/spaces/_space_id/documents/_id/download/_id",
"position":0,
"has_thumbnail":false,
"ticket_id":null,
"created_at":"2011-12-07T10:42:08Z",
"created_by":"bgnP_qA1Gr2QjIaaaHk9wZ",
"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/documents/_id.xml
Response
HTTP/1.1 200 OK
Server: nginx/0.7.68
Date: Tue, 24 Jul 2012 11:21:02 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200
...
<?xml version="1.0" encoding="UTF-8"?>
<document>
<attachable-guid nil="true"></attachable-guid>
<attachable-id nil="true"></attachable-id>
<ticket-id nil="true"></ticket-id>
<filesize type="integer">387776</filesize>
<space-id>c7s6iqyBWr4kvosfS5feCJ</space-id>
<attachable-type nil="true"></attachable-type>
<cached-tag-list></cached-tag-list>
<created-by>bgnP_qA1Gr2QjIaaaHk9wZ</created-by>
<content-type>image/jpeg</content-type>
<description></description>
<updated-by>bgnP_qA1Gr2QjIaaaHk9wZ</updated-by>
<position type="integer">0</position>
<has-thumbnail type="boolean">false</has-thumbnail>
<url>https://www.assembla.com/spaces/_space_id/documents/_id/download/_id</url>
<filename>30012009.jpg</filename>
<updated-at type="datetime">2011-12-07T10:42:08Z</updated-at>
<created-at type="datetime">2011-12-07T10:42:08Z</created-at>
<version type="integer">1</version>
<name>30012009.jpg</name>
<id>aCCzYOimar4AEzsfS5feCJ</id>
</document>
Description for each field: document object fields reference