The BalanceBowl project contract assigned to NESA by Makers
#APIS Plans
Where full URLs are provided in responses they will be rendered as if service is running on 'http://testserver/'.
Open endpoints require no plans and meals.
- load :
GET /api/plans/load
- planmeals :
GET /api/plan/meals
- allmeals :
GET /api/plans/allmeals
- loadmeal :
GET /api/meal/
Load all the meal plans available, if the user is premium it loads all the meal plans if user isnt premium then return only clasic plan and an object containing a parameter saying premium:false
URL : /api/plans/load
Method : GET
Auth required : YES
Data constraints
None
Data example
None
Code : 200 OK
Content example
[
{
planName:planname,
text:text,
planid:planid
},
{
planName:planname,
text:text,
planid:planid
},
{
planName:planname,
text:text,
planid:planid
}
//if user isnt on premium then return
{
planName:classicplan,
text:text,
planid:planid
},
{
premium:false
}
///////////////////////////////////
]
Code : 400 BAD REQUEST
Content :
{
"status": false,
"error": "error message"
}
Get the list list of meals arranged into their groupID check UI for clarifications the todays meal section
URL : /api/plans/meals
Method : GET
Auth required : YES
Data constraints
{
planID:[plan id ]
}
Data example
{
planID:string
}
Code : 200 OK
Content example
[
{
title:string,
id:string,
meals:[
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
},
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
},
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
}
]
},
{
title:string,
id:string,
meals:[
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
},
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
},
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
}
]
}
]
Code : 400 BAD REQUEST
Content :
{
"status": false,
"error": "error message"
}
Load the list of the meals from one group Note search items by groupID
URL : /api/plans/load
Method : GET
Auth required : YES
Data constraints
{
groupID:[group id]
}
Data example
{
groupID:string
}
Code : 200 OK
Content example
[
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
},
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
},
{
liked:boolean,
time:Breakfast||Lunch||Dinner,
detail:string,
imageresource:string,
groupID:string,
id:string
}
]