The RESTful API for what will become: http://links.projectweekend.net
The development environment for this project is fully bootstrapped and portable with the help of: Vagrant, Docker, and Fig. If using Linux, all of the Vagrant stuff can be ignored since Docker runs natively.
vagrant up- Start the VM. On first launch a lot of things need to be downloaded and installed so it could take a little while. Subsequent launches are much faster.vagrant ssh- Connect to the VMvagrant halt- Shut down the VMvagrant destroy- Delete the VM./vagrant- The path on the VM where the project code is mounted. Allfigcommands mus be executed from this path.fig up- Start the web application and database containers. On first launch base containers will be downloaded from the Docker Registry so it could take a while. Subsequent launches are much faster.fig build- Rebuild the web application container. This needs to be done any time a new Python dependency is added torequirements.txtfig run web python manage.py syncdb- Run Django'ssyncdbcommand on a new database.fig run web python manage.py migtrate- Apply South database migrationsfig run web python manage.py test- Run all project tests
POST: /v1/maker/register
Body:
{
"email": "test@test.com",
"password": "adfadsf",
"first_name": "Thomas",
"last_name": "Jefferson"
}Response: None
Status Codes:
201- Registration was created400- Invalid request body
POST: /v1/maker/email/verification
Body:
{
"token": "asdjfkal48a09d853qlkjadfl93&%3l2k"
}Response: None
Status Codes:
200- Verification was successful400- Invalid request body
POST: /v1/maker/password/reset
Body:
{
"email": "test@test.com"
}Response: None
Status Codes:
201- Reset request was created400- Invalid request body
POST: /v1/maker/password/reset/update
Body:
{
"token": "alskdfj93lak4r&$@_23;lads",
"new_password": "newPassword",
"confirm_password": "newPassword"
}Status Codes:
200- Authentication was successful400- Invalid request body412- Invalid reset token
POST: /v1/maker/authenticate
Body:
{
"identifier": "test@test.com",
"password": "adfadsf"
}Response:
{
"token": "kja03984q0oaj34j*@$Fmjadfl"
}Status Codes:
200- Authentication was successful400- Invalid request body401- Invalid identifier/password
POST: /v1/maker/email
Body:
{
"new_email": "something@different.com"
}Response: None
Status Codes:
201- Request was created400- Invalid request body409- Email in use
POST: /v1/maker/email/update
Body:
{
"token": "jal39aULJ3IRA90W3R0@appsd03"
}Response: None
Status Codes:
200- Change was successful400- Invalid request body412- Invalid change token
GET: /v1/maker/self
Response:
{
"id": 3,
"identifier": "test@test.com",
"first_name": "Thomas",
"last_name": "Jefferson",
"email": "test@test.com",
"photo_url": "http://urlforphoto.com/image/something.jpg",
"bio": "This is my optional bio",
"joined": "2014-08-18T12:32:58.930Z"
}Status Codes:
200- Request was successful401- Not logged in
GET: /v1/maker
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 3,
"identifier": "test@test.com",
"first_name": "Thomas",
"last_name": "Jefferson",
"email": "test@test.com",
"photo_url": "http://urlforphoto.com/image/something.jpg",
"bio": "This is my optional bio",
"joined": "2014-08-18T12:32:58.930Z",
"folders": [],
"links": []
}
]
}Status Codes:
200- Request was successful401- Not logged in
GET: /v1/maker/:id
Response:
{
"id": 3,
"identifier": "test@test.com",
"first_name": "Thomas",
"last_name": "Jefferson",
"email": "test@test.com",
"photo_url": "http://urlforphoto.com/image/something.jpg",
"bio": "This is my optional bio",
"joined": "2014-08-18T12:32:58.930Z",
"folders": [],
"links": []
}Status Codes:
200- Request was successful401- Not logged in
POST: /v1/folder
Body:
{
"name": "Cool Links",
"Description": "Random links I thought were cool",
"is_public": true
}Response:
{
"id": 1,
"name": "Cool Links",
"description": "Random links I thought were cool",
"is_public": true,
"created": "2014-08-19T00:05:51.611Z"
}Status Codes:
201- Folder was created400- Invalid request body401- Not logged in409- Duplicate folder name
GET: /v1/folder
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "Cool Links",
"description": "Random links I thought were cool",
"links": [
{
"id": 2,
"folder": 1,
"url": "https://learn.adafruit.com/flora-and-codebender",
"note": "Using Codebender with Flora",
"photo_url": "",
"created": "2014-08-04T00:00:26.284Z"
}
],
"is_public": true,
"created": "2014-08-03T23:23:43.117Z"
}
]
}Status Codes:
200- Request was successful401- Not logged in
GET: /v1/folder/:id
Response:
{
"id": 1,
"name": "Cool Links",
"description": "Random links I thought were cool",
"links": [
{
"id": 2,
"folder": 1,
"url": "https://learn.adafruit.com/flora-and-codebender",
"note": "Using Codebender with Flora",
"photo_url": "",
"created": "2014-08-04T00:00:26.284Z"
}
],
"is_public": true,
"created": "2014-08-03T23:23:43.117Z"
}Status Codes:
200- Request was successful401- Not logged in404- Folder does not exist
POST: /v1/link
Body:
{
"url":"https://learn.adafruit.com/flora-and-codebender",
"note":"Using Codebender with Flora",
"folder":1
}Response:
{
"id": 3,
"folder": 1,
"url": "https://learn.adafruit.com/flora-and-codebender",
"note": "Using Codebender with Flora",
"photo_url": "",
"created": "2014-08-19T00:43:18.064Z"
}Status Codes:
201- Link was created400- Invalid request body401- Not logged in
GET: /v1/link
Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 3,
"folder": null,
"url": "https://learn.adafruit.com/flora-and-codebender",
"note": "Using Codebender with Flora",
"photo_url": "",
"created": "2014-08-19T00:43:18.064Z"
}
]
}Status Codes:
200- Request was successful401- Not logged in
GET: /v1/link/:id
Response:
{
"id": 3,
"folder": null,
"url": "https://learn.adafruit.com/flora-and-codebender",
"note": "Using Codebender with Flora",
"photo_url": "",
"created": "2014-08-19T00:43:18.064Z"
}Status Codes:
200- Request was successful401- Not logged in404- Link does not exist