Skip to content
aitvaPublic

About

A simple API to store blog data.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog API

A simple and unsecure API to store blog data. The server limit the number of request from an IP at 264 per minute.

Store Article

Add an article in the database.

  • URL:

    /article/{id}/

  • Method:

    POST

  • URL Param:

    required:
    id=[string] represents an user ID

  • Data Param:

    {
        "title": "My Article",
        "content": "Whatever I want to say!"
    }
  • Success Response:

    Code: 200 OK
    Content:

    {
        "title": "My Article",
        "content": "Whatever I want to say!"
    }
  • Error Response:

    Code: 400 Bad Request
    Content: error as plain/text

    Code: 500 Internal Server Error
    Content: error as plain/text

Get Article

Get an article from the database.

  • URL:

    /article/{id}/{title}

  • Method:

    GET

  • URL Param:

    required:
    id=[string] represent an user ID
    title=[string] represent the title of an article

  • Data Param:

    None

  • Success Response:

    Code: 200 OK
    Content:

    {
        "title": "My Article",
        "content": "Whatever I want to say!"
    }

Delete Article

Delete an article from the database.

  • URL:

    /article/{id}/{title}

  • Method:

    DELETE

  • URL Param:

    required:
    id=[string] represent an user ID
    title=[string] represent the title of an article

  • Data Param:

    None

  • Success Response:

    Code: 200 OK
    Content: None

  • Error Response:

    Code: 400 Bad Request
    Content: error as plain/text

    Code: 404 Not Found
    Content: error as plain/text

    Code: 500 Internal Server Error
    Content: error as plain/text

Get All Article

Get all article from an user.

  • URL:

    /articles/{id}/{order}/

  • Method:

    GET

  • Headers:

    optional:
    Accept: text/xml ask the server to send data as XML

  • URL Param:

    required:
    id=[string] represent an user ID

    optional:
    order=[desc|asc] ask the server to order in an ascending or descending way

  • Data Param:

    None

  • Success Response:

    Code: 200 OK
    Content:

    [{
        "title": "My Article",
        "content": "Whatever I want to say!"
    },{
        "title": "My Other Article",
        "content": "Whatever I want to add!"
    }]
  • Error Response:

    Code: 400 Bad Request
    Content: error as plain/text

    Code: 404 Not Found
    Content: error as plain/text

    Code: 500 Internal Server Error
    Content: error as plain/text

Delete All Article

Delete all article from an user.

  • URL:

    /articles/{id}/

  • Method:

    DELETE

  • URL Param:

    required:
    id=[string] represent an user ID

  • Data Param:

    None

  • Success Response:

    Code: 200 OK
    Content: None

  • Error Response:

    Code: 400 Bad Request
    Content: error as plain/text

    Code: 404 Not Found
    Content: error as plain/text

    Code: 500 Internal Server Error
    Content: error as plain/text

About

A simple API to store blog data.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

⌂ 换网址