0

i am trying to create a custom REST API

i use this guide https://inchoo.net/magento/configure-magento-rest-and-oauth-settings/

enter image description here

api2.xml file

<?xml version="1.0"?>
<config>
 <api2>
 <resource_groups>
 <lovatapi_restapi translate="title" module="LovatApi_Restapi">
 <title>Lovat Api</title>
 <sort_order>10</sort_order>
 </lovatapi_restapi>
 </resource_groups>
 <resources>
 <lovatapi_restapi translate="title" module="LovatApi_Restapi">
 <group>lovatapi_restapi</group>
 <model>lovatapi_restapi/api2_restapi</model>
 <title>Lovat API</title>
 <sort_order>10</sort_order>
 <privileges>
 <admin>
 <create>1</create>
 </admin>
 </privileges>
 <attributes translate="" module="LovatApi_Restapi">
 <from>from</from>
 <to>to</to>
 <p>p</p>
 </attributes>
 <routes>
 <route_collection>
 <route>/lovatapi</route>
 <action_type>collection</action_type>
 </route_collection>
 </routes>
 <versions>1</versions>
 </lovatapi_restapi>
 </resources>
 </api2>
</config>

but when i try to do request to my api i get this

enter image description here

How to solve this problem?

asked Jun 28, 2021 at 11:46

1 Answer 1

0

I would suggest to follow that guide. It's pretty detailed and simple: https://code.tutsplus.com/tutorials/create-a-custom-api-in-magento-part-two--cms-23821. You should make it work with that tutorial.

In general I think that your API Wsdl URL is wrong. It should be something like "http://yourmagentostore/api/v2_soap?wsdl=1".

Aditionally the main custom Api files should be "api.xml" for declaring the API methods and the "wsdl.xml" for defining the API methods in SOAP syntax.

Further i'm missing the ACL node inside your provided config. It's used to provide access to the specific ressources.

With the linked tutorial you should be able to make it work.

Good luck

answered Jul 27, 2021 at 8:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.