CRM-2 Social API

From Opentaps Wiki

Jump to: navigation, search

The social API allows you to record social interactions of your customers, such as views, likes (faves), votes for and against, and comments. They can be related to other activities or to other nodes, such as web pages or blog posts. The API does not include the user interface but is meant to be called from the user interface to record the interactions.

Contents

Summary

Gets the summary of social activities that were applied to a given activity.

Method: GET, URL extension: /social/activities/:parentNoteId

Parameters:

  • parentNoteId : id of the activity for which to get the summary

Returns a JSON structure with:

  • thumbsUp: number of thumbs-up
  • thumbsDown: number of thumbs-down
  • views: number of views
  • likes: number of likes
  • comments: number of comments
  • hasThumbUp: boolean flag indicating if the given user has thumb-up that activity
  • hasThumbDown: same with thumb-down
  • hasView: same with view
  • hasLike: same with like
  • hasComment: boolean flag indicating if the given user has commented on that activity

Thumbs Up

Records or retrieves the number of times the activity has been thumbed up.

Method: POST, URL extension: /social/thumb-up

Parameters:

  • parentNoteId : id of the activity for which to record a thumb up
  • userId : id of the user that thumbed the activity

Thumbs Down

Records or retrieves the number of times the activity has been thumbed down.

Method: POST, URL extension: /social/thumb-down

Parameters:

  • parentNoteId : id of the activity for which to record a thumb down
  • userId : id of the user that thumbed the activity

Views

Records or retrieves the number of times the activity has been viewed.

Method: POST, URL extension: /social/view

Parameters:

  • parentNoteId : id of the activity for which to record a view
  • userId : id of the user that viewed the activity

Like

Records or retrieves the likes or faves of an activity.

Method: POST, URL extension: /social/like

Parameters:

  • parentNoteId : id of the activity for which to record a like
  • userId : id of the user that viewed the activity

Comments

Records comments. A comment is first created in the pending state and will be emailed to the domain administrator (user with DOMAIN_CONF permission), who needs to approve or reject the comment. Only approved comments will be retrieved for display.

Posting comments

Method: POST, URL extension: /social/comment

Parameters:

  • parentNoteId : id of the activity for which to record a comment
  • userId : id of the user that commented
  • noteText : the text of the comment

Comments are pending moderation, the next method is to manage that.

Moderating comments

Method: POST or GET, URL extension: /social/comment/:_id/:action

Parameters:

  • _id : id of the comment
  • action : either "accept" or "reject"

With "accept" the comment becomes accepted and visible by all the users, "reject" rejects the comment and it stays invisible.

Retreiving comments

Method: GET, URL extension: /social/comments/:parentNoteId

Parameters:

  • parentNoteId : id of the activity for which to get the comments

Returns a JSON array of comment activities.



© Open Source Strategies, Inc. Development of this documentation site is sponsored by Open Source Strategies, Inc.
Help support opentaps with a subscription to this documentation site.