I am developing a REST API as a backend application for an Android application to run. Currently, the startup has a web version of their service with users of about 10 thousand users. I have a few doubts regarding web API design:
I want only the Android client to access the API and no one else. One way is to send the encrypted token from the front-end and decrypt it on the internal server. Is there any other way? Also, how do I implement it?
- How to make my API fast and efficient?
There is a special endpoint that is accessed very often. However, information about this endpoint does not change. Therefore, requests that are executed for a short period of time are likely to return the same response. How to respond faster to such requests? Would perform ETagand Last-Modified?
- Should I trust my client data?
Currently, when I receive a request with some parameter, the only check I perform in the request is to check if the parameter is nullor not. E.g. If the request has mobileas a parameter, I only check if the parameter is present mobilein the request. I do not perform other checks, such as checking if length is mobileless than 10, and then throwing an exception.
EDIT:
, , " ", , , .