Changes

Jump to navigation Jump to search
Line 288: Line 288:  
| DELETE /api/v1/projects/<id>/ || Destroys the current project and the resource related to it : Likes , Comments   
 
| DELETE /api/v1/projects/<id>/ || Destroys the current project and the resource related to it : Likes , Comments   
 
|-
 
|-
 +
|}
 +
 +
 +
==== Project Forking ====
 +
 +
{| class="wikitable"
 +
|-
 +
! Resource !! Description
 +
|-
 +
| GET /api/v1/forking/<project_id>/ ||  Currently to fork a project , authenticated user makes GET request to this end point with the project id they need to fork.This method creates a copy of the requested project and associates it to the requesting User's profile.There is a history field in the Project to hold the data about original creator of the project.
 +
|-
 +
| Example || curl  http://moksaya-rahulgaur.rhcloud.com/api/v1/forking/2/?username=vrinda\&api_key=b7c19215d088591e2dee07c2fb4df677ab1c9fbe
 +
|-
 +
| Response || {
 +
    "desc": "undefined",
 +
    "history": "project undefined  created by aregee forked by vrinda ",
 +
    "resource_uri": "/api/v1/forking/2/",
 +
    "screenshot": "/media/projects/lin.jpg",
 +
    "shared_date": "2013-09-20T19:07:57.861892",
 +
    "src": "/media/projects/file_rem.py",
 +
    "title": "undefined"
 +
}
 +
|-
 +
|}
 +
 +
==== Followers ====
 +
 +
{| class="wikitable"
 +
|-
 +
! Resource !! Description
 +
|-
 +
| GET /api/v1/relations/ || Returns a list of all the user relations with their resource.
 +
|-
 +
| POST /api/v1/relations/ ||  To create a follower/followee  relation between the two user we pass a JSON data with the resource_uri of the currently logged in user's profile  as follower and viewed  profile of the user as followee . Returns HTTP 201 Created Response and each relations has its own id and other meta deta.
 +
|-
 +
| Example || curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"follower":"/api/v1/profile/3/","followee":"/api/v1/profile/4/"}'  http://127.0.0.1:8000/api/v1/relations/?username=vrinda\&api_key=b7c19215d088591e2dee07c2fb4df677ab1c9fbe
 +
|-
 +
| DELETE /api/v1/relations/<id>/ ||  Making a delete request to a relation , deletes the unilateral relation between the user.
 
|}
 
|}
  
25

edits

Navigation menu