适用于Android应用程序的Magento REST API

时间:2015-12-01 09:46:20

标签: api rest magento

如何访问magento REST API?我尝试了很多方法,但我无法得到正确的解决方案。我可以通过www.magentohost.com/api/v2_soap/?wsdl访问SOAP API,响应是

<definitions xmlns:typens="urn:Magento"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="urn:Magento">
<types>...</types>
<message name="endSession">...</message>
<message name="endSessionResponse">...</message>
<message name="login">...</message>
<message name="loginResponse">...</message>
<message name="resourcesRequest">...</message>
<message name="resourcesResponse">...</message>
<message name="globalFaults"> 
 etc..........

但我无法通过www.magentohost.com/api/rest访问REST API,也有很多方法。如何在magento中使用REST API?

1 个答案:

答案 0 :(得分:1)

如果您需要从magento获得剩余的api,请先从Magento获取Oauth Tokens。你可以得到这个在获得未授权的请求令牌后,用户授权最终你可以得到Oauth令牌。

编辑magento中的php / api.php文件以链接产品和客户详细信息,然后只从Magento获取REST API