Likes

GET /api/messages/:message_id/likes
get a list of users who have liked the message

GET /api/messages/:message_id/comments/:comment_id/likes
get a list of users who have liked the comment

Success Response Code: 200

Params

Param name Description
message_id
required

message id to check for likes


Value: Must be a Integer
comment_id
optional

comment id to check for likes


Value: Must be a Integer

Response Fields

users users who have liked this object Array<User>

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/messages/438/likes.json"
curl -X GET -v --basic -u "emily@socialcast.com:demo" "https://demo.socialcast.com/api/messages/424/comments/85/likes.json"

Examples

GET /api/messages/40/comments/2/likes.json
200
{
  "users": [
    {
      "contact_info": {
        "email": "active'59@socialcast.com"
      },
      "manager": null,
      "custom_fields": [],
      "followable": false,
      "contact_id": null,
      "following_count": 0,
      "followers_count": 0,
      "status_message": null,
      "id": 68,
      "first_name": "J'øhn62",
      "last_name": "D'øe62",
      "name": "J'øhn62 D'øe62",
      "html_name": "J&#39;øhn62 D&#39;øe62",
      "url": "https://socialcast.socialcast.test/users/68-j%C3%B8hn62d%C3%B8e62",
      "avatars": {
        "is_system_default": true,
        "id": null,
        "square16": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square16-3b951350d61d203ece2fa5dd274fa7bd35275e132c17310d9006514f8839c857.png",
        "square30": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square30-6db66ac25c338d1e548a68465e2723ff63367c2aafbcc01db24c83964056b892.png",
        "square45": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square45-16865426333e244c59076d4f2475b711ed1ff9d12c97f4cf354f373a0170a1fd.png",
        "square70": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square70-1708999e8f1fea583408d7fc64b2177f853e4123bea2ffcf35f4839c8697e0ba.png",
        "square140": "https://socialcast.socialcast.test/assets-test/v6/avatars/default_user_square140-7da7e1d98b33ef152280b1f653cfd80e2db24b01b625a72abc320673eea5af53.png"
      },
      "username": "Jøhn62Døe62",
      "active": true,
      "terminated": false,
      "inactive": false,
      "role": "member",
      "type": "User",
      "title": null,
      "out_of_office": false,
      "out_of_office_on": null,
      "back_in_office_on": null,
      "company_login": null
    }
  ]
}

POST /api/messages/:message_id/likes/:comment_id/likes
like a message

POST /api/messages/:message_id/comments/:comment_id/likes/:comment_id/likes
like a comment

Success Response Code: 201

Params

Param name Description
message_id
required

id for message


Value: Must be a Integer
comment_id
optional

id for comment


Value: Must be a Integer

Response Fields

like like object Like
id id of the like Integer
user user who created the like User
created_at time when the like was created DateTime
unlikable whether or not the viewing user can unlike the object Boolean
parent_likes_count Number of likes the object has Integer

Example Curl Commands

curl -X POST -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/39/likes.json
curl -X POST -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/407/comments/66/likes.json

Examples

POST /api/messages/40/likes.json
{}
201
{
  "like": {
    "id": 1,
    "user": {
      "id": 68,
      "name": "J'øhn62 D'øe62",
      "url": "https://socialcast.socialcast.test/users/68-j%C3%B8hn62d%C3%B8e62"
    },
    "created_at": "2017-09-21T13:30:27-07:00",
    "unlikable": true,
    "parent_likes_count": 1
  }
}

DELETE /api/messages/:message_id/likes/:likes_id
unlike a message

DELETE /api/messages/:message_id/comments/:comment_id/likes/:comment_id/likes/:likes_id
unlike a comment

Success Response Code: 204

Params

Param name Description
message_id
required

id for message


Value: Must be a Integer
comment_id
optional

id for comment


Value: Must be a Integer
like_id
required

id of the like to remove


Value: Must be a Integer

Example Curl Commands

curl -X DELETE -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/407/likes/48
curl -X DELETE -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/407/comments/66/likes/63

Examples

DELETE /api/messages/40/comments/2/likes/3.json
{}
204

GET /api/messages/:message_id/likes/:comment_id/likes/:id
show an existing like on a message

GET /api/messages/:message_id/comments/:comment_id/likes/:comment_id/likes/:id
show an existing like on a comment

Success Response Code: 200

Params

Param name Description
message_id
required

id for message


Value: Must be a Integer
comment_id
optional

id for comment


Value: Must be a Integer
id
required

id for like


Value: Must be a Integer

Response Fields

like like object Like
id id of the like Integer
user user who created the like User
created_at time when the like was created DateTime
unlikable whether or not the viewing user can unlike the object Boolean

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/318/likes/16.json
curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/messages/426/comments/86/likes/61.json

Examples

GET /api/messages/40/likes/2.json
200
{
  "like": {
    "id": 2,
    "user": {
      "id": 68,
      "name": "J'øhn62 D'øe62",
      "url": "https://socialcast.socialcast.test/users/68-j%C3%B8hn62d%C3%B8e62"
    },
    "created_at": "2017-09-21T13:30:27-07:00",
    "unlikable": true
  }
}