BizHub V1 Api

Backend API for the BizHub Guyana application to manage businesses and services those businesses are providing. Which also includes reviews, inquiry, users, authentication, authorisation, payments, ads management and much more

Admin 1

Admin required apis for BizHub admin

Description

Get BizHub admin dashboard stats

Appointments 7

Appointments created by user to services.

Description

Add Appointment for a user of a service.

Appointment Status - Predefined: [‘rejected’, ‘approved’, ‘reschedule’, ‘completed’, ‘pending’]

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "Greg appointment for coffee makers by John", "description": "i need multiple coffee makers in my office", "budget": 0, "appointment": "2021-05-31T21:22:57.790Z", "appointmentStatus": "pending", "service": "5d725a4a7b292f5f8ceff789", "user": "5c8a1d5b0190b214360dc033", "phone": "321321321", "email": "greg@email.com", "address": "this is some address", "updateUser": false }
Description

Delete user created appointment. Can only be deleted by user and admin

Description

Get all appointments from database in paginated form

Description

Update Appointment. Can only be updated by user and admin

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "description": "test UPDATE description for an appointment", "budget": 1000, "appointment": "2021-06-02T21:22:57.790Z", "appointmentStatus": "approved" }

Authentication 11

Routes for user authentication including register, login, reset password, etc

Description

Check if email already registered.

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "email" : "sasha@gmail.com", "password" : "123456789" }
Description

Check if username is used by any other user

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "email" : "sasha@gmail.com", "password" : "123456789" }
Description

Generate password token and send email

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "email" : "john@gmail.com" }
Headers
Key Value Description
Content-Type application/json

JSON type

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
email greg@gmail.com
password 123456789
Description

Add user to database with encypted password

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "firstName" : "Arslan", "lastName" : "Test 01", "username" : "arslan123", "email" : "ars@email.com", "password" : "123456789", "location" : "LA" }
Description

Reset user password using token

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "password": "321321" }
Description

Update logged in user password, send in the body currentPassword & newPassword

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "currentPassword": "321321", "newPassword": "123456" }
Description

Update logged in user basic info

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "firstName": "Haris", "lastName": "Greg Bhaya", "username": "harris_greg123", "location": "East-coast" }
Description

Upload user profile. Only auth token required.

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file

Business 7

Business CRUD functionality

Description

Adding new business to database. Must be authenticated and must be a registered user

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "name": "TEST BUSINESS", "description": "ModernTech has one goal, and that is to make you a rockstar developer and/or designer with a six figure salary. We teach both development and UI/UX", "website": "https://moderntech.com", "phone": "(222) 222-2222", "email": "enrollTEST@moderntech.com", "address": "220 Pawtucket St, Lowell, MA 01854", "careers": ["business"] }
Description

Fetch all Businessess from database. Includes pagination, filtering, etc

Description

Get business with a radius of specific zip code

Description

Update single business in database

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "description": "Updated Description", "location":{ "formattedAddress": "100 Young and Duke Streets, Kingston Georgetown, 0592 GY" }, }
Description

Route to business photo upload

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file

Business Reviews 6

Manage Business reviews

Description

Insert review for a specific buisness

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "nice services", "text": "many happy", "rating": 8 }
Description

Get all reviews of business from database and populate with business name and description

Description

Update review in database

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "it was a fun" }

Categories 8

Categories of services BizHub supports

Description

Create category and only admin can create one

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "name": "Health & Medical", "description": "Health & Medical category", "isMain": false, "iconName": "fa-star", "unicode":"f02d" }
Description

Delete category by id and only Admin can delete

Headers
Key Value Description
Content-Type application/json

JSON type

Description

Update category by id and only Admin can update

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "description": "General category to cover all common services types" }
Headers
Key Value Description
Content-Type application/json

JSON type

Description

Upload category icon by id and only Admin can upload

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file
Description

Upload category icon by id and only Admin can upload

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file

Email 4

Send Contact Or Enquiry Mail to BizHub original gmail account

Description

