Answer the question
In order to leave comments, you need to log in
Exchange standards over REST?
Good!
It is necessary to write an API (JSON) for saving data (POST) in PHP (Slim / Phalcon), of course it is necessary for those who will post the data to make the use of the API as clear as possible - the way it usually happens with other services.
Are there well-defined standards and guidelines for RESTful data exchange?
For example, the names of fields, methods, the format for passing certain values, authentication methods, versioning, and so on?
Something like YML (Yandex Market Language).
If so, what can you read? Perhaps there are services that can help with this?
Thanks to!
Answer the question
In order to leave comments, you need to log in
the sphere is still young and everyone writes as he or she prefers, although the industry is trying to implement various standards (so far at the level of recommendations)
json-schema.org - for example
, such standards are usually adopted within an industry in order to have the same interfaces inside different products. Here is an example fhir standard - in medicine.
------
there are general recommendations about the formation of the API based on common sense, when, for example, the response is wrapped in an object that still has fields, for example, with pagination, links to a step back, and a step forward, perhaps some kind of message for user, or there, for example, indicating how many objects in total that we bypass, and so on.
For authentication, there is, for example, a recommendation not to transfer the key in the browser line, but to transfer it in the request header, because otherwise it will be saved in the browser history, and when you go to another site, it can also be highlighted in the transition source.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question