Sie sind auf Seite 1von 9

Retrofit

What is Retrofit?

Retrofit is a REST Client for Android and Java by Square. It makes it relatively easy to
retrieve and upload JSON (or other structured data) via a REST based webservice.
Using Retrofit:

To work with Retrofit you need basically two classes.

 Interfaces which defines the possible HTTP operations


 Retrofit.Builder class - Instance which uses the interface and the Builder API which
allows defining the URL end point for the HTTP operation.

Our Application uses 21 APIs to fetch and send data to our backend server using Retrofit. The names of
those APIs are as follow:

1. All items :-
This is a GET API is used to fetch all the food items data from database.

2. Recommended Products:-
This is a GET API is used to fetch Food Items that are recommended by the restaurant.
3. Category:-
This is a GET API that fetch food items category list.

4. Resturant Details:-
This is a GET API that fetches Resturant details like Address, Phone No, Tax charges and much
more.

\
5. Faq:-
This is a GET API that fetches frequently asked questions data from database.

6. Terms & Conditions:-


This is a GET API that fetches any restaurant T&C data.

7. Firebase Access Token:-


This is a POST API that send clients access token to backend to register him on firebase as a valid
user.

8. Add Whislist:-
This is a POST API that send clients favorite items data to server to store it. It takes product ID
and user ID as parameters.

9. Add Cart:-
This is a POST API that sends clients item data that he wants to add in his/her cart.
10. Delete Cart:-
This is a POST API that updates clients’ cart data when he/she delete one or multiple items.

11. WishList Check:-


This is a POST API that checks if an item is marked as favorite by user or not.

12. WishList:-
This is a POST API that returns items data that are marked as favorite by the user.

13. View Orders:-


This is a POST API that returns a client’s past and current orders data.

14. View Cart:-


This is a POST API that returns a client’s cart i.e all the items a client has ih his/her cart.

15. User Profile:-


This is a POST API that fetches User’s Profile data.
16. Update Profile:-
This is a POST API that takes any changes made to profile by user and updates them in the
database.

17. Resend verification E-mail:-


This is a POST API that is used to resend a user e-mail verification e-mail.

18. Login:-
This is a POST API that takes user email and password to login into the app.

19. Add Orders:-


This is a POST API that takes user’s food orders.
20. Password Reset:-
This is a POST API that takes user email to send him a password reset email.

21. User Register:-


This is a POST API that is used to register a new user for the app.

API working on the Server-side

//TODO ADD IMAGE OF APP WITH ADD TO CART BUTTON.

When on the product page and user click “ADD TO CART” button /JSON/add-cart.php is called, Flow
Chart ( Fig no) show the working of this API in brief.
//TODO ADD IMAGE OF APP WITH “ PROCEED TO payment” BUTTON

When “Procced To Payment” button is clicked /JSON/addorders.php API is called, Flow Chart (Fig no)
show working of this API on Server-side.

Das könnte Ihnen auch gefallen