Skip to content

Instantly share code, notes, and snippets.

@el0911
Created October 17, 2019 09:09
Show Gist options
  • Save el0911/da888423a8c47aab0816c08560009a49 to your computer and use it in GitHub Desktop.
Save el0911/da888423a8c47aab0816c08560009a49 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 Recepies

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

  • getRecepiesShort : GET /api/recepy/short
  • getRecepy : GET /api/recepy/
  • likeRecepy : GET /api/recepy/like/
  • bookRecepy : GET /api/recepy/book/

GetRecepiesShort

Get a list of 10 recepies per request, it performs a skip function based on the page number,

URL : /api/recepy/

Method : GET

Auth required : YES

Data constraints

{
    page:[page number]
}

Data example

{
    page:2
}

Success Response

Code : 200 OK

Content example

[
   {
       imgResource:[image Link],
       recepyNmae:[name of recepy],
       recepyID:[ID of recepy]
   }
]

Error Response

Code : 400 BAD REQUEST

Content :

    {
        msg:error message
    }

Recepy

Get

URL : /api/recepy/

Method : GET

Auth required : YES

Data constraints

{
   recepyID:[recepy ID]
}

Data example

 {
       recepyID: 2
 }

Success Response

Code : 200 OK

Content example

   {
   recepyID:[recepy ID],
   mageImageResource:[imageResource],
   listOfImages:[imageResource,
                 imageResource,
                 imageResource,
                 imageResource,
                 imageResource
                 ],
    ingredients:[
        ingredient,
        ingredient,
        ingredient,
        ingredient,
        ingredient
    ],
    additionalInfo:[
        addInfo,
        addInfo,
        addInfo,
        addInfo,
        addInfo
    ]
}

Error Response

Code : 400 BAD REQUEST

Content :

     {
       "msg": "error message"
      }

Like

Like a recepy

URL : /api/recepy/like

Method : Poat

Auth required : YES

Data constraints

{
   recepyID:[recepy ID]
}

Data example

    {
        recepyID:2
    }

Success Response

Code : 200 OK

Content example

   {
       msg:'true
   }

Error Response

Code : 400 BAD REQUEST

Content :

     {
       "msg": "error message"
      }

Bookmark

Bookmark a recepy

URL : /api/recepy/book

Method : Poat

Auth required : YES

Data constraints

{
   recepyID:[recepy ID]
}

Data example

    {
        recepyID:2
    }

Success Response

Code : 200 OK

Content example

   {
       msg:'true
   }

Error Response

Code : 400 BAD REQUEST

Content :

     {
       "msg": "error message"
      }

HowToCook

Returns a video resource link and a list of segments showing the the percentage of the video and the text said in that percentage checkout ui for clarification!!!

URL : /api/recepy/howtoccok

Method : GET

Auth required : YES

Data constraints

{
   recepyID:[recepy ID]
}

Data example

    {
        recepyID:2
    }

Success Response

Code : 200 OK

Content example

   {
      videsSrc:'video  src',
      steps:[
          {
              position:"[percentage of the video]",
              text:"[text description of that part]"
          },
          {
              position:"[percentage of the video]",
              text:"[text description of that part]"
          },
          {
              position:"[percentage of the video]",
              text:"[text description of that part]"
          }
      ]
   }

Error Response

Code : 400 BAD REQUEST

Content :

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