forked from abramhindle/CMPUT404-project-socialdistribution
-
Notifications
You must be signed in to change notification settings - Fork 1
Retrieve Post by ID
Fraser Redford edited this page Apr 15, 2021
·
1 revision
This will retrieve the specific post given a post ID 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 requirements
No request required
{
"type": "post",
"title": "This is the third best post of all time",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/a3b412cdef384862ad5fb8a5366e0e47/posts/abcdefc8cb4a47879c95442f0ee2a514",
"source": "https://team6-project-socialdistrib.herokuapp.com/",
"origin": "https://team6-project-socialdistrib.herokuapp.com/",
"description": "this is a text post",
"contentType": "text/plain",
"content": "This is some text that goes in the post body",
"categories": [
"Test",
"post",
"author"
],
"count": 0,
"size": 50,
"comments": "https://team6-project-socialdistrib.herokuapp.com/author/a3b412cdef384862ad5fb8a5366e0e47/posts/abcdefc8cb4a47879c95442f0ee2a514/comments",
"commentList": [],
"published": "2021-04-01T19:07:34.802718Z",
"visibility": "PUBLIC",
"unlisted": false,
"author": {
"type": "author",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/a3b412cdef384862ad5fb8a5366e0e47",
"host": "https://team6-project-socialdistrib.herokuapp.com/",
"displayName": "fraser",
"url": "https://team6-project-socialdistrib.herokuapp.com/author/a3b412cdef384862ad5fb8a5366e0e47",
"github": "github.com/fredford"
}
}
-
200 OKupon a successful retrieval of a post -
403 FORBIDDENif a user is not authenticated -
400 BAD REQUESTif bad information is passed in the request