Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 02682da

Browse files
authored
Merge pull request #80 from magento/2.0_kh_final
2.0 kh final
2 parents dcefbfc + 6c29be0 commit 02682da

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

guides/v2.0/rest/bk-rest.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ github_link: rest/bk-rest.md
1111
redirect_from: /guides/v1.0/rest/bk-rest.html
1212
---
1313

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.
1815

1916
For information about creating a dynamic API documentation set on your server with live data, see
2017
[Generate local REST API reference

guides/v2.0/rest/generate-local.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,28 @@ github_link: rest/generate-local.md
1010

1111
---
1212

13-
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.
1414

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:
1622

1723
`http://<magento_host>/rest/default/schema`
1824

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+
<div class="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>
37+
</div>

guides/v2.0/rest/notes.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: default
3+
group: rest
4+
subgroup: A_rest
5+
title: Notes
6+
menu_title: Notes
7+
menu_order: 6
8+
version: 2.0
9+
github_link: rest/notes.md
10+
11+
---
12+
13+
## Parameters in URLs
14+
15+
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

Comments
 (0)