Newer Version Available

This content describes an older version of this product. View Latest

ConnectApi Input Classes

Some ConnectApi methods take arguments that are instances of ConnectApi input classes.

Input classes are concrete unless marked abstract in this documentation. Concrete input classes have public constructors that take no arguments.

Some methods take arguments typed with an abstract class. You must pass in an instance of a concrete child class for these arguments.

Most properties for the input classes can be set. Read-only properties are noted in this documentation.

ConnectApi.Binary​​Input Class

Create a ConnectApi.BinaryInput object to attach files to feed items and comments.

The constructor is:

1ConnectApi.BinaryInput(blob, contentType, filename)

The constructor takes these arguments:

Argument Type Description Available Version
blob Blob Contents of the file to be used for input 28.0
contentType String MIME type description of the content, such as image/jpg 28.0
filename String File name with the file extension, such as UserPhoto.jpg 28.0

ConnectApi.CanvasAttachmentInput Class

Used to attach a canvas app to a feed item.

Subclass of ConnectApi.​Feed​Item​Attachment​​Input Class

Property Type Description Available Version
description String Optional. The description of the canvas app. 29.0
developerName String The developer name (API name) of the canvas app 29.0
height String Optional. The height of the canvas app in pixels. Default height is 200 pixels. 29.0
namespacePrefix String Optional. The namespace prefix of the Developer Edition organization in which the canvas app was created. 29.0
parameters String Optional. Parameters passed to the canvas app in JSON format. Example:
1{'isUpdated'='true'}
29.0
thumbnailUrl String Optional. A URL to a thumbnail image for the canvas app. Maximum dimensions are 120x120 pixels. 29.0
title String The title of the link used to call the canvas app. 29.0

ConnectApi.Chatter​​GroupInput Class

Property Type Description Available
canHave​ChatterGuests Boolean true if this group allows Chatter customers, false otherwise. After this property is set to true, it cannot be set to false. 29.0
description String The “Description” section of the group 29.0
information ConnectApi.​Group​Information​Input Class The “Information” section of a group. In the Web UI, this section is above the “Description” section. If the group is private, this section is visible only to members. 28.0
isArchived Boolean true if the group is archived, false otherwise. Defaults to false. 29.0
isAuto​ArchiveDisabled Boolean true if automatic archiving is turned off for the group, false otherwise. Defaults to false. 29.0
name String The name of the group 29.0
owner String The ID of the group owner. This property is available for PATCH requests only. 29.0
visibility ConnectApi.​GroupVisibilityType Specifies whether a group is private or public.
  • PrivateAccess—Only members of the group can see posts to this group.
  • PublicAccess—All users within the internal community can see posts to this group.
29.0

ConnectApi.Comment​​Input Class

Used to add rich comments, for example, comments that include @mentions or attachments.

Property Type Description Available Version
attachment ConnectApi.​Feed​Item​Attachment​​Input Class Optional. Specifies an attachment for the comment. Valid values are:
  • ContentAttachmentInput
  • NewFileAttachmentInput
LinkAttachmentInput is not permitted for comments.
28.0
body ConnectApi.​Message​​Body​Input Class Description of message body. The body can contain up to 25 mentions. 28.0

ConnectApi.ContentAttachmentInput Class

Used to attach existing content to a comment or feed item.

Subclass of ConnectApi.​Feed​Item​Attachment​​Input Class

Property Type Description Available Version
contentDocumentId String ID of the existing content. 28.0

ConnectApi.​Feed​Item​Attachment​​Input Class

Used to attach a file to a feed item.

This class is abstract and has no public constructor. You can make an instance only of a subclass.

ConnectApi.FeedItem​​Input Class

Used to add rich feed items, for example, feed items that include @mentions or files. Also used to bookmark a feed item.

Property Type Description Available Version
attachment ConnectApi.​Feed​Item​Attachment​​Input Class Specifies the attachment for the feed item. The feed item type is inferred based on the provided attachment. 28.0
body ConnectApi.​Message​​Body​Input Class Message body. The body can contain up to 25 mentions. 28.0
isBookmarked​​ByCurrentUser Boolean Specifies if the new feed item should be bookmarked for the user (true) or not (false). 28.0
originalFeedItemId String The 18-character ID of a feed item to share. 28.0
visibility ConnectApi.​FeedItem​VisibilityType Enum Specifies the type of feed item, such as a content post, a text post, and so on.
  • AllUsers—Visibility is not limited to internal users.
  • InternalUsers—Visibility is limited to internal users.