Enquiry mail from user to current service

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "to": "bizhub.guyana@gmail.com", "from": "arslan@synares.com", "message": "This is a test apoointment email", "username": "johndoe", "service": "Guyana Tea & Company" }
Description

Send email from contact us form. This will use registered email on AWS contact@toolboxguyana.com to send message.

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "email" : "john@gmail.com", "message" : "I need to test this" }
Description

Enquiry mail from user to current service

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "to": "bizhub.guyana@gmail.com", "from": "currentuser@email.com", "message": "This is a test enquiry mail" }
Description

Inquiry mail from user to Bizhub team

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "firstName": "Arslan", "lastName": "company", "email": "arslan@synares.com", "phone": "0334007083", "businessName": "Friends", "state": "Demerara-Mahaica", "inquiryType": "Standard", "description": "sadfsadfsadfsdf" }

Extras 1

Query
Key Value Description
key kodBSZTg56UcWWgrX9bF12HUJdypkN4V
location Model Town, Lahore, Punjab

History 4

Manage user history which includes all time service visits and recent visits to service detail page

Description

Add service to history. It will update history if already added today

Body
Key Value Description
service 5d725cfec4ded7bcb480eaa6
Description

Get History of current logged in user for today.

Notifications 2

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "service": "5d725a4a7b292f5f8ceff789" }
Description

Get logged in user notification for landing page to get notified for any update on profile or business dashboard

Headers
Key Value Description
Content-Type application/json

JSON type

Our Reviews 5

Manage BizHub review from registered users.

Description

Insert review for a specific buisness

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "nice services", "text": "many happy", "rating": 8 }
Description

Get all reviews of business from database and populate with business name and description

Description

Update review in database

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "it was a fun" }

Payments 4

Payment APIs for package upgrade or Ads publishing

Description

All Payments done to Bizhub

Body
Description

Stripe payment for ad posting by users

Body
{ "amount": "3000", "stripeToken": "tok_1JEgvvH7DiuluHLRR4Y4LRY2", "description": "John paid for Ad <User Ad Id>", "userAd": "60e83b9570b74400154a5a52", "user": "5c8a1d5b0190b214360dc033", "name": "Greg", "email": "useremail@email.com", "phone": "123123123" }
Description

Stripe payment for businesses to upgrade there package

Body
{ "amount": "2150", "stripeToken": "tok_1JEg4fH7DiuluHLRV3PWSQs8", "description": "Guyana Meets Package Upgrade to Premium", "business": "60e83b9570b74400154a5a52", "user": "5c8a1d5b0190b214360dc033", "name": "Greg", "businessName": "Sample Buisness", "package": "Premium", "email": "useremail@email.com", "phone": "123123123" }

Report Service 5

Manage user history which includes all time service visits and recent visits to service detail page

Description

Clear service flag so it is visible until next report

Body
Key Value Description
type spam

REQUIRED | hardcoded types from front end

description fake content copied from someone else

REQUIRED | description

service 5d725cfec4ded7bcb480eaa6

REQURIED | reported serivice Id

Description

Remove a single report of a service

Body
Description

Get all reported services

Query
Key Value Description
limit 10
Description

Remove all reports of a service and clear flags.

Body
Description

Report service by passing service id and detail

Body
Key Value Description
type spam

REQUIRED | hardcoded types from front end

description fake content copied from someone else

REQUIRED | description

service 5d725cfec4ded7bcb480eaa6

REQURIED | reported serivice Id

Saved 2

User saved services

Description

Get all saved services or business by users

Query
Key Value Description
user 5d725a4a7b292f5f8ceff789
service 5d725a4a7b292f5f8ceff789
Description

Save or unsave service

Body
Key Value Description
service 5d725a4a7b292f5f8ceff789

Service Reviews 7

User posted reviews and rating for services provided by businesses

Description

Add review for a service by logged in user

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "nice service", "text": "many happy", "rating": 8 }
Description

Delete user posted review. Can onlye be deleted by posted user and admin

Description

Get all reviews of services from database and populate with service name and description

