适用于 Android 应用程序的 Magento REST API [英] Magento REST API for Android Application
问题描述
如何访问 magento REST API?我尝试了很多方法,但无法得到正确的解决方案.我可以通过 www.magentohost.com/api/v2_soap/?wsdl 访问 SOAP API 并且响应是
How to access magento REST API? I tried lot of ways but I cannot get correct solution. I can access SOAP API via www.magentohost.com/api/v2_soap/?wsdl and the response is
<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?
but I cannot access REST API through www.magentohost.com/api/rest and also many ways. How to REST API in magento?
推荐答案
如果您需要从 magento 获取其余 api,请先从 Magento 获取 Oauth 令牌.拿到Unauthorized Request Token后就可以拿到这个了,User Authorization最后就可以拿到Oauth Tokens了.
If you need to get the rest api from magento first get the Oauth Tokens from the Magento. You can get this After get the Unauthorized Request Token,User Authorization finally you can get the Oauth Tokens.
编辑 magento 中的 php/api.php 文件以链接产品和客户详细信息,然后您才能从 Magento 获得 REST API
Edit the php/api.php file inside the magento to link the products and customer details then only you get the REST API from Magento
这篇关于适用于 Android 应用程序的 Magento REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!