add
Register a like on a piece of content on the platform.
Parameters
Name | Description |
user_id required | The user that’s performing the action. |
xref_id required | The cross reference id that the like is attached to. (ie: video_id, photo_id, statusId, etc.) |
type required | The cross reference content type that the like is attached to. (ie: blog_post, photo, video, photo_gallery, user_profile, group, forum_post, forum_thread, forum, message, site, audio, audio_gallery, podcast, petition, document, article, article_version, calendar_event, calendar, wiki_page, ugc_status, ext_content, discussion_post) |
rating required | The rating to associate with the like. Supports values 1-10. Ratings can be used for supporting different types of “reactions.” |
Request Syntax
https://services.onesite.com/1/likes/add.json?devkey=[devkey]&type=blog_post&xref_id=117118139&rating=10&user_id=229928503 |
JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
{ "code": 100, "message": "Successfully added.", "content": { "user": [ { "xref_type": "blog_post", "xref_id": "117118139" } ], "object": { "XrefID": 117118139, "XrefType": "blog_post", "Ratings": [ { "Rating": 10, "Count": 1, "First": { "userID": 229928503, "nodeID": 188234, "name": "ONEsite", "homeUrl": "http://www.onesitedemo.com/onedemo", "avatar": "http://images.onesite.com/resources/images/unisex_v4b.gif?ver=" } } ] } } } |