You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: guides/v2.0/rest/bk-rest.md
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,7 @@ github_link: rest/bk-rest.md
11
11
redirect_from: /guides/v1.0/rest/bk-rest.html
12
12
---
13
13
14
-
The [REST API documentation](http://devdocs.magento.com/swagger/index.html) published here on the Magento 2 Developer Documentation website describes the REST APIs that are available on Magento 2.0 Community Edition. (Currently, there are no APIs specific to Enterprise Edition.) This documentation is generated from the code base using [Swagger](http://swagger.io) and represents the state of the code at the time the documentation was generated. However, the REST API documentation is static in that the Magento Developers website is not running an instance of Magento.
15
-
16
-
17
-
The [REST API documentation](http://devdocs.magento.com/swagger/index.html) describes the REST APIs that are available on Magento 2.0 Community Edition. It is generated from the code base and represents the state of the code at the time the documentation was generated.
14
+
The [REST API documentation](http://devdocs.magento.com/swagger/index.html) published here on the Magento 2 Developer Documentation website describes the REST APIs that are available on the latest release of Magento 2 Community Edition. This documentation is generated from the code base using [Swagger](http://swagger.io) and represents the state of the code at the time the documentation was generated. However, the REST API documentation is static in that the Magento Developers website (devdocs.magento.com) is not running an instance of Magento.
18
15
19
16
For information about creating a dynamic API documentation set on your server with live data, see
The REST documentation is generated with [Swagger UI](http://swagger.io) using a schema derived from the latest build of Magento 2.0 Community Edition. However, the REST API documentation is static in that the Magento Developers website is not running an instance of Magento.
13
+
The REST documentation is generated with [Swagger UI](http://swagger.io) using a schema derived from the latest build of Magento 2 Community Edition. However, the REST API documentation is static in that the Magento Developers website is not running an instance of Magento.
14
14
15
-
If you install Swagger UI on your server, then you can generate live REST API documentation. Use the following link to generate a JSON schema that includes third-party modules and extension attributes that have been installed on your system.
15
+
The REST documentation on the Magento devdocs website is generated with Swagger UI using a schema derived from the latest build of Magento 2 Community Edition. However, the REST API documentation on devdocs is static in that the Magento Developers website is not running an instance of Magento and there is no live data.
16
+
17
+
The Swagger UI is installed automatically on your server. As a result, you can generate live REST API documentation that can include third-party modules and extension attributes that have been installed on your system. To view this documentation, go to:
18
+
19
+
`http://<magento_host>/swagger`
20
+
21
+
You can also use the following link to generate a JSON schema:
16
22
17
23
`http://<magento_host>/rest/default/schema`
18
24
19
-
Then save the schema file and load it into your Swagger UI instance.
25
+
To access REST API documentation, Magento requires the user to be authenticated and authorized, as follows:
26
+
27
+
* By default, Magento returns documentation for resources available to anonymous users.
28
+
* If a customer or admin session is active, Magento returns documentation as permitted by the user's role.
29
+
* To retrieve information for a particular user, you must specify a token in the Authorization request header with the Bearer HTTP authorization scheme.
30
+
31
+
The generated Swagger documentation provides the capability to test REST API requests. A user can enter a sample request, then press the **Try it out!** button, and Swagger returns information such as a `curl` command, a request URL, a response body, a response code, and the response header. Using the **Try it out!** button also requires a bearer authorization token.
32
+
33
+
The **Try it out!** feature is not available on Swagger documentation published on the Magento devdocs website.
34
+
35
+
<divclass="bs-callout bs-callout-info"id="info">
36
+
<p>The <b>Try it out!</b> feature is not available on Swagger documentation published on the Magento devdocs website.</p>
In a REST call, a user could potentially specify one ID in the URL and another in the request body. Whenever this type of conflict occurs, Magento uses the value specified in the URL.
16
+
17
+
For example:
18
+
19
+
The REST URL to update a customer is `<route url="/V1/customers/:id" method="PUT">`. If you specify a ID value of `1` in the URL (`http://magento.loc/customer/1`), and a body of `{ “id”: 2, “attr”: “value” }`, the customer with ID of `1` will be modified.
20
+
21
+
This applies to all REST APIs where a parameter is passed in the URL. Anything specified in the request body with the same parameter name as the URL will be ignored.
22
+
23
+
## Related topics
24
+
[Search using REST APIs]({{ site.gdeurl }}howdoi/webapi/search-criteria.html)
0 commit comments