Skip to content

rest-api

Auto Added by WPeMatico

Model Class not found error in Magento REST API – not able to identify any issues in this

Error: Class “TestCsvImportModelImport” not found in /var/www/html/testproject/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 This is the error I am getting. Here are my code webapi.xml <?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/import/csv” method=”POST”> <service class=”TestCsvImportApiImportInterface” method=”importCsv”/> <resources> <resource ref=”Magento_Backend::admin”/> </resources> </route> </routes> di.xml <?xml version=”1.0″?> <config… Read More »Model Class not found error in Magento REST API – not able to identify any issues in this

Magento API Date filter

Is it possible to create a Date filter to fetch orders created only in last two days using API , without hard-coded values ? Something like this: http://<magento_host>/rest/V1/orders? searchCriteria[filter_groups][0][filters][0][field]=created_at& searchCriteria[filter_groups][0][filters][0][condition_type]=from& searchCriteria[filter_groups][0][filters][0][value]=(current date – 2 days) searchCriteria[filter_groups][1][filters][0][field]=created_at& searchCriteria[filter_groups][1][filters][0][condition_type]=to& searchCriteria[filter_groups][1][filters][0][value]=(current date)

Magento 2 custom API working for Bearer Token and not working for OAuth1.0

I have created a custom API endpoint to retrieve data from a custom table in magento 2. Webapi.xml file content <route url=”/V1/bs-customer-price-information/:email/:website_id” method=”GET”> <service class=”BSKoRPricingApiKoRPricingRepositoryInterface” method=”getPriceListByCustomerAndWebsite”/> <resources> <resource ref=”Magento_Catalog::products”/> </resources> </route> This endpoint giving result with Bearer Token. If I… Read More »Magento 2 custom API working for Bearer Token and not working for OAuth1.0