Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit a16b1ba

Browse files
committed
example: named endpoints
1 parent 19d7224 commit a16b1ba

3 files changed

Lines changed: 44 additions & 1 deletion

File tree

API Blueprint Specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ Defined by a resource [name (identifier)](#def-identifier) followed by an [HTTP
540540

541541
# <identifier> [<HTTP request method> <URI template>]
542542

543-
> **NOTE:** In the two latter cases the rest of this section represents the [Action section](#def-action-section) including its description and nested sections and **follows the rules of Action section instead**.
543+
> **NOTE:** In the latter two cases the rest of this section represents the [Action section](#def-action-section) including its description and nested sections and **follows the rules of Action section instead**.
544544
545545
#### Description
546546
An API [resource](http://www.w3.org/TR/di-gloss/#def-resource) as specified by its *URI* or a set of resources (a resource template) matching its *URI template*.

examples/12. Advanced Action.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ A resource action is – in fact – a state transition. This API example demons
66
## API Blueprint
77
+ [Previous: Resource Model](11.%20Resource%20Model.md)
88
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/12.%20Advanced%20Action.md)
9+
+ [Next: Named Endpoints](13.%20Named%20Endpoints.md)
910

1011
# Tasks [/tasks/tasks{?status,priority}]
1112

examples/13. Named Endpoints.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FORMAT: 1A
2+
3+
# Named Endpoints API
4+
This API example demonstrates how to define a standalone endpoint with an identifier.
5+
6+
## API Blueprint
7+
+ [Previous: Advanced Action](12.%20Advanced%20Action.md)
8+
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/13.%20Named%20Endpoints.md)
9+
10+
# Group Quick start
11+
12+
## Create message [POST /messages]
13+
14+
Start out by creating a message for the world to see.
15+
16+
+ Request (application/json)
17+
18+
{ "message": "Hello World!" }
19+
20+
+ Response 201
21+
22+
+ Headers
23+
24+
Location: /messages/1337
25+
26+
## Create a new task [POST /tasks]
27+
28+
Now create a task that you need to do at a later date.
29+
30+
+ Request (application/json)
31+
32+
{
33+
"name": "Exercise in gym",
34+
"done": false,
35+
"type": "task"
36+
}
37+
38+
+ Response 201
39+
40+
+ Headers
41+
42+
Location: /tasks/1992

0 commit comments

Comments
 (0)