M
M
Maxim Golerov2015-07-11 09:50:25
RESTful API
Maxim Golerov, 2015-07-11 09:50:25

Rest API for your site, where to start?

In a week, work on a simple version of the site will end and we would like to make a mobile application, almost all information is stored in the Mysql database, and we perfectly understand that it is impossible to create applications with direct access to the database and we need to create a Rest API, but where to start?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DevMan, 2015-07-11
@Jyny

from any microframework.

A
aleksey_k, 2015-07-11
@aleksey_k

1. First, determine what data a person / script will access through your REST API
2. After you clearly understand what exactly you will give to users, you start thinking about access to the API, whether it will be publicly available for you (then think about limiting the number of requests from one IP/session), will it be available to you by tokens (I'm talking about Oauth), or by a login-password pair, as an extreme case. Implement access.
3. Then everything depends on how your site is already written. If you use the MVC framework for it, you can select a separate controller, which you will call, for example, ApiController, it will have, say, get-friends, get-likes, get-latest-posts methods that will give the necessary data in JSON
3.1. The second option is possible, you start a subdomain api.yoursite.com, start another virtual host (or really another one) under it, and develop api as a separate project.

D
Dmitry Entelis, 2015-07-11
@DmitriyEntelis

Start with app design.
By design, it becomes clear what API methods are needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question