Attachment
Representation of a file attachment. The url field can point to a file of any type hosted anywhere that is visible to your Jive instance. Attachments can be on Documents, Blog Posts, and Discussions. If you create an object with an attachment, the file will be automatically uploaded and hosted on your Jive instance. An example JSON representation looks like this:
{ "name" : "MyPicture.png", "doUpload" : true, "type" : "attachment", "size" : 7971, "contentType" : "img/png", "url" : "http://mydomain.com/spreadsheets/MyPicture.png", "id" : "1074" }
Examples:
POST to /contents creates a new document. The server will obtain the files specified in the attachments array and store them as attachments of the new content. The minimum set of fields you must include (to create a document and upload an attachment) are:
{ "content": { "type": "text/html", "text": "<body><p>Some interesting text</p></body>" }, "subject": "New Document", "type": "document", "attachments": [ { "doUpload": true, "url": "http://www.mysite.com/images/cat.jpg" } ] }
Create Document with an Attachment using mutlipart/form-data
POST to /contents creates a new document. Files included in the mutlipart/form-data request will be stored as attachments of the new content. The request must include a JSON part whose content type is "application/json" and a part for each attached file whose content type corresponds to the type of file and the part name is anything that you want (except for the word "json"). The minimum set of fields you must include (to create a document) are:
{ "content": { "type": "text/html", "text": "<body><p>Some interesting text</p></body>" }, "subject": "New Document", "type": "document" }
Fields
Field | Type | Mode † | Description |
---|---|---|---|
contentType | String | required | The content type of this attachment. |
doUpload | Boolean | required | An indicator of whether an attachment is new and should be uploaded. |
id | String | read-only | Identifier (unique within an object type and Jive instance) of this object. This field is internal to Jive and should not be confused with contentID or placeID used in URIs. |
name | String | optional | Filename of this attachment. |
resources | Object | read-only | Resource links (and related permissions for the requesting person) relevant to this object. |
size | Integer | read-only | The size (in bytes) of this attachment. |
url | String | required | The URL to retrieve the binary content of this attachment. |
Resources
Resource | Method | Description |
---|---|---|
self | GET | Return an updated version of this attachment. |
self | DELETE | Delete this attachment. |