A
A
Andrew2014-10-15 07:36:12
PHP
Andrew, 2014-10-15 07:36:12

What knowledge/skills do you need to write your own API?

What do I need to know/be able to write the back end of the API?
I saw some articles on Habré, I understood from them that I need to know OOP, some also write that their API is written using Symfony, but not everyone talks about this ... In general, after reading, I have a mess in my head , and did not understand what exactly I need to know, I ask for help from the pros.
PS First of all, it is necessary to connect the android application with the server part.
PPS I really like the implementation in vk.com, everything is clear and in its place

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2014-10-15
@ntzch

1) The question of whether to use OOP at all or not is very conditional.
Without OOP, any modern framework does not work.
Since you still need to use MVC - accordingly, you will have an automatic oop)
2) As for Symfony - it doesn't matter what framework you write your code on.
Symfony seems to me more difficult for a beginner, try Yii2 or Laravel.
Again, I repeat, this is not important. You can take any microframework - it will be even more useful from the point of view of the development of a novice developer.
3) The API is essentially a regular set of scripts, which differs from ordinary pages in that in web pages you give html - and in the API you give JSON / XML / something_else (I personally advise using JSON for a number of reasons, but the question as a whole is holistic )
REST API (again, the de facto mass standard) is an agreement on some basic principles, in fact, on the formats of the request, response, and the absence of states (stateless)
Returning to point 2 - many frameworks provide automation in building the rest api, for example, here is a fresh article with examples on Yii2 habrahabr.ru/post/240149
If you have some kind of narrow application functionality, you can not bother with the implementation of all methods, but implement only the ones you need.
In cases of complex large screens in an application, it may be more profitable to make a special method for some screen that implements everything in one piece (however, this is usually done already at the refactoring stage)
4) In any case, start by writing documentation for yourself:
What entities do you have (resources in rest terminology), describe them.
What actions the client can perform on them.
Under what conditions the client can request filtering of which entities.
Do you need to convey entities not entirely (also a holistic question),
etc.
I apologize if it turned out chaotically, I wrote at the same time as morning coffee :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question