Skip to content

REST API Documentation

Nithin_Kamineni edited this page Apr 20, 2022 · 1 revision

User Signup and User Login

Description: Signup and Login for user to our application

Endpoint: < app >/user

HTTP Method: POST

OAuth: Not Required

Body: {firstname: < FN >, lastname:< LN >, email: < email >, password:< sha256 >}

Reply of Body: { "Msg": "Login and sign-up Sucessfull", "UserDetails": { "id": "f115235b-0c90-451b-abbd-1775586b4a37", "firstname": "ab", "lastname": "b", "email": "nithin1@gmqail.com", "password": "825167b64b7af554b0b380217f32513f452c0045177c47a6352e0f2c1921223c", "Acesskey": "", "RefreshKey": "", "Address1": "", "Address2": "", "Address3": "" }, "AllowUsers": true }

User Login

Description: Login for user to our application

Endpoint: < app >/user?username=< name or email >&passkey=

HTTP Method: GET

OAuth: Required

Reply of Body: { "Msg": "User does not exist/registered", "UserDetails": { "id": "", "firstname": "", "lastname": "", "email": "", "password": "", "Acesskey": "", "RefreshKey": "", "Address1": "", "Address2": "", "Address3": "" }, "AllowUsers": false }

Offers near

Description: returns offers near users vicinity

Endpoint: < app >/offers

HTTP Method: GET

OAuth: Required

Reply of Body: { { “name”: “name”, “description”: “info” }, { “name”: “name”, “description”: “info” }, . . }

Editing User Details

Description: Editing user first name, last name, email in user account

Endpoint: < app >/user/edit

HTTP Method: POST

OAuth: Not Required

Body: {firstname: < FN >, lastname:< LN >, email: < email >, password:< sha256 >}

Reply of Body: { "Msg": "Login and sign-up Sucessfull", "UserDetails": { "id": "f115235b-0c90-451b-abbd-1775586b4a37", "firstname": "ab", "lastname": "b", "email": "nithin1@gmqail.com", "password": "erfe", "Acesskey": "", "RefreshKey": "", "Address1": "", "Address2": "", "Address3": "" }, "AllowUsers": true }

Adding/Editing User Address

Description: Editing user first name, last name, email in user account

Endpoint: < app >/user/address

HTTP Method: POST

OAuth: Required

Body: {AcessKey: < Access-key >, UserID: < userid >, RefreshKey:< refresh_key >, Address:< address >}

Reply of Body: { "Msg": "Successfully changed your delivery address", }

Sending User Orders

Description: Sending user orders history in user account

Endpoint: < app >/user/orders

HTTP Method: POST

OAuth: Required

Body: {AcessKey: < Access-key >, UserID: < userid >}

Reply of Body: { "Msg": "Successfully changed your delivery address", }

Contact

Description: Sending message in contact us information

Endpoint: < app >/contact

HTTP Method: POST

OAuth: NOT Required

Body: {Name: < name >, Email: < email >, Msg:< msg >}

Reply of Body: { "Msg": "Message received" }

Adding items in cart

Description: Adding items in cart based on user

Endpoint: < app >/cart/additem

HTTP Method: POST

OAuth: Required

Body: {"user_id":"4d8bee47-1de3-447d-aa07-b89edb94684d","productID":"b", "quantity":"1","created":"04-09-2022", "modified":"04-09-2022"}

Reply of Body: { "Msg": "Message received" }

Deleting items in cart

Description: Deleting specific elements in cart for a user Endpoint: < app >/cart/

HTTP Method: PUT

OAuth: Required

Body: {"user_id":"4d8bee47-1de3-447d-aa07-b89edb94684d","productID":"b"}

Reply of Body: { "Msg": "Message received" }

Changing elements in cart

Description: Manipulating the information of elements in cart for user

Endpoint: < app >/cart

HTTP Method: PATCH

OAuth: Required

Body: {"user_id":"4d8bee47-1de3-447d-aa07-b89edb94684d","productID":"b","quantity":"1"}

Reply of Body: { "Msg": "Message received" }

Clear cart

Description: clearing all elements in the cart for a user

Endpoint: < app >/cart/clear-cart

HTTP Method: POST

OAuth: Required

Body: {"user_id":"4d8bee47-1de3-447d-aa07-b89edb94684d"}

Reply of Body: { "Msg": "Message received" }

Adding items in Store

Description: Adding items in inventory based on store

Endpoint: < app >/store/additem

HTTP Method: POST

OAuth: Required

Body: {"store_id":"4d8bee47-1de3-447d-aa07-b89edb94684d","productID":"b", "quantity":"1","created":"04-09-2022", "modified":"04-09-2022"}

Reply of Body: { "Msg": "Message received" }

Deleting items in store

Description: Deleting specific elements in inventory for a store Endpoint: < app >/store/

HTTP Method: PUT

OAuth: Required

Body: {"store_id":"4d8bee47-1de3-447d-aa07-b89edb94684d","productID":"b"}

Reply of Body: { "Msg": "Message received" }

Changing elements in store

Description: Manipulating the information of elements in inventory for store

Endpoint: < app >/store

HTTP Method: PATCH

OAuth: Required

Body: {"store_id":"4d8bee47-1de3-447d-aa07-b89edb94684d","productID":"b","quantity":"1"}

Reply of Body: { "Msg": "Message received" }

Clear store

Description: clearing all elements in the store

Endpoint: < app >/store/clear

HTTP Method: POST

OAuth: Required

Body: {"store_id":"4d8bee47-1de3-447d-aa07-b89edb94684d"}

Reply of Body: { "Msg": "Message received" }