Search code examples
androidmagentomagento-rest-api

Magento REST API for Android Application


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

but I cannot access REST API through www.magentohost.com/api/rest and also many ways. How to REST API in magento?


Solution

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

    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