Attachment

Representation of an attachment object. 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:
Create Document with an Attachment

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 multipart/form-data

POST to /contents creates a new document. Files included in the multipart/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"
  }

The following rules govern updating of attachments:

  • If attachment block is not there, then Jive will not make any changes to attachments associated with content
  • If attachment block is empty, then Jive will delete all attachments associated with content
  • If attachment block is present, then Jive will replace attachments associated with content

Fields

FieldTypeMode Description
contentTypeStringrequired

The content type of this attachment.

doUploadBooleanrequired

An indicator of whether an attachment is new and should be uploaded.

idStringread-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.

nameStringoptional

Filename of this attachment.

resourcesObjectread-only

Resource links (and related permissions for the requesting person) relevant to this object.

sizeIntegerread-only

The size (in bytes) of this attachment.

statusStringread-only

Published status of this content object.

  • incomplete - Content object is in draft mode
  • awaiting moderation - Content object is waiting for moderation by an approver
  • rejected - Content object has been rejected for publication by an approver
  • published - Content object has been published
urlStringrequired

The URL to retrieve the binary content of this attachment.

followedBooleanread-only

Whether the current user is following this object.

Availability:

Will be present only for object types that support being followed.

→ Fields used by update and create operations
→ Fields used only by create operations
→ Fields not used by update or create operations

Resources

ResourceMethodDescription
selfGET

Return an updated version of this attachment.

selfDELETE

Delete this attachment.