forked from hunvreus/carte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaning up and almost final raw design
- Loading branch information
Showing
12 changed files
with
351 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
path: '/stuff/:id' | ||
title: 'Delete a thing' | ||
type: 'DELETE' | ||
parameters: | ||
- name: 'id' | ||
description: 'the id of the thing to delete.' | ||
|
||
layout: nil | ||
--- | ||
|
||
This method allows the user to post a new thing to his stuff. | ||
|
||
### Request | ||
|
||
* Authentication is required. | ||
* The body is omitted. | ||
|
||
### Response | ||
|
||
Sends back a collection of things. | ||
|
||
```Status: 200 Deleted``` | ||
|
||
```{ | ||
code: 200, | ||
message: 'Your thing (id: 736) was deleted' | ||
}``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
path: '/stuff/:id' | ||
title: 'Update a thing' | ||
type: 'PUT' | ||
|
||
layout: post | ||
--- | ||
|
||
This method allows the user to retrieve his stuff. | ||
|
||
### Request | ||
|
||
#### Requirements | ||
|
||
* **URL**: `:id` is the id the thing to update.' | ||
* **Header**: Valid authentication token. | ||
* **Body**: can't be empty and must include at least **name**, a `string` that will be used as the name of the thing. | ||
|
||
#### Sample | ||
|
||
```Authentication: bearer f862f658-ad89-4fcb-995b-7a4c50554ff6``` | ||
```{ | ||
name: 'My new thing' | ||
}``` | ||
### Response | ||
Sends back a collection of things. | ||
```Status: 200 OK``` | ||
```{ | ||
{ | ||
id: thing_1, | ||
name: 'My first thing' | ||
}, | ||
{ | ||
id: thing_2, | ||
name: 'My second thing' | ||
} | ||
}``` | ||
For errors, see the [code] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
path: '/stuff' | ||
title: 'Post a thing' | ||
type: 'POST' | ||
|
||
layout: post | ||
--- | ||
|
||
This method allows users to crate a new thing. | ||
|
||
### Request | ||
|
||
Expects a fully formed thing object. | ||
|
||
```Authentication: bearer TOKEN``` | ||
|
||
```{ | ||
name: 'My new thing' | ||
}``` | ||
### Response | ||
**If succeeds**, returns the created thing. | ||
```Status: 201 Created``` | ||
```{ | ||
id: new_thing, | ||
name: 'My new thing' | ||
}``` | ||
ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
path: '/stuff' | ||
title: 'Get stuff' | ||
type: 'GET' | ||
|
||
layout: post | ||
--- | ||
|
||
This method allows users to retrieve stuff. | ||
|
||
### Response | ||
|
||
Sends back a collection of things. | ||
|
||
```Status: 200 OK``` | ||
|
||
```{ | ||
{ | ||
id: thing_1, | ||
name: 'My first thing' | ||
}, | ||
{ | ||
id: thing_2, | ||
name: 'My second thing' | ||
} | ||
}``` | ||
ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
path: '/login' | ||
title: 'Authenticate' | ||
|
||
layout: post | ||
--- | ||
|
||
This method allows users to retrieve stuff. | ||
|
||
### Response | ||
|
||
Sends back a collection of things. | ||
|
||
```Authentication: bearer TOKEN``` | ||
|
||
```{ | ||
id: thing_2, | ||
name: 'My second thing' | ||
}``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: 'Response status codes' | ||
|
||
layout: nil | ||
--- | ||
|
||
### Success | ||
|
||
### Error | ||
|
||
```Status: 401 Access denied``` | ||
|
||
```{ | ||
code: 401, | ||
message: 'Access denied: invalid authentication token.' | ||
}``` |
Oops, something went wrong.