N
N
nepster-web2015-12-29 13:46:33
PHP
nepster-web, 2015-12-29 13:46:33

When should you implement a REST API?

I'm working on a project and began to notice such things in the functionality that can be moved to a separate rest api. I have not worked with this case before, so I have questions.
For example, a user visits a site and creates a product (I do not reveal all the secrets of the project), there is a form where he fills in certain information, checks the name of the product (it must be unique), selects his city, etc.
And in fact, I began to notice that you need to create methods like:
- Return all cities by LIKE
- Check if the name of the group is free
, etc. There are quite a few of these.
At the beginning, I thought to shove everything beautifully into modules, but in the future there is a task to organize applications for ios and android (I have no idea how they are developed), but I heard something somewhere about a separate REST API.
I also read about the trello service, where they wrote about what they did api, where the trello site is just an interface, that is, you can implement your own interface without any problems. I would be glad if someone comments on this approach.
In general, the question is, is it worth organizing rest api in my case?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yuri Shikanov, 2015-12-29
@nepster-web

Worth doing, then you can easily make several clients (android, ios, web, etc) and you don’t need to make any special changes to the backend.

X
xmoonlight, 2015-12-29
@xmoonlight

YES.

E
eeiaao, 2017-05-25
@eeiaao

We need to change the concept. In the list elements, you should add the data-id and data-parent attributes (put the parent's id here), and remove the data-depth. The resulting "flat" json can then be parsed and scatter objects in accordance with the given hierarchy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question