REST API:social feed Resource

REST API:social feed Resource

From LongJump Support Wiki

REST API:social feed Resource
Jump to: navigation, search

Working with postings in Relay feeds using the REST API.

Learn more: REST API Conventions and Considerations.

Contents

Requirements

List Postings

Method
GET
URI
  • https://na.longjump.com/networking/rest/social/feed
Return all postings from home page of currently logged in user
Return all postings that match the specified filter expression
For example, this request returns all postings to the current user's feed that contain the word "meeting":
https://na.longjump.com/networking/rest/social/feed?filter=feedMessage contains 'meeting'
Response
<platform>
    <social>
        <feed>
           <date_created>2011-05-03T22:51:30.000Z</date_created>
            <date_modified>2011-05-04T07:00:00.000Z</date_modified>
            <created_id type="USER" uri="..."
                displayValue="...">...user ID...</created_id>
            <modified_id type="USER" uri="..."
                displayValue="...">...user ID...</modified_id>
            <object_id/>
            <id>3d2f7438198b448cb5e288958e5d3aca</id>
            <feedFrom type="USER" uri="..."
                displayValue="...">...user ID...</feedFrom>
            <feedMessage>
             ...
            </feedMessage>
            <feedToType>2</feedToType>
            <feedTo uri="..."
                displayValue="Our Great Group">...feed ID...</feedTo>
            <linkName/>
            <fileId/>
            <generated>false</generated>
            <customActions/>
            <comments>
                <comment>
                    <date_created>2011-05-04T23:08:20.000Z</date_created>
                    <feedFrom type="USER" uri="..."
                      displayValue="..."
                      thumbnailId="...">...user ID...</feedFrom>
                    <feedMessage>
                     ...
                    </feedMessage>
                </comment>
                  ...
            </comments>
        </feed>
    </social>
    <social>
        <feed>
         ...
        </feed>
    </social>
     ...

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>N</recordCount>      <!-- Number of __ records returned -->
</platform>
See also: REST API:Error Codes

Get a Posting

Method
GET
URI
https://na.longjump.com/networking/rest/social/feed/{postingId}
Response
<platform>
    <social>
        <feed>
            <date_created>2011-05-03T22:51:30.000Z</date_created>
            <date_modified>2011-05-04T07:00:00.000Z</date_modified>
            <created_id type="USER" uri="..."
                displayValue="...">...user ID...</created_id>
            <modified_id type="USER" uri="..."
                displayValue="...">...user ID...</modified_id>
            <object_id/>
            <id>3d2f7438198b448cb5e288958e5d3aca</id>
            <feedFrom type="USER" uri="..."
                displayValue="...">...user ID...</feedFrom>
            <feedMessage>
             ...
            </feedMessage>
            <feedToType>2</feedToType>
            <feedTo uri="..."
                displayValue="Our Great Group">...feed ID...</feedTo>
            <linkName/>
            <fileId/>
            <generated>false</generated>
            <likedByLoggedInUser>true</likedByLoggedInUser>
            <customActions/>
            <comments>
                <comment>
                    <date_created>2011-05-04T23:08:20.000Z</date_created>
                    <feedFrom type="USER" uri="..."
                      displayValue="..."
                      thumbnailId="...">...user ID...</feedFrom>
                    <feedMessage>
                     ...
                    </feedMessage>
                </comment>
                  ...
            </comments>
        </feed>
    </social>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Post a Message

Method
POST
URI
https://na.longjump.com/networking/rest/social/feed
Request

Post a message to your feed:

<platform>
    <social>
        <feed>
            <feedMessage>...your posting here...</feedMessage>
            <feedToType>1</feedToType>
            <feedTo>...your user ID...</feedTo>
        </feed>
    </social>
</platform>

Comment on an existing posting:

<platform>
    <social>
        <feed>
            <feedMessage>...your comment here here...</feedMessage>
            <feedToType>5</feedToType>
            <feedTo>...ID of the posting you're commenting on...</feedTo>
        </feed>
    </social>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Delete a Posting

Method
DELETE
URI
https://na.longjump.com/networking/rest/social/feed/{postingId}
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Fields

Message Fields

These fields apply to both posted messages and comments. (Values like feedToType are predetermined for a comment, since it must relate to an existing posting.)

Note: Unless otherwise indicated, the attribute for a field is "Editable on Add or Update".
NameTypeAttributeRequired on AddDescriptionAdditional Information
id String Read Only Posting ID
feedToType String Type of feed the message was sent to. See Feed Types, below
feedTo String The ID of the feed the message was posted to Depending on the type of feed, this value could be a record ID, a group ID, etc.
customActions List A collection of active links added to a posting generated by a Data Policy See Active Links, below
feedFrom String User who posted message User ID
feedMessage String Text of the message
fileId String Document ID The document (file) the message was posted about.
linkUrl String A link to the posting
linkName String The name to use when publishing a link to the posting
generated Boolean True if the posting was generated automatically
generatedBy Number Type of resource the message came from Generated Types, below
likedByLoggedInUser Boolean Read Only True if the current user voted "like" for the posting
likeCount Number Read Only Number of people who have voted "like" for this posting
object_id String Read Only For a message posted to a record feed, this value contains the name of the object. feedTo contains the record ID.
date_modified Date Read Only UTC Format
date_created Date Read Only UTC Format
created_id Lookup Read Only User ID
modified_id Lookup Read Only User ID

Feed Types

Numeric Value Numeric Constant String Value String Constant Description
1 FEED_TO_TYPE_USER "user" TO_TYPE_USER_STRING User feed
2 FEED_TO_TYPE_GROUP "group" TO_TYPE_GROUP_STRING Group feed
3 FEED_TO_TYPE_RECORD "record" TO_TYPE_RECORD_STRING Record feed
4 FEED_TO_TYPE_FILE "document" TO_TYPE_FILE_STRING Document feed
5 FEED_TO_TYPE_FEED "posting" TO_TYPE_FEED_STRING Comments on a posting
Notes
  • Either a number or a string can be specified on add.
  • Constants can be found in the Social Constants section of the Javadocs.

Generated Types

Number Source of Message Generated for a Record
1 Workflow
2 Data policy
3 Note added to a record
4 Attachment added to a record
5 Related Appointment or Task added to a record
6 Related record added to a record
Note

Active Links

Active Links (aka "custom actions") can be added to a posting that is generated by a Data Policy.

Learn More: Adding an Active Link
Value Constant Description
1 CUSTOM_ACTION_TYPE_PAGE An active link (aka "custom action") that goes to a JSP page. (Part of a posting generated by a Data Policy.)
Note

Notification Types

Numeric Value Numeric Constant String Value String Constant Description
1 NOTIFICATION_TYPE_POSTING "posting" NOTIFICATION_TYPE_POSTING_STRING Notification of a posted message
2 NOTIFICATION_TYPE_LIKE "like" NOTIFICATION_TYPE_LIKE_STRING Notification of a "like" vote
Notes
  • Either a number or a string can be specified on add.
  • Constants can be found in the Social Constants section of the Javadocs.
Personal tools