Introduction
API Endpoint localhost:4000/api/
A social media application for pets management
User Authentication
API Requests for User Authenicaiton
Errors
200 OK - the request was successful (some API calls may return 201 instead).
201 Created - the request was successful and a resource was created.
204 No Content - the request was successful but there is no representation to return (i.e. the response is empty).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
500 Internal Server Error - requested method is not supported for resource.
Register
localhost:4000/api/auth/register
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" POST 'localhost:4000/api/post/create' \
--data-raw '{
"username" : "pokemon1",
"email" : "yonaca9337@wwrmails.com",
"password" : "madara123"
}'
Result example :
{
"message":"Successfully Send Secret Code to the mail id"
}
Verify Email
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/create' \
--data-raw '{
"secret_code":73851
}'
URL : localhost:4000/api/auth/verifyEmail
Result example :
{
"message": "successfully verified email",
"user": {
"id": "Gg0DNb5sdPRDi15OqzcW",
"username": "pokemon1",
"email": "yonaca9337@wwrmails.com",
"password": "$2a$10$.OwJNElJMrbtGQuPjQspC.m0B79wCszzv8J/9ZgaByAoZttxWkxoC",
"pets_count": 0,
"pet_ids": [],
"post_ids": [],
"followers": [],
"following": [],
"liked_post_ids": [],
"mentioned_post_ids": [],
"fav_animals_ids": [],
"order_ids": [],
"remainder_ids": [],
"email_verified": false,
"is_private": false,
"public_to": []
}
}
This is to verify email of the registered user A secret code generated and sent to email, it should be used in this request to verify the email
Login
# Here is a curl example
curl --location --request POST 'localhost:4000/api/auth/login' \
--data-raw '{
"username" : "sunny@123",
"password" : "madara123"
}'
URL : localhost:4000/api/auth/login
Result example :
{
"username": "sunny@123",
"email": "bimliyaydi@enayu.com",
"password": "$2a$10$WFKMmllXMrCf/fwfjlmQbeaGxuYjBEn8rmbyYAAcSuQ5SdDvkaCQq",
"pets_count": 0,
"pet_ids": [],
"post_ids": [],
"followers": [],
"following": [],
"liked_post_ids": [],
"fav_animals_ids": [],
"order_ids": [],
"remainder_ids": [],
"email_verified": false
}
This is login api.
Forgot password
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/create' \
--data-raw '{
"id": "U71VFDzm4wWzc9IoNXS8",
"email":"ligeh99925@fft-mail.com"
}'
URL : localhost:4000/api/auth/forgotpassword
Result example :
{
"message" : "Secret Code is send to the Given Mail id"
}
Forgot password api sends the secret code the mail id of the user
User
User attributes:
id (String) : unique identifier.
username (String) : unique identifier.
email (String) : email id of the user.
age (number) : Age of the User.
pets_count(number) : No of the pets the User owned.
Errors
200 OK - the request was successful (some API calls may return 201 instead).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
500 Internal Server Error - requested method is not supported for resource.
Get Current User details
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/auth/user' \
--data-raw '{
}'
URL : localhost:4000/api/auth/user
Result example :
{
"user": {
"id": "Gg0DNb5sdPRDi15OqzcW",
"username": "pokemon1",
"email": "yonaca9337@wwrmails.com",
"password": "$2a$10$.OwJNElJMrbtGQuPjQspC.m0B79wCszzv8J/9ZgaByAoZttxWkxoC",
"pets_count": 0,
"pet_ids": [],
"post_ids": [],
"followers": [],
"following": [],
"liked_post_ids": [],
"mentioned_post_ids": [],
"fav_animals_ids": [],
"order_ids": [],
"remainder_ids": [],
"email_verified": false,
"is_private": false,
"public_to": []
}
}
We get user details for the current user
Edit User
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/editUser' \
--data-raw '{
"id": "U71VFDzm4wWzc9IoNXS8",
"username": "pokemon1"
}'
URL : localhost:4000/api/auth/editUser
Result example :
{
"message":"Successfully Edited Your Profile"
}
This is api call for editing the user from backend
Follow User
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/auth/follow' \
--data-raw '{
"username": "aschente"
}'
URL : localhost:4000/api/auth/follow
Result example :
{
"message": "Followed succesfully"
}
Following the user
Unfollow User
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/auth/unfollow' \
--data-raw '{
"username": "aschente"
}'
URL : localhost:4000/api/auth/unfollow
Result example :
{
"message": "Unfollowed succesfully"
}
Unfollowing the User
Post
Post attributes:
id (String) : unique identifier.
description (String) : description of the given Post
media_urls (String) : Media URL link
author_id (String) : Post author ID
likes_count(number) : No of the likes for the Post
liked_by (list) : List of ids like the post
date_of_creation (date) : Created Date and Time of the Post.
date_of_modify(date) : Modified Date and Time of the Post.
Errors
200 OK - the request was successful (some API calls may return 201 instead).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
500 Internal Server Error - requested method is not supported for resource.
Create Post
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/create' \
--data-raw '{
"media_urls" : "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg",
"description" : "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening, watching the birds, they are letting me get closer to them. So I was able to capture portraits of some birds like dove, robins, sunbird, etc. Will post the portraits of other birds later.. #earthinfocus @sony#neelakanta_sriram #freedom #instagram #instagood #nofilter #nofilterneeded #natgeoyourshot #natureinfocus #portrait #yourshotphotographer @aschente"
}'
URL : localhost:4000/api/post/create
Result example :
{
"id": "Ep3TeVt3MPN05bu25CUS",
"description": "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening, watching the birds, they are letting me get closer to them. So I was able to capture portraits of some birds like dove, robins, sunbird, etc. Will post the portraits of other birds later.. #earthinfocus @sony#neelakanta_sriram #freedom #instagram #instagood #nofilter #nofilterneeded #natgeoyourshot #natureinfocus #portrait #yourshotphotographer @aschente",
"media_urls": [
"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg"
],
"author_id": "U71VFDzm4wWzc9IoNXS8",
"likes_count": 0,
"liked_by": [],
"date_of_creation": 1595575879436,
"date_of_modify": 1595575879436
}
You can create post by this api
Delete All Posts
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/delete/all' \
--data-raw '{
}'
URL : localhost:4000/api/post/delete/all
Result example :
{
"message": "Successfully deleted all Post"
}
Delete all the Posts
Delete Post By id
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/delete/id' \
--data-raw '{
"id": "RUtha7tgnmRZVnmADdAV"
}'
URL : localhost:4000/api/post/delete/id
Result example :
Delete post via Id's of the Post
Update Post
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/update' \
--data-raw '{
"id": "RUtha7tgnmRZVnmADdAV",
"description": "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening. @aschente"
}'
URL : localhost:4000/api/post/update
Result example :
{
"message" : "Updated Successfully"
}
Updating the post
Like Post
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/like' \
--data-raw '{
"post_id": "Ep3TeVt3MPN05bu25CUS"
} '
URL : localhost:4000/api/post/like
Result example :
{
"message": "Liked Added"
}
like the post
Remove like
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/unlike' \
--data-raw '{
"post_id": "Ep3TeVt3MPN05bu25CUS"
}'
URL : localhost:4000/api/post/unlike
Result example :
{
"message": "Liked Removed"
}
Unlink the given Post
Get all post by user id
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/post/user/id' \
--data-raw '{
"id": "U71VFDzm4wWzc9IoNXS8",
}'
URL : localhost:4000/api/post/user/id
Result example :
Getting all post sorted by User ids.
Get post by its ID
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/post/id' \
--data-raw '{
"post_id": "xUvPc2nB5YNzTafcS0au"
}'
URL : localhost:4000/api/post/id
Result example :
{
"id": "xUvPc2nB5YNzTafcS0au",
"description": "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening, watching the birds, they are letting me get closer to them. So I was able to capture portraits of some birds like dove, robins, sunbird, etc. Will post the portraits of other birds later.. #earthinfocus @sony#neelakanta_sriram #freedom #instagram #instagood #nofilter #nofilterneeded #natgeoyourshot #natureinfocus #portrait #yourshotphotographer @aschente",
"media_urls": [
"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg"
],
"author_id": "U71VFDzm4wWzc9IoNXS8",
"likes_count": 0,
"liked_by": [],
"date_of_creation": 1595577350801
}
Getting Post details by its id.
Get post by Users Username
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/post/user/username' \
--data-raw '{
"username": "aschente"
}'
URL : localhost:4000/api/post/user/username
Result example :
{
"id": "xUvPc2nB5YNzTafcS0au",
"description": "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening, watching the birds, they are letting me get closer to them. So I was able to capture portraits of some birds like dove, robins, sunbird, etc. Will post the portraits of other birds later.. #earthinfocus @sony#neelakanta_sriram #freedom #instagram #instagood #nofilter #nofilterneeded #natgeoyourshot #natureinfocus #portrait #yourshotphotographer @aschente",
"media_urls": [
"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg"
],
"author_id": "U71VFDzm4wWzc9IoNXS8",
"likes_count": 0,
"liked_by": [],
"date_of_creation": 1595577350801
}
Getting Post details by Users Username
Get Liked Post of a current User
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/post/liked' \
--data-raw ''
URL : localhost:4000/api/post/liked
Result example :
{
"id": "xUvPc2nB5YNzTafcS0au",
"description": "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening, watching the birds, they are letting me get closer to them. So I was able to capture portraits of some birds like dove, robins, sunbird, etc. Will post the portraits of other birds later.. #earthinfocus @sony#neelakanta_sriram #freedom #instagram #instagood #nofilter #nofilterneeded #natgeoyourshot #natureinfocus #portrait #yourshotphotographer @aschente",
"media_urls": [
"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg"
],
"author_id": "U71VFDzm4wWzc9IoNXS8",
"likes_count": 0,
"liked_by": [],
"date_of_creation": 1595577350801
}
Getting All the liked Post details by Current User.
Get post of the Mentioned User
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/post/mentioned_user' \
--data-raw '
{
"username": "aschente"
}'
URL : localhost:4000/api/post/mentioned_user
Result example :
{
"id": "xUvPc2nB5YNzTafcS0au",
"description": "High key portraits of a Laughing Dove with different compositions.#shotonsony #a6000 .As daily I'm spending some time on the terrace, in the morning and evening, watching the birds, they are letting me get closer to them. So I was able to capture portraits of some birds like dove, robins, sunbird, etc. Will post the portraits of other birds later.. #earthinfocus @sony#neelakanta_sriram #freedom #instagram #instagood #nofilter #nofilterneeded #natgeoyourshot #natureinfocus #portrait #yourshotphotographer @aschente",
"media_urls": [
"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg"
],
"author_id": "U71VFDzm4wWzc9IoNXS8",
"likes_count": 0,
"liked_by": [],
"date_of_creation": 1595577350801
}
Getting post of the Mentioned User
Add like to Post
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/like' \
--data-raw '
{
"id": "xUvPc2nB5YNzTafcS0au"
}'
URL : localhost:4000/api/post/like
Result example :
{
"message": "Successfully Liked the Post"
}
Adding like to given Post.
Unlike the Given Post
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/post/unlike' \
--data-raw '
{
"id": "xUvPc2nB5YNzTafcS0au"
}'
URL : localhost:4000/api/post/unlike
Result example :
{
"message": "Successfully Unliked the Post"
}
Unliking the Given Post
Pet
Pet attributes:
id (String) : unique identifier.
pet_name (String) : Name of the given Pet
owner_id (String) : Owner Id of the pet
animal_type (String) : Type of animal
dob (date) :Date of birth of the animal
Errors
200 OK - the request was successful (some API calls may return 201 instead).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
500 Internal Server Error - requested method is not supported for resource.
Register a Pet
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/pet/register' \
--data-raw '{
"petName": "aschente",
"animalType": "dog",
"dob": 1595577350801
}'
URL : localhost:4000/api/pet/register
Result example :
{
"message": "successfully registered new pet"
}
Registering a Pet.
Get all the Pet List
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" Get 'localhost:4000/api/pet/' \
--data-raw ''
URL : localhost:4000/api/pet/
Result example :
{
"petsList": [
{
"pet_id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"animal_type": "dog",
"dob": 1595577350801
}
]
}
Getting the all Pets list.
Get Pets of the owner
# Here is a curl example
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/pet/owner' \
--data-raw ''
URL : localhost:4000/api/pet/owner
Result example :
{
"pet_id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"animal_type": "dog",
"dob": 1595577350801
}
Getting Pets of the owner.
Get Pets By User id
# Here is a curl example
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/pet/userid' \
--data-raw '{
"id": "U71VFDzm4wWzc9IoNXS8"
}'
URL : localhost:4000/api/pet/userid
Result example :
{
"pet_id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"animal_type": "dog",
"dob": 1595577350801
}
Getting Pets of the owner.
Update Pet info
# Here is a curl example
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/pet/update' \
--data-raw '{
"id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente_igris",
"animal_type": "cat",
"dob": 1595577350801
}'
URL : localhost:4000/api/pet/update
Result example :
{
"pet_id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente_igris",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"animal_type": "cat",
"dob": 1595577350801
}
Getting Pets of the owner.
Remove Pet
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/pet/remove' \
--data-raw '{
"id": "gpYadlSOtRRDjOfW5ayB"
}'
URL : localhost:4000/api/pet/remove
Result example :
{
"message": "Successfully Removed the Pet"
}
Removing Pet.
Update Pet owner
# Here is a curl example
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/pet/update' \
--data-raw '{
"id": "gpYadlSOtRRDjOfW5ayB",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"updated_owner_id":"wWzc9IoNXS8S3mNGdBb"
}'
URL : localhost:4000/api/pet/update
Result example :
{
"pet_id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente_igris",
"owner_id": "wWzc9IoNXS8S3mNGdBb",
"animal_type": "cat",
"dob": 1595577350801
}
Getting Pets of the owner.
Babysitter
Post attributes:
id (String) : unique identifier.
address (dictonary of strings) : Address of the babysitter
status (boolean) : Status
contact_no (number) : contact info
list_of_pets_accepted_before(list of pet ids) : list of pets accepted before
current_babysitting_pets (list of pet ids) : List of current babysitting pets
requests_list (list of pet ids) : list of request pets.
payment_details(list of numbers) : list of payment details.
Register Babysitter
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/babysitter/register' \
--data-raw '{
"address": {
"lane": "wWzc9IoNXS8S3mNGdBb",
"street": "9889898989",
"city": [],
"state": [],
"country": [],
"postalCode": []
},
"status": "on",
"contact_no": "9889898989",
}'
URL : localhost:4000/api/babysitter/register
Result example :
{
"message" : "Successfully Registered"
}
registering the babysitter.
Get Babysitter
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/babysitter/get' \
--data-raw ''
URL : localhost:4000/api/babysitter/get
Result example :
{
"babysitter_id": "SOtRRDjOfW5gpYadlayB",
"address": {
"lane": "wWzc9IoNXS8S3mNGdBb",
"street": "9889898989",
"city": [],
"state": [],
"country": [],
"postalCode": []
},
"status": "on",
"contact_no": "9889898989",
"list_of_pets_accepted_before": [],
"current_babysitting_pets": [],
"requests_list": [],
"payment_details": []
}
Getting Pets of the owner.
Edit Babysitter
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/babysitter/update' \
--data-raw '{
"address": {
"lane": "qwerqwer",
"street": "qwerqwer",
"city": 'hud',
"state": 'hud',
"country": 'hud',
"postalCode": 500000
},
"contact_no": "9889898989",
}'
URL : localhost:4000/api/babysitter/update
Result example :
{
"message": "Updated Successfully"
}
Edit the baby sitter details.
Get Current Babysitting pets
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/babysitter/pets' \
--data-raw ''
URL : localhost:4000/api/babysitter/pets
Result example :
{
"petsList": [
{
"pet_id": "gpYadlSOtRRDjOfW5ayB",
"pet_name": "aschente",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"animal_type": "dog",
"dob": 1595577350801
}
]
}
Get current baby sitting list.
Get Request list
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/babysitter/requestlist' \
--data-raw ''
URL : localhost:4000/api/babysitter/requestlist
Result example :
{
"petsList": [
{
"pet_id": "RRDjOfW5gpYadlSOtayB",
"pet_name": "igris",
"owner_id": "U71VFDzm4wWzc9IoNXS8",
"animal_type": "cat",
"dob": 1595577350801
}
]
}
Get request baby sitting list.
Change Status
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" Post 'localhost:4000/api/babysitter/requestlist' \
--data-raw '{
"id":"SOtRRDjOfW5gpYadlayB",
"status": "off"
}'
URL : localhost:4000/api/babysitter/requestlist
Result example :
{
"message": "Changed the Status Successfully"
}
Changing the status of the User.
Search
Errors
200 OK - the request was successful (some API calls may return 201 instead).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
500 Internal Server Error - requested method is not supported for resource.
Mating search
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" Post 'localhost:4000/api/search/mate' \
--data-raw '{
"id" : "50c3lNtAEGJUxIuDvj8b"
}'
URL : localhost:4000/api/search/mate
Result example :
{
pets_lists : [ {
"age": 4,
"biography": "Always meow",
"name": "Jaja",
"ownerId": "2n4S7ZsyNKZ2w2f6g0IulGNvOl12",
"pet_mating": true,
"pet_sitting": true,
"picture_url": "",
"type": "Cat"
},
{
"age": 4,
"biography": "how how",
"name": "gege",
"ownerId": "2n4S7ZsyNKZ2w2f6g0IulGNvOl12",
"pet_mating": true,
"pet_sitting": true,
"picture_url": "",
"type": "Cat"
}
]
}
Search api for Mating.
Pet sitting Search
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" Post 'localhost:4000/api/search/sitting' \
--data-raw '{
"id" : "50c3lNtAEGJUxIuDvj8b"
}'
URL : localhost:4000/api/search/sitting
Result example :
{
pets_lists : [ {
"age": 4,
"biography": "Always meow",
"name": "Jaja",
"ownerId": "2n4S7ZsyNKZ2w2f6g0IulGNvOl12",
"pet_mating": true,
"pet_sitting": true,
"picture_url": "",
"type": "Cat"
},
{
"age": 4,
"biography": "how how",
"name": "gege",
"ownerId": "2n4S7ZsyNKZ2w2f6g0IulGNvOl12",
"pet_mating": true,
"pet_sitting": true,
"picture_url": "",
"type": "Cat"
}
}
Search api for Pet Sitting.
Pet Service Search
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" Post 'localhost:4000/api/search/service' \
--data-raw '{
"id" : "50c3lNtAEGJUxIuDvj8b" ,
"category": "Clinic"
}'
URL : localhost:4000/api/search/service
Result example :
{
pets_lists : [ {
"address": "str. Theodor Mihali, nr. 90, Cluj-Napoca",
"category" :"Clinic",
"description" :"The best one in town",
"id": "",
"name": "Dog care ",
"owner_id": "xKp3PFyQKQUy5oJWyZmPlTp5udE3",
"pet_type": "Dog",
"picture_url": ""
},
{
"address": " nr. 90, Cluj-Napocab,str. Theodor Mihali,",
"category" :"Clinic",
"description" :"worlds best",
"id": "",
"name": "animal care ",
"owner_id": "5oJWyZmPlTp5uxKp3PFyQKQUydE3",
"pet_type": "Dog",
"picture_url": ""
}
]
}
Search api for Pet Service.
Chat Api
Errors
200 OK - the request was successful (some API calls may return 201 instead).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
500 Internal Server Error - requested method is not supported for resource.
Chat Api
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" Post 'localhost:4000/api/chat/id' \
--data-raw '{
"id" : "50c3lNtAEGJUxIuDvj8b" ,
"message": "how are you feeling"
}'
URL : localhost:4000/api/search/service
Result example :
{
"message":"delivered Successfully"
}
Api for Chat.
The message are stored in below format.
{
"id":"lNvZu6BuTehjAqpFxWaOsw1t3QG3",
"messages":[{
"msg_id":"atOqypVayWQlXWNEMb2A",
"date_sent": July 24, 2020 at 8:59:33 PM UTC+5:30,
"message" :"yeah",
"sent_by_me" :false
},
{
"msg_id":"esyqNHCqOj4OM9r6q7Fp ",
"date_sent": July 24, 2020 at 8:59:33 PM UTC+5:30,
"message" :"Hi, edward! I need a pet sitter. Are you interested?,
"sent_by_me" :false
}
]
}
Show Chat between two users
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/chat/id/otherid' \
--data-raw '{
"id" : "1GnSb4QyqJaKNDBmKyTKn8JcgD2" ,
"other_id": "lNvZu6BuTehjAqpFxWaOsw1t3QG3"
}'
URL : localhost:4000/api/id/otherid
Result example :
{
{
"id":"lNvZu6BuTehjAqpFxWaOsw1t3QG3",
"messages":[{
"msg_id":"atOqypVayWQlXWNEMb2A",
"date_sent": July 24, 2020 at 8:59:33 PM UTC+5:30,
"message" :"yeah",
"sent_by_me" :false
},
{
"msg_id":"esyqNHCqOj4OM9r6q7Fp ",
"date_sent": July 24, 2020 at 8:59:33 PM UTC+5:30,
"message" :"Hi, edward! I need a pet sitter. Are you interested?,
"sent_by_me" :false
}
]
}
}
Api for Chat.
To get chat history two given users.
Pet Shop
Food items attributes:
id (String) : unique identifier.
brand (String) : Name of the Brand
category (String) : Category of the Food
desc (String) : description of the food
flavor (String) : Type of flavor
foodType (String) : Type of food
ingredients (String) : Ingredients present in the food
lifeStage (String) : lifeStage
moreDesc (String) : More Info about the Product
pet (String) : Type of animal
price (number) : price of the item
productID (String) : productID
productImage (String) : URl of the product
quantity (number) : quantity
service (String) : service
subCategory (String) : subCategory
totalPrice (float number) : totalPrice
weight (float number) : weight
Errors
200 OK - the request was successful (some API calls may return 201 instead).
400 Bad Request - the request could not be understood or was missing required parameters.
401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
403 Forbidden - access denied.
404 Not Found - resource was not found.
500 Internal Server Error - requested method is not supported for resource.
Search
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" POST 'localhost:4000/api/shop/Search' \
--data-raw '{
"search" : "Blue Buffalo"
}'
URL : localhost:4000/api/shop/Search
Result example :
{
"id":"1UbkVtdFvJdrGcJOLIGS",
"brand": "Blue Buffalo",
"category": "food",
"desc": "Inspired by the diet of wolves, true omnivores whose endurance is legendary, BLUE Wilderness is a grain-free, protein-rich food that contains more of the delicious chicken your dog loves. Made with the finest natural and no grains.",
directions "Up to 15 lbs 1/2 to 1-1/4 cups*16 to 25 lbs 1-1/4 to 1-3/4 cups*26 to 40 lbs 1-3/4 to 2-1/4 cups*41 to 60 lbs 2-1/4 to 3-1/4 cups*61 to 80 lbs 3-1/4 to 4 cups*81 to 100 lbs 4 to 4-3/4 cups*Over 100 lbs 4-3/4 cups* + 1/2 cup for each additional 20 lbs"
"flavor": "chicken",
"foodType": "Dry",
"ingredients": "Deboned Chicken, Chicken Meal (source of Glucosamine), Peas, Pea Protein, Tapioca Starch, Menhaden Fish Meal (source of Omega 3 Fatty Acids), Dried Tomato Pomace, Chicken Fat (preserved with Mixed Tocopherols), Flaxseed (source of Omega 6 Fatty Acids), Pea Starch, Natural , Dried Egg Product, Dehydrated Alfalfa Meal, DL-Methionine, Potatoes, Dried Chicory Root, Pea Fiber, Alfalfa Nutrient Concentrate, Calcium Carbonate, Choline Chloride, Salt, Potassium Chloride, Sweet Potatoes, Carrots, preserved with Mixed Tocopherols, Zinc Amino Acid Chelate, Zinc Sulfate, Vegetable Juice for color, Ferrous Sulfate, Vitamin E Supplement, Iron Amino Acid Chelate, Blueberries, Cranberries, Barley Grass, Parsley, Turmeric, DriedKelp, Yucca Schidigera Extract, Niacin (Vitamin B3), Calcium Pantothenate (Vitamin B5), L-Carnitine, Copper Sulfate, L-Ascorbyl-2-Polyphosphate (source of Vitamin C), L-Lysine, Biotin (Vitamin B7), Vitamin A Supplement, Copper Amino Acid Chelate, Manganese Sulfate, Taurine, Manganese Amino Acid Chelate, Thiamine Mononitrate (Vitamin B1), Riboflavin Vitamin B2), Vitamin D3 Supplement,Vitamin B12 Supplement, Pyridoxine Hydrochloride (Vitamin B6), Calcium Iodate, Dried Yeast, Dried Enterococcus faecium fermentation product, Dried Lactobacillus acidophilus fermentation product, Dried Aspergillus niger fermentation extract, Dried Trichoderma longibrachiatum fermentation extract, Dried Bacillus subtilis fermentation extract, Folic Acid (Vitamin B9), Sodium Selenite, Oil of Rosemary.",
lifeStage: "Adult",
"moreDesc": "Key BenefitsDeboned chicken, chicken meal and turkey meal supply the protein your dog needs Sweet potatoes, peas and potatoes provide healthy complex carbohydrates Blueberries, cranberries and carrots support antioxidant-enrichment"
name "Blue Buffalo Wilderness High Protein Grain Free, Natural Adult Dry Cat Food, Chicken",
"pet": "cat"
"price": 53.78,
"productID": "wHtH6NHsdKfrOXBbByjy",
"productImage": "https://firebasestorage.googleapis.com/v0/b/molletapp.appspot.com/o/product_images%2Fcatfood%2Fbuffalocat.jpg?alt=media&token=2fb245af-65ca-47fa-b562-f109ad0d7892",
"quantity": 1,
"service": "food",
"subCategory": "catfood",
"totalPrice": 53.78,
"weight": "24.6kg"
}
Search for Pet Shop.
You can search with respective "Pet", "flavor", "subCategory", "foodType"
Get User Bag
# Here is a curl example
curl --location --request -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer sample_token" GET 'localhost:4000/api/bag' \
--data-raw ''
URL : localhost:4000/api/bag
Result example :
{
"id":"1UbkVtdFvJdrGcJOLIGS",
"brand": "Blue Buffalo",
"category": "food",
"desc": "Inspired by the diet of wolves, true omnivores whose endurance is legendary, BLUE Wilderness is a grain-free, protein-rich food that contains more of the delicious chicken your dog loves. Made with the finest natural and no grains.",
directions "Up to 15 lbs 1/2 to 1-1/4 cups*16 to 25 lbs 1-1/4 to 1-3/4 cups*26 to 40 lbs 1-3/4 to 2-1/4 cups*41 to 60 lbs 2-1/4 to 3-1/4 cups*61 to 80 lbs 3-1/4 to 4 cups*81 to 100 lbs 4 to 4-3/4 cups*Over 100 lbs 4-3/4 cups* + 1/2 cup for each additional 20 lbs"
"flavor": "chicken",
"foodType": "Dry",
"ingredients": "Deboned Chicken, Chicken Meal (source of Glucosamine), Peas, Pea Protein, Tapioca Starch, Menhaden Fish Meal (source of Omega 3 Fatty Acids), Dried Tomato Pomace, Chicken Fat (preserved with Mixed Tocopherols), Flaxseed (source of Omega 6 Fatty Acids), Pea Starch, Natural , Dried Egg Product, Dehydrated Alfalfa Meal, DL-Methionine, Potatoes, Dried Chicory Root, Pea Fiber, Alfalfa Nutrient Concentrate, Calcium Carbonate, Choline Chloride, Salt, Potassium Chloride, Sweet Potatoes, Carrots, preserved with Mixed Tocopherols, Zinc Amino Acid Chelate, Zinc Sulfate, Vegetable Juice for color, Ferrous Sulfate, Vitamin E Supplement, Iron Amino Acid Chelate, Blueberries, Cranberries, Barley Grass, Parsley, Turmeric, DriedKelp, Yucca Schidigera Extract, Niacin (Vitamin B3), Calcium Pantothenate (Vitamin B5), L-Carnitine, Copper Sulfate, L-Ascorbyl-2-Polyphosphate (source of Vitamin C), L-Lysine, Biotin (Vitamin B7), Vitamin A Supplement, Copper Amino Acid Chelate, Manganese Sulfate, Taurine, Manganese Amino Acid Chelate, Thiamine Mononitrate (Vitamin B1), Riboflavin Vitamin B2), Vitamin D3 Supplement,Vitamin B12 Supplement, Pyridoxine Hydrochloride (Vitamin B6), Calcium Iodate, Dried Yeast, Dried Enterococcus faecium fermentation product, Dried Lactobacillus acidophilus fermentation product, Dried Aspergillus niger fermentation extract, Dried Trichoderma longibrachiatum fermentation extract, Dried Bacillus subtilis fermentation extract, Folic Acid (Vitamin B9), Sodium Selenite, Oil of Rosemary.",
lifeStage: "Adult",
"moreDesc": "Key BenefitsDeboned chicken, chicken meal and turkey meal supply the protein your dog needs Sweet potatoes, peas and potatoes provide healthy complex carbohydrates Blueberries, cranberries and carrots support antioxidant-enrichment"
name "Blue Buffalo Wilderness High Protein Grain Free, Natural Adult Dry Cat Food, Chicken",
"pet": "cat"
"price": 53.78,
"productID": "wHtH6NHsdKfrOXBbByjy",
"productImage": "https://firebasestorage.googleapis.com/v0/b/molletapp.appspot.com/o/product_images%2Fcatfood%2Fbuffalocat.jpg?alt=media&token=2fb245af-65ca-47fa-b562-f109ad0d7892",
"quantity": 1,
"service": "food",
"subCategory": "catfood",
"totalPrice": 53.78,
"weight": "24.6kg"
}
To get all Bag items that User added.