Browsed by
Tag: webapi

Get PDF files by Magento Webapi

Get PDF files by Magento Webapi

Magento 2 comes with a modern REST interface. One of the advantages of the REST interface is that it can handle multiple response types. A client can request data from the server with a list of acceptable response formats. Out of the box Magento 2 supports two types. It comes with JSON and XML support. You can test it with a simple call to your local store. curl -X GET –header “Accept: application/json” “http://<store-baseurl>/rest/default/V1/categories” If you omit the accept header…

Read More Read More

Think outside the box: Magento 2 as API framework

Think outside the box: Magento 2 as API framework

In this article, we will cover the web-API and how to use Magento 2 as a standalone API-framework. If the web-API is new to you, I recommend to read the development documentation of it first: Magento 2 API documentation Why should I do this? Short answer: Because you can! Not really, there is no reason why you shouldn’t try it at least and have some fun with it – you might get used to it 😉 With Magento 2, the…

Read More Read More

Use Swagger to generate a full functional Magento API Client

Use Swagger to generate a full functional Magento API Client

Magento 2 comes with a nice swagger schema which describes the Webapi. The Magento guys were very clever to choose swagger. It not only comes with a schema, but moreover it is a complete interactive API client as well. A swagger schema is a JSON document to formalize the REST API. Formalized documents have the big advantage that you can process the data with a machine. One idea I had was to create a PHP API for the Magento 2 API. Fortunately the swagger…

Read More Read More

Array does not exist in webapi

Array does not exist in webapi

The Magento 2 webapi is very useful to publish entities to the world. One big advantages of the new webapi is the automatic generation of a swagger schema for RESTful API. If you prefer SOAP over REST you should also be happy to heat that Magento 2 will automatically generate all the WSDL stuff. Magento 2 analyses all the published classes/methods via PHP reflection. Any generated WSDL file contains a XSD with all the types used in the webservices. In…

Read More Read More