# GET /message
+ Response 200 (text/plain)
      
      Hello World!

Examples

  • Hello World
    # GET /message
    + Response 200 (text/plain)
    
            Hello World!
    
    
    
    
    
    
    
    {
        "_version": "2.0",
        "metadata": [],
        "name": "",
        "description": "",
        "resourceGroups": [
            {
                "name": "",
                "description": "",
                "resources": [
                    {
                        "name": "",
                        "description": "",
                        "uriTemplate": "/message",
                        "model": {},
                        "parameters": [],
                        "actions": [
                            {
                                "name": "",
                                "description": "",
                                "method": "GET",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "200",
                                                "description": "",
                                                "headers": [
                                                    {
                                                        "name": "Content-Type",
                                                        "value": "text/plain"
                                                    }
                                                ],
                                                "body": "Hello World!\n",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
  • Multiple Methods
    # /messages/{id}
    
    ## GET
    + Response 200 (text/plain)
    
            Hello World!
    
    ## DELETE
    + Response 204
    
    
    {
        "_version": "2.0",
        "metadata": [],
        "name": "",
        "description": "",
        "resourceGroups": [
            {
                "name": "",
                "description": "",
                "resources": [
                    {
                        "name": "",
                        "description": "",
                        "uriTemplate": "/messages/{id}",
                        "model": {},
                        "parameters": [],
                        "actions": [
                            {
                                "name": "",
                                "description": "",
                                "method": "GET",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "200",
                                                "description": "",
                                                "headers": [
                                                    {
                                                        "name": "Content-Type",
                                                        "value": "text/plain"
                                                    }
                                                ],
                                                "body": "Hello World!\n",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "name": "",
                                "description": "",
                                "method": "DELETE",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "204",
                                                "description": "",
                                                "headers": [],
                                                "body": "",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
  • Named Calls
    # Message [/messages/{id}]
    
    ## Retrieve Message [GET]
    + Response 200 (text/plain)
    
            Hello World!
    
    ## Delete Message [DELETE]
    + Response 204
    
    
    {
        "_version": "2.0",
        "metadata": [],
        "name": "",
        "description": "",
        "resourceGroups": [
            {
                "name": "",
                "description": "",
                "resources": [
                    {
                        "name": "Message",
                        "description": "",
                        "uriTemplate": "/messages/{id}",
                        "model": {},
                        "parameters": [],
                        "actions": [
                            {
                                "name": "Retrieve Message",
                                "description": "",
                                "method": "GET",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "200",
                                                "description": "",
                                                "headers": [
                                                    {
                                                        "name": "Content-Type",
                                                        "value": "text/plain"
                                                    }
                                                ],
                                                "body": "Hello World!\n",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "name": "Delete Message",
                                "description": "",
                                "method": "DELETE",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "204",
                                                "description": "",
                                                "headers": [],
                                                "body": "",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
  • Larger Example
    # Message of the Day API
    A simple [MOTD](http://en.wikipedia.org/wiki/Motd_(Unix)) API.
    
    # Message [/messages/{id}]
    This resource represents one particular message identified by its *id*.
    
    ## Retrieve Message [GET]
    Retrieve a message by its *id*.
    
    + Response 200 (text/plain)
    
            Hello World!
    
    ## Delete Message [DELETE]
    Delete a message. **Warning:** This action **permanently** removes the message from the database.
    
    + Response 204
    
    
    {
        "_version": "2.0",
        "metadata": [],
        "name": "Message of the Day API",
        "description": "A simple [MOTD](http://en.wikipedia.org/wiki/Motd_(Unix)) API.\n\n",
        "resourceGroups": [
            {
                "name": "",
                "description": "",
                "resources": [
                    {
                        "name": "Message",
                        "description": "This resource represents one particular message identified by its *id*.\n\n",
                        "uriTemplate": "/messages/{id}",
                        "model": {},
                        "parameters": [],
                        "actions": [
                            {
                                "name": "Retrieve Message",
                                "description": "Retrieve a message by its *id*.\n\n",
                                "method": "GET",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "200",
                                                "description": "",
                                                "headers": [
                                                    {
                                                        "name": "Content-Type",
                                                        "value": "text/plain"
                                                    }
                                                ],
                                                "body": "Hello World!\n",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "name": "Delete Message",
                                "description": "Delete a message. **Warning:** This action **permanently** removes the message from the database.\n\n",
                                "method": "DELETE",
                                "parameters": [],
                                "examples": [
                                    {
                                        "name": "",
                                        "description": "",
                                        "requests": [],
                                        "responses": [
                                            {
                                                "name": "204",
                                                "description": "",
                                                "headers": [],
                                                "body": "",
                                                "schema": ""
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }

For future plans & tracked issues check out the API Blueprint GitHub Issues.

Get Started

Use the reference API Blueprint parser – Snow Crash or one of its bindings.

Get Snow Crash

$ brew install --HEAD \
  https://raw.github.com/apiaryio/snowcrash/master/tools/homebrew/snowcrash.rb

Build notes for platforms: Linux, Windows

Create your first API

$ cat << 'EOF' | snowcrash --format json
# My API
## GET /message
+ Response 200 (text/plain)

        Hello World!
EOF
{
  "name": "My API",
  "description": ""
  ...

Bindings

Tooling

Fork me on GitHub