Sample API Documentation 2
API Endpoint
https://example.comINTRODUCTION
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 ¶
Headers
Content-Type: application/json
Body
{
"message": "Hello World!"
}
Headers
Location: /messages/1337
Create messagePOST/messages
Start out by creating a message for the world to see.
Create a new task ¶
Headers
Content-Type: application/json
Body
{
"name": "Exercise in gym",
"done": false,
"type": "task"
}
Headers
Location: /tasks/1992
Create a new taskPOST/tasks
Now create a task that you need to do at a later date.
Notes ¶
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 noteGET/notes/{id}
Gets a single note by its unique identifier.
- id
string
(required) Example: abc123Unique identifier for a note
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
}
Update a notePATCH/notes/{id}
Modify a note’s data using its unique identifier. You can edit the title
,
content
, and tags
.
- id
string
(required) Example: abc123Unique identifier for a note
Generated by aglio on 30 Jul 2020