REST API:socialUser Element

From LongJump Support Wiki

Work with user feeds in Relay, using the REST API.

Learn more: REST API Conventions and Considerations.

Requirements

List the Things a User is Following

Method
GET
URI
  • https://na.longjump.com/networking/rest/social/getFollowing
Returns the things the currently logged in user is following
  • https://na.longjump.com/networking/rest/social/getFollowing?userId={id}
Returns the things the specified user is following
Returns the things users selected by the filter criteria are following
Query Parameters
  • userId - ID of a specific user
  • filter_expression - An expression that specifies selection criteria.
For more information, see: Specifying Query Parameters in REST APIs
Response

This sample response shows the four kinds of resources that someone might be following: A user, group, document, or record.

<platform>
    <social>
        <socialUser>
             <socialUserId uri="..." displayValue="...name...">...user ID...</socialUserId>
        </socialUser>
    </social>
    <social>
         <group>
            <groupId uri="..." displayValue="...name...">...group id...</groupId>
        </group>
    </social>
    <social>
        <socialDocument>
            <socialDocumentId uri="..." displayValue="...name...">...document ID...</socialDocumentId>
        </socialDocument>
    </social>
    <social>
        <socialRecord>
            <socialRecordId uri="https://{domain}/networking/rest/record/{object_id}/{record_id}"
                displayValue="{record_name}">{record_id}</socialRecordId>
        </socialRecord>
   </social>
     ...

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>N</recordCount>      <!-- Number of things the user is following -->
</platform>
See also: REST API:Error Codes

List a User's Followers

Method
GET
URI
  • https://na.longjump.com/networking/rest/social/getFollowers?type=1&id={user_id}
  • https://na.longjump.com/networking/rest/social/getFollowers?type=1&filter={filter_expression}
Query Parameters
  • type - The Relay Feed Type for a user
  • user_id - ID of a specific user
  • filter_expression - An expression that specifies selection criteria.
    (If the "type" argument is left off, the filter expression can be used to search for any number of things.)
For more information, see: Specifying Query Parameters in REST APIs
Response
<platform>
    <social>
        <socialUser>
            <socialUserId uri=..." displayValue="...">...user ID...</socialUserId>
        </socialUser>
    </social>
    <social>
        <socialUser>
         ...
        </socialUser>
    </social>
     ...

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

Follow a User

Method
POST
URI
https://na.longjump.com/networking/rest/social/follow
Request
<platform>
    <social>
        <socialUser>
           <socialUserId>...user id...</socialUserId>    
        </socialUser>
    </social>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Update a User's Notification Settings

Use the REST API:user Resource to update notification settings. For descriptions of the options, see the listing of Fields in that page.

Method
PUT
URI
https://na.longjump.com/networking/rest/user/{user_id}
Request
  <platform>
    <user>
        <emailNotificationOptions>
            <userWallPost>true</userWallPost>
            <recordWallPost>true</recordWallPost>
            <documentWallPost>true</documentWallPost>
            <groupWallPost>true</groupWallPost>
            <commentOnMyPost>true</commentOnMyPost>
            <commentOnComment>true</commentOnComment>
            <like>true</like>
        </emailNotificationOptions>
    </user>
</platform>