1

I would like to know is it possible to (call) specify multiple URLs in a single route webapi.xml ?

Ex:-

<?xml version="1.0"?>
    <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
        <route url="/V1/hello/test/" method="POST">
            <service class="Inchoo\Hello\Api\TestInterface" method="test"/>
            <resources>
                <resource ref="anonymous"/>
            </resources>
        </route>
    </routes>
2

We can define the same API url name, BUT with different methods and actions:

    <route url="/V1/hello/test/" method="POST">
        <service class="Inchoo\Hello\Api\TestInterface" method="test"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>

    <route url="/V1/hello/test/" method="GET">
        <service class="Inchoo\Hello\Api\TestInterface" method="get"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.