28.0

ConnectApi.​Group​Information​Input Class

Property Type Description Available Version
text String The text in the “Information” section of a group. 28.0
title String The title of the “Information” section of a group. 28.0

ConnectApi.HashtagSegmentInput Class

Used to include a hashtag in a feed item or comment.

Subclass of ConnectApi.​Message​Segment​Input Class

Property Type Description Available Version
tag String Text of the hash tag without the # (hash tag) prefix

Closing square brackets ( ] ) are not supported in hash tag text. If the text contains a closing square bracket ( ] ), the hash tag ends at the bracket.

Note

28.0

ConnectApi.LinkAttachmentInput Class

Used as part of a feed item attachment, to add links.

Subclass of ConnectApi.​Feed​Item​Attachment​​Input Class

Property Type Description Available Version
url String URL to be used for the link 28.0
urlName String Title of the link 28.0

ConnectApi.LinkSegmentInput Class

Used to include a link segment in a feed item or comment.

Subclass of ConnectApi.​Message​Segment​Input Class

Property Type Description Available Version
url String URL to be used for the link 28.0

ConnectApi.MentionSegmentInput Class

Used to include an @mention of a user or a group in a feed item or a comment. The maximum number of mentions you can include in a feed item or comment is 25.

Subclass of ConnectApi.​Message​Segment​Input Class

Property Type Description Available Version
id String ID of the user or group to be mentioned 28.0

Groups are available in 29.0

ConnectApi.​Message​​Body​Input Class

Used to add rich messages to feed items and comments.

Property Type Description Available Version
message​​Segments List<ConnectApi.​Message​Segment​Input Class> List of message segments contained in the body 28.0

ConnectApi.​Message​Segment​Input Class

Used to add rich message segments to feed items and comments.

This class is abstract and has no public constructor. You can make an instance only of a subclass.

ConnectApi.NewFileAttachmentInput Class

Describes a new file to be attached to a feed item. The actual binary file, that is the attachment, is provided as part of the BinaryInput in the method that takes this attachment input, such as postFeedItem or postComment.

Subclass of ConnectApi.​Feed​Item​Attachment​​Input Class

Property Type Description Available Version
description String Description of the file to be uploaded. 28.0
title String File’s title 28.0

ConnectApi.PhotoInput Class

Use to specify how crop a photo. Use to specify an existing file (a file that has already been uploaded).

Property Type Description Available version
cropSize Integer The length, in pixels, of any edge of the crop square. 29.0
cropX Integer The position X, in pixels, from the left edge of the image to the start of the crop square. Top left is position (0,0). 29.0
cropY Integer The position Y, in pixels, from the top edge of the image to the start of the crop square. Top left is position (0,0). 29.0
fileId String 18 character ID of an existing file. The key prefix must be 069 and the file size must be less than 2 MB.

Images uploaded on the Group page and on the User page don’t have file IDs and therefore can’t be used.

Note

25.0
versionNumber Integer Version number of the existing content. If not provided, the latest version is used. 25.0

ConnectApi.PollAttachmentInput Class

Used to attach a poll to a feed item.

Subclass of ConnectApi.​Feed​Item​Attachment​​Input Class

Property Type Description Available Version
pollChoices List<String> The text labels for the poll items. Polls must contain between 2 to 10 poll choices. 28.0

ConnectApi.TextSegmentInput Class

Used to include a text segment in a feed item or comment.

Subclass of ConnectApi.​Message​Segment​Input Class

Property Type Description Available Version
text String Plain text for this segment. If hashtags or links are detected in text, they are included in the comment as hashtag and link segments. Mentions are not detected in text and are not separated out of the text. Mentions require ConnectApi.MentionSegmentInput Class. 28.0

ConnectApi.TopicInput Class

Used to update a topic’s description and the spacing and capitalization of a topic’s name.

Property Type Description Available Version
description String Description of the topic 29.0
name String Name of the topic 29.0

ConnectApi.UserInput Class

Used to update a user.

Property Type Description Available Version
aboutMe String The aboutMe property of a ConnectApi.UserDetail output object. This property populates the “About Me” section of the user profile, which is visible to all members of a community or organization. 29.0