Integration page in admin panel not show my custom API in the list, because i need to allow my endpoint for particular integration user not for authenticated user or is there any other way to achieve this. I think when we create a new integration, after using the provided token we can send to particular user to use the endpoint with token.
1 Answer
You need to create an ACL in your module to control access to API in integrations.
app/code/Vendor/Module/etc/acl.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Vendor_Module::name" title="Product List"/>
</resource>
</resources>
</acl>
</config>
app/code/Vendor/Module/etc/webapi.xml
<route url="/V1/products" method="GET">
<service class="Venodor\Module\Api\ProductRepositoryInterface" method="getProducts"/>
<resources>
<resource ref="Vendor_Module::name"/>
</resources>
</route>