-
Notifications
You must be signed in to change notification settings - Fork 2
RESTful API
annypanny edited this page Nov 29, 2016
·
78 revisions
http://www.django-rest-framework.org/topics/documenting-your-api/
- The heroku host our project in cloud.
- use the RESTful API url followed by this link to do all the web services.
- list of all posts public on the server (/posts)
- list of an single user's post public to you (/author/[author_id]/posts)
- list of an single post (/posts/[post_id])
- create a post (/posts/create)
- Edit a post (/posts/[post_id]/update)
- delete a post (/posts/[post_id]/destroy)
- list of all posts that are visible to the currently authenticated user (/author/posts)
- access to the comments in a post and could also create comment (/posts/[post_id]/comments)
- delete a comment (/comments/[comment_id]/destroy)
- info of a comment (/comments/[commnet_id])
- list of all friend for you with detail info (/author/[author_id]/network)
- list of friend requests of yours (/author/friends/friend_requests)
- [a single friend's all post (/author/[author_id]/posts)] (https://github.com/CMPUT404F16T06/CMPUT404Project/wiki/RESTful-API-F3)
- to unfriend (/author/friends/unfriend/[author_id])
- send local friend request (/author/friend_request/[author_id])
- accept friend request (/author/friend_request/accept/[author_id])
- reject friend request (/author/friend_request/reject/[author_id])
- a reponse if friends or not (/friends/[author_id])
- check if 2 authors are friends (/friends/[author_id1]/[author_id2])
- send and receive remote friend request to other nodes (/friendrequest)
- [list of authors (/author)] (https://github.com/CMPUT404F16T06/CMPUT404Project/wiki/RESTful-API-A1)
- get author info (/author/[author_id])
- create an author (/author/create)
- update author info (/author/[author_id]/update)
- [list of nodes (/nodes)] (https://github.com/CMPUT404F16T06/CMPUT404Project/wiki/RESTful-API-N1)
- [create a node (/nodes/create)] (https://github.com/CMPUT404F16T06/CMPUT404Project/wiki/RESTful-API-N2)
- [delete a node (/nodes/destroy/[node_id])] (https://github.com/CMPUT404F16T06/CMPUT404Project/wiki/RESTful-API-N3)
###Joshua's example for doc:
/posts/<post_id>
used to get the contents of post <post_id> is the id number of the post, and it's required. It returns a JSON. The JSON has x,y,z
Here's an example.
GET /posts/18 HTTP/1.1 Header: Value
200 OK...
JSON