Description

Get all reviews for servcies by passing service id as parameter

Description

Update service review. Can only be updated by posted user and admin

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "it was a fun" }
Description

Route to service photo upload

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file

Services 14

Create, Read, update, delete Business Services

Description

Create service for specific business

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title": "health Care Hospital", "description": "Health care hospital with all neccessary equipments and rooms", "openingDate": "12/27/2019", "serviceCost": 12000, "category": "600dc62bd5198136d89d6f20", "keywords": [ "health", "medical", "first-aid" ], "minimumSkill": "intermediate", "atHomeService": false, "business": "5d725a1b7b292f5f8ceff789", "user": "", "address": "220 Pawtucket St, Lowell, MA 01854", "views": 10, "healthScore": "A", "happyHour": true, "takeReservation": true, "offersTakeout": true, "email": "serviceemail@email.com", "phone": "321321321", "officePhone": "321321321", "region": "Barima Waini", "openingHours": { "mon": { "openTime": "09:00am", "closeTime": "09:00pm" }, "tue": { "openTime": "09:00am", "closeTime": "09:00pm" }, "wed": { "openTime": "09:00am", "closeTime": "09:00pm" }, "thu": { "openTime": "09:00am", "closeTime": "09:00pm" }, "fri": { "openTime": "09:00am", "closeTime": "09:00pm" }, "sat": { "openTime": "09:00am", "closeTime": "09:00pm", "isClose": true }, "sun": { "openTime": "09:00am", "closeTime": "09:00pm", "isClose": true } }, "coordinates": [ -122.136487, 37.480994 ] }
Description

Route to remove single service photo form list of photos - /{serviceId}/photo/{photoId}

Headers
Key Value Description
Content-Type application/json

JSON type

Description

Get business with a radius of specific zip code

Body
Description

Search services on text base. return services when entered textquery exists in with title, description or keywords. It may return data if entered query found in any string type property

Query
Key Value Description
query cof
Description

Search services on text base. return services when entered textquery exists in with title, description or keywords. It may return data if entered query found in any string type property

Query
Key Value Description
query guy
Description

Route to service photo upload

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
caption This is 4 updated caption
Description

Update service views by increasing 1 per click

Headers
Key Value Description
Content-Type application/json

JSON type

Description

Update service in database

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "serviceCost" : 13000, "minimumSkill" : "advanced", "location":{ "formattedAddress": "100 Young and Duke Streets, Kingston Georgetown, 0592 GY" }, "isActive": false }
Description

Route to service photo upload

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file
caption quote2

User Ads 6

Ads management, posted for a specific slot for a specific page

Description

Creating an Ad

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title" :"head and shoulder ad 2", "description": "head and shoulder ad for one week", "link": "https://www.arslanameer.com", "email": "email@arslanameer.com", "duration": "weekly", "location": "middle" }
Description

Delete existing ad by Id

Headers
Key Value Description
Content-Type application/json

JSON type

Description

Get all user posted ads

Headers
Key Value Description
Content-Type application/json

JSON type

Description

Get single ad by Id

Headers
Key Value Description
Content-Type application/json

JSON type

Description

Update exsisting add by ID

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "title" :"head and shoulder ad update", "description": "head and shoulder ad for one week only udpate", "link": "www.arslanameer.com" }
Description

Upload Ad image on S3 and update url in exisiting ad

Headers
Key Value Description
Content-Type application/json

JSON type

Body
Key Value Description
file

Users (Admin) 5

CRUD functionality for users only available to Admins

Description

Add user to database (admin)

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "firstName" : "Arslan Admin", "lastName" : "Test Admin", "username" : "arslan123Admin", "email" : "ars2712@email.com", "password" : "12345678", "location" : "LA" }
Description

Get all users (admin)

Description

Update user in database (admin)

Headers
Key Value Description
Content-Type application/json

JSON type

Body
{ "firstName" : "Arslan Admin 2", "lastName" : "Test Admin 2", "username" : "arslan123Admin2222" }