forked from abramhindle/CMPUT404-project-socialdistribution
-
Notifications
You must be signed in to change notification settings - Fork 1
Likes API
Fraser Redford edited this page Apr 15, 2021
·
20 revisions
This will retrieve all likes for a given author.
Basic authorization (base64 encoded username:password):
--header "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
or token authorization is required:
--header "Authorization: Token 9d9ed917fe1ead2d1e27ac7dc233348ed2e3d4c0"
No body required
[
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Lara Croft Likes your post",
"type": "Like",
"author":{
"type":"author",
"id":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"host":"https://team6-project-socialdistrib.herokuapp.com/",
"displayName":"Lara Croft",
"url":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"github":"http://github.com/laracroft"
},
"object":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/800efa883dda1e11db47671c4a3bbd9e"
},
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Jeff Likes your post",
"type": "Like",
"author":{
"type":"author",
"id":"https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"host":"https://team6-project-socialdistrib.herokuapp.com/",
"displayName":"Jeff",
"url":"https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"github":"http://github.com/Jeff"
},
"object":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/764efa883dda1e11db47671c4a3bbd9e"
}
]
-
200 OKfor a successful return of a list -
403 FORBIDDENif the requesting user is not authenticated -
400 BAD REQUESTif information is missing in the request
This will retrieve all the likes for a given comment specified in the path.
Basic authorization (base64 encoded username:password):
--header "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
or token authorization is required:
--header "Authorization: Token 9d9ed917fe1ead2d1e27ac7dc233348ed2e3d4c0"
No body required
[
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Lara Croft Likes your comment",
"type": "Like",
"author":{
"type":"author",
"id":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"host":"https://team6-project-socialdistrib.herokuapp.com/",
"displayName":"Lara Croft",
"url":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"github":"http://github.com/laracroft"
},
"object":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/764efa883dda1e11db47671c4a3bbd9e/comments/8290318092abd80e9faaa9"
},
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Jeff Likes your comment",
"type": "Like",
"author":{
"type":"author",
"id":"https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"host":"https://team6-project-socialdistrib.herokuapp.com/",
"displayName":"Jeff",
"url":"https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"github":"http://github.com/Jeff"
},
"object":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/764efa883dda1e11db47671c4a3bbd9e/comments/8290318092abd80e9faaa9"
}
]
-
200 OKfor a successful return of a list -
403 FORBIDDENif the requesting user is not authenticated -
400 BAD REQUESTif information is missing in the request
This will return a list of items that the given author has liked.
No body required
[
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Lara Croft Likes your comment",
"type": "Like",
"author":{
"type":"author",
"id":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"host":"https://team6-project-socialdistrib.herokuapp.com/",
"displayName":"Lara Croft",
"url":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"github":"http://github.com/laracroft"
},
"object":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/764efa883dda1e11db47671c4a3bbd9e/comments/8290318092abd80e9faaa9"
},
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Lara Croft Likes your post",
"type": "Like",
"author":{
"type":"author",
"id":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"host":"https://team6-project-socialdistrib.herokuapp.com/",
"displayName":"Lara Croft",
"url":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
"github":"http://github.com/laracroft"
},
"object":"https://team6-project-socialdistrib.herokuapp.com/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/800efa883dda1e11db47671c4a3bbd9e"
}
]
-
200 OKfor a successful return of a list -
403 FORBIDDENif the requesting user is not authenticated -
400 BAD REQUESTif information is missing in the request