forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor Sylius#11471 [Docs] Create an unified section about all Syli…
…us APIs (pamil) This PR was merged into the 1.8-dev branch. Discussion ---------- <img width="189" alt="CleanShot 2020-05-14 at 11 45 51@2x" src="https://user-images.githubusercontent.com/1897953/81919730-81b7c380-95d8-11ea-92cd-196fa3813f72.png"> Commits ------- d674e98 [Docs] Create an unified section about all Sylius APIs
- Loading branch information
Showing
6 changed files
with
88 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Authorization | ||
============= | ||
|
||
In the new API all admin routes are protected by JWT authentication. If you would like to test these endpoints | ||
`in our Swagger UI docs <http://master.demo.sylius.com/new-api/docs>`_, you need to retrieve a JWT token first. | ||
You could do that by using an endpoint with default credentials for API administrators: | ||
|
||
.. image:: ../../_images/sylius_api/api_platform_authentication_endpoint.png | ||
:align: center | ||
:scale: 50% | ||
|
||
| | ||
In the response, you will get a token that has to be passed in each request header. In the Swagger UI, you can set | ||
the authentication token for each request. | ||
|
||
.. image:: ../../_images/sylius_api/api_platform_authentication_response.png | ||
:align: center | ||
:scale: 50% | ||
|
||
| | ||
Notice the **Authorize** button and unlocked padlock near the available URLs: | ||
|
||
.. image:: ../../_images/sylius_api/api_platform_not_authorized.png | ||
:align: center | ||
:scale: 50% | ||
|
||
| | ||
Click the **Authorize** button and put the authentication token (remember about the ``Bearer`` prefix): | ||
|
||
.. image:: ../../_images/sylius_api/api_platform_authorization.png | ||
:align: center | ||
:scale: 50% | ||
|
||
| | ||
After clicking **Authorize**, you should see locked padlock near URLs and the proper header should be added to each API call: | ||
|
||
.. image:: ../../_images/sylius_api/api_platform_authorized.png | ||
:align: center | ||
:scale: 50% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
The REST API Reference | ||
====================== | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
introduction | ||
authorization | ||
|
||
.. include:: /api/unified_api/map.rst.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Introduction | ||
============ | ||
|
||
.. warning:: | ||
|
||
The new, unified Sylius API is still under development. | ||
|
||
We have decided that we should rebuild our API and use API Platform to build a truly mature, multi-purpose API | ||
which can define a new standard for headless e-commerce backends. | ||
|
||
We will be supporting API Platform out-of-the-box. Secondly, it means that both APIs (Admin API and Shop API) will | ||
be deprecated. We are not dropping them right now, but they will not receive further development. In the later phase, | ||
we should provide an upgrade path for currently working apps. Last, but not least, you can already track our progress. | ||
All the PR’s will be aggregated `in this issue <https://github.com/Sylius/Sylius/issues/11250>`_ and the documentation | ||
can be already found `here <http://master.demo.sylius.com/new-api/docs>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* :doc:`/api/unified_api/introduction` | ||
* :doc:`/api/unified_api/authorization` |