Sample API Documentation 2

INTRODUCTION

Sample api documentation for sample project.

Allowed HTTPs requests:

PUT : To create resource
POST : Update resource
GET : Get a resource or list of resources
DELETE : To delete resource

Description Of Usual Server Responses:

200 OK - the request was successful (some API calls may return 201 instead).
201 Created - the request was successful and a resource was created.
204 No Content - the request was successful but there is no representation to return (i.e. the response is empty).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn’t have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
405 Method Not Allowed - requested method is not supported for resource.

Some sample

Table sample

TH TH
First Column Second Column
First Column Second Column

Quick start

Create message

POST https://example.com/messages
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "message": "Hello World!"
}
Responses201
Headers
Location: /messages/1337

Create message
POST/messages

Start out by creating a message for the world to see.


Create a new task

POST https://example.com/tasks
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Exercise in gym",
  "done": false,
  "type": "task"
}
Responses201
Headers
Location: /tasks/1992

Create a new task
POST/tasks

Now create a task that you need to do at a later date.


Notes

GET https://example.com/notes/abc123
Responses200
Headers
Content-Type: application/json
Body
{
    "id": "abc123",
    "title": "This is a note",
    "content": "This is the note content."
    "tags": [
        "todo",
        "home"
    ]
}
Schema
{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "title": {
            "type": "string"
        },
        "content": {
            "type": "string"
        },
        "tags": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}

Get a note
GET/notes/{id}

Gets a single note by its unique identifier.

URI Parameters
HideShow
id
string (required) Example: abc123

Unique identifier for a note


PATCH https://example.com/notes/abc123
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "title": "This is another note",
  "tags": [
    "todo",
    "work"
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}
Responses204
This response has no content.

Update a note
PATCH/notes/{id}

Modify a note’s data using its unique identifier. You can edit the title, content, and tags.

URI Parameters
HideShow
id
string (required) Example: abc123

Unique identifier for a note


Generated by aglio on 30 Jul 2020