Documents Fields
To fetch metadata of Document object send a GET request to:
https://api.assembla.com/v1/meta/documents.(json|xml)
example. request json with curl utility:
curl -H "authorization: bearer _token" https://api.assembla.com/v1/meta/documents.json
example. request xml with curl utility:
curl -H "authorization: bearer _token" https://api.assembla.com/v1/meta/documents.xml
table below is the list of fields contained in the response, this list will be properly formatted to json or xml as requested.
Fields
| Param | Data type | Access | Description |
|---|---|---|---|
| id | string | read | Document identifier |
| attachable_type | string | write | The object that document is associated with, possible values are in bold:
|
| created_by | string | read | User id that uploaded the document |
| description | text | read/write | Document description |
| ticket_id | integer | read | Ticket id that document is associated with, this field will be set automatically to value of attachable_id when attachable_type entity is set to Ticket, field is not modifieble. |
| attachable_guid | string | read/write | In order to associate a document to an object with a guid use attachable_guid as object id along with attachable_type set to coresponding value |
| cached_tag_list | string | read/write | Document tag list |
| position | integer | read/write | Position of file in Files tool |
| file | blob | write | The field where file blob should be populated |
| filesize | integer | read | Size of file in bytes |
| filename | string | read/write | Custom name of a file, if not set the original file name is used |
| updated_at | datetime | read | Date and time when document was last time updated |
| created_at | datetime | read | Date and time when document was created |
| version | int | read | Document version |
| updated_by | string | read | The User id who last updated the document |
| name | string | read/write | Name of the document, original filename is used by default |
| has_thumbnail | boolean(0,1) | read | A boolean flag shows if document has thumbnail, common for images |
| content_type | string | read | Content type of document |
| attachable_id | integer | read/write | In order to associate a document to an object with an integer id use attachable_id as object id along with attachable_type set to coresponding value. The field works the same as attachable_guid but instead of guid it accepts integer values only. |
| space_id | string | read | Space id that document is associated with |
| url | string | read | The URL where document can be downloaded |
Validations
| Field | Validator | Description |
|---|---|---|
| created_by | presence validator | Field should be present, set automatically on document creation. |
| space_id | presence validator | Field should be present, set automatically on document creation. |
| attachable_type | inclusion validator | Should include a value from following list: Ticket, Flow, Milestone. Leaving this field empty is acceptable. |
| name | presence validator | Name should be present. |