(POST methods are closed for use. However, it will work correctly when you run it on your computer)
It is required to include X-Auth-Token
in the header for all requests.
Header
Type
Description
X-Auth-Token
string
required . Your api token
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/supplement/
axios
. get ( "https://vitamins-and-supplements.vercel.app/api/supplement/" , {
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
} )
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
Parameter
Type
Description
tag
string
required . Tag information of the item to be called
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/supplement/tag
axios
. get ( "https://vitamins-and-supplements.vercel.app/api/supplement/tag" , {
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
} )
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
POST /api/supplement/create
Body
Type
name
string
rating
number
recommendation
string
tags
string[]
benefits
string[]
whoShouldUse
string[]
dose
string
timing
string
suggestions
string[]
curl -X POST -H " Content-Type: application/json" -H " X-Auth-Token: YOUR_API_KEY" -d ' {YOUR_BODY_VALUES}' https://vitamins-and-supplements.vercel.app/api/supplement/create
axios
. post (
"https://vitamins-and-supplements.vercel.app/api/supplement/create" ,
{
YOUR_BODY_VALUES ,
} ,
{ headers : { "X-Auth-Token" : YOUR_API_KEY } }
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
PUT /api/supplement/update?name=
Query String
Type
Description
name
string
required . The name
value of the item to be updated
curl -X PUT -H " Content-Type: application/json" -H " X-Auth-Token: YOUR_API_KEY" -d ' {"updatedValue": "Updated description"}' https://vitamins-and-supplements.vercel.app/api/supplement/update? name=supplement
axios
. put (
"ttps://vitamins-and-supplements.vercel.app/api/supplement/update?name=supplement" ,
{
updatedValue : "Updated description" ,
} ,
{ headers : { "X-Auth-Token" : YOUR_API_KEY } }
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
DELETE /api/supplement/delete?name=
Query String
Type
Description
name
string
required . The name
value of the item to be deleted
curl -X DELETE -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/supplement/delete? name=supplement
axios
. delete (
"https://vitamins-and-supplements.vercel.app/api/supplement/delete?name=supplement" ,
{
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
}
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/vitamin/
axios
. get ( "https://vitamins-and-supplements.vercel.app/api/vitamin/" , {
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
} )
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
Parameter
Type
Description
tag
string
required . Tag information of the item to be called
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/vitamin/tag
axios
. get ( "https://vitamins-and-supplements.vercel.app/api/vitamin/tag" , {
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
} )
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
Body
Type
name
string
rating
number
recommendation
string
tags
string[]
benefits
string[]
whoShouldUse
string[]
dose
string
timing
string
suggestions
string[]
curl -X POST -H " Content-Type: application/json" -H " X-Auth-Token: YOUR_API_KEY" -d ' {YOUR_BODY_VALUES}' https://vitamins-and-supplements.vercel.app/api/vitamin/create
axios
. post (
"https://vitamins-and-supplements.vercel.app/api/vitamin/create" ,
{
YOUR_BODY_VALUES ,
} ,
{ headers : { "X-Auth-Token" : YOUR_API_KEY } }
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
PUT /api/vitamin/update?name=
Query String
Type
Description
name
string
required . The name
value of the item to be called
curl -X PUT -H " Content-Type: application/json" -H " X-Auth-Token: YOUR_API_KEY" -d ' {"updatedValue": "Updated description"}' https://vitamins-and-supplements.vercel.app/api/vitamin/update? name=vitamin
axios
. put (
"ttps://vitamins-and-supplements.vercel.app/api/vitamin/update?name=vitamin" ,
{
updatedValue : "Updated description" ,
} ,
{ headers : { "X-Auth-Token" : YOUR_API_KEY } }
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
DELETE /api/vitamin/delete?name=
Query String
Type
Description
name
string
required . The name
value of the item to be deleted
curl -X DELETE -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/vitamin/delete? name=vitamin
axios
. delete (
"https://vitamins-and-supplements.vercel.app/api/vitamin/delete?name=vitamin" ,
{
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
}
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/category/
axios
. get ( "https://vitamins-and-supplements.vercel.app/api/category/" , {
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
} )
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
Fetch All Supplement Categories
GET /api/category/supplements
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/category/supplements/
axios
. get (
"https://vitamins-and-supplements.vercel.app/api/category/supplements/" ,
{
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
}
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
Fetch All Vitamin Categories
GET /api/category/vitamins
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/category/vitamins/
axios
. get ( "https://vitamins-and-supplements.vercel.app/api/category/vitamins/" , {
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
} )
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
GET /api/search/supplement?name=
Query String
Type
Description
name
string
required . The name
value of the item to be called
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/search/supplement? name=supplement
axios
. get (
"https://vitamins-and-supplements.vercel.app/api/search/supplement?name=supplement" ,
{
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
}
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
GET /api/search/vitamin?name=
Query String
Type
Description
name
string
required . The name
value of the item to be called
curl -X GET -H " X-Auth-Token: YOUR_API_KEY" https://vitamins-and-supplements.vercel.app/api/search/vitamin? name=vitamin
axios
. get (
"https://vitamins-and-supplements.vercel.app/api/search/vitamin?name=vitamin" ,
{
headers : { "X-Auth-Token" : YOUR_API_KEY } ,
}
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;
post requests are unavailable
Body
Type
username
string
email
number
password
string
curl -X POST -H " Content-Type: application/json" -H " X-Auth-Token: YOUR_API_KEY" -d ' {YOUR_BODY_VALUES}' https://vitamins-and-supplements.vercel.app/api/auth/register
axios
. post (
"https://vitamins-and-supplements.vercel.app/api/auth/register" ,
{
YOUR_BODY_VALUES ,
} ,
{ headers : { "X-Auth-Token" : YOUR_API_KEY } }
)
. then ( ( response ) => console . log ( response . data ) )
. catch ( ( error ) => console . error ( error ) ) ;