A
A
Anton Perevoshchikov2017-04-04 07:29:56
PHP
Anton Perevoshchikov, 2017-04-04 07:29:56

How to make a public API based on a private one?

The server has an API implemented according to the classical scheme: /users/ID. Those. there is a certain private API in which a lot of things are implemented, on its basis I would like to make a public API with limited capabilities.
How to get the data of this user from a third-party application in which the user is logged in? Make requests of the form /users/IDand /users/ID/paymentsor, /profilein /profile/paymentsfact, just proxying them to the main API?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Konyukhov, 2017-04-04
@Fett

Just write a proxy-layer in which everything that is needed is added (authorization, etc.) and everything that is not needed is removed (some internal things are filtered out in the output).
Such an api-proxy is written very easily and quickly in any language and does not even require any frameworks. The last such implementation took me about 900 lines in 4 files.

M
mamayama, 2017-04-04
@mamayama

You yourself answered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question