Skip to content

Latest commit

 

History

History
226 lines (141 loc) · 3.69 KB

API_DOCUMENTATION.md

File metadata and controls

226 lines (141 loc) · 3.69 KB

LifeWild's API Documentation

LifeWild's API is pretty simple and only lets you read LifeWild's article documents from the database.

Table of Contents

Find

API route to read Article documents.

Id

API route to retrieve article documents by its Id.


URI Path

https://lifewild.vercel.app/api/id


Search Param

query : string

Example query

https://lifewild.vercel.app/api/id?query=abc123


Response

Succes

This API route returns the following object when succesful:

{
    response: <articleDocuments>,
    length: <number>
}
Error

However, when an error occurs, it returns the following response object:

{
    response: <Error>,
    length: <number>
}

Vernacular Name

API route to retrieve article documents by its vernacular name.


URI Path

https://lifewild.vercel.app/api/vernacular-name


Search Params

query : string
quantity (optional): 'single' | 'Many' (defaults to 'single')

Example query

https://lifewild.vercel.app/api/vernacular-name?query=cat&quantity=many


Response

Succes

This API route returns the following object when succesful:

{
    response: <articleDocuments>,
    length: <number>
}
Error

However, when an error occurs, it returns the following response object:

{
    response: <Error>,
    length: <number>
}

Binomial Name

API route to retrieve article documents by its binomial name.


URI Path

https://lifewild.vercel.app/api/binomial-name


Search Params

query : string
quantity (optional): 'single' | 'Many' (defaults to 'single')

Example query

https://lifewild.vercel.app/api/binomial-name?query=cat&quantity=many


Response

Succes

This API route returns the following object when succesful:

{
    response: <articleDocuments>,
    length: <number>
}
Error

However, when an error occurs, it returns the following response object:

{
    response: <Error>,
    length: <number>
}

Conservation Status

API route to retrieve article documents by its vernacular name.


URI Path

https://lifewild.vercel.app/api/conservation-status


Search Params

query : string
quantity (optional): 'single' | 'Many' (defaults to 'single')

Example query

https://lifewild.vercel.app/api/conservation-status?query=cat&quantity=many


Response

Succes

This API route returns the following object when succesful:

{
    response: <articleDocuments>,
    length: <number>
}
Error

However, when an error occurs, it returns the following response object:

{
    response: <Error>,
    length: <number>
}