static
osapi.jive.corev3.attachments
Static class for getting Attachments
. Attachments cannot be
created directly. They are created as part of creating a Document
,
Blog Post
, or Message
(reply to a discussion).
Example:
Create a document with an attachment
To create a Document with an attachment, create a document and include the "attachments" field. See the method documents.create. Attachments are created by providing the URL of a publicly available file (e.g. a file on a server you manage or publicly available on the internet). Any file type is supported. The file will be automatically uploaded to your Jive instance.
//Create a document with an attachment var documentJSON = { "content": { "type": "text/html", "text": "Some interesting text" }, "subject": "A document with an attachment", "attachments": [ { "doUpload": true, "url": "http://www.mysite.com/files/presentation_9-29-2012.ppt" } ] }; var request = osapi.jive.corev3.documents.create(documentJSON); request.execute(function(data) { console.log("Created a new document with this attachment:", data.attachments[0]); });
Methods
↑
Attachment Representation of the requested attachment
get(options)
GET /attachments/{uri}
Retrieves
Attachment
Description
Return a single attachment by its URI.
Options:
Name | Type | Required | Description |
---|---|---|---|
uri | String | true | URI of the attachment to get |
fields | String | false | Names of the fields to be returned |