Skip to content

Instantly share code, notes, and snippets.

@el0911
Created October 9, 2019 16:44
Show Gist options
  • Save el0911/d0725a7487c52ee963108b7be85b1ab3 to your computer and use it in GitHub Desktop.
Save el0911/d0725a7487c52ee963108b7be85b1ab3 to your computer and use it in GitHub Desktop.

BALANCEBOWL API Documentation Templates

By Somto Achu

The BalanceBowl project contract assigned to NESA by Makers

#APIS Blog

Where full URLs are provided in responses they will be rendered as if service is running on 'http://testserver/'.

Closed Endpoints

Closed endpoints requre authorization header

  • blog : GET /api/blog/
  • load : GET /api/blog/load

Blog

Get a random list of blog post from the DB

URL : /api/blog/

Method : GET

Auth required : YES

Data constraints

None

Data example

None

Success Response

Code : 200 OK

Content example

[
    {
        name:string,
        imageresourcemini:string,
        time:fromated date string (look at ui)
        rating:float,
        blogID,string
    },
     {
        name:string,
        imageresourcemini:string,
        time:fromated date string (look at ui)
        rating:float,
        blogID,string
    },
     {
        name:string,
        imageresourcemini:string,
        time:fromated date string (look at ui)
        rating:float,
        blogID,string
    },
     {
        name:string,
        imageresourcemini:string,
        time:fromated date string (look at ui)
        rating:float,
        blogID,string
    }
]

Error Response

Code : 400 BAD REQUEST

Content :

     {
       "status": false,
       "error": "error message"
      }

Load

Load info about blog, infcluding blog titles image resouce and author details, note the blog content is kinda tricky on its own, its gonna b an array of objects in the format

{
    text:string||imageresouce,
    type:paraggraph||subtitle||img
}

The idea behind this is so the app can know what am gonna render its common sense

URL : /api/blog/load

Method : GET

Auth required : YES

Data constraints

{
    blogID:[blog id ]
}

Data example

{
    blogID:string
}

Success Response

Code : 200 OK

Content example

[
     {
         title:string,
         id:string,
         content:[
            {
                text:string||imageresouce,
                type:paraggraph||subtitle||img
            },
            {
                text:string||imageresouce,
                type:paraggraph||subtitle||img
            },
            {
                text:string||imageresouce,
                type:paraggraph||subtitle||img
            }
         ],
         aurthor:{
             name:string,
             title:string,
             imageresource:string
         }
     }   
]

Error Response

Code : 400 BAD REQUEST

Content :

     {
       "status": false,
       "error": "error message"
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment