0
 public function __construct(\Magento\Framework\App\RequestInterface $request,
        \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerFactory
    )
    {
        $this->_request = $request;
        $this->_customerFactory = $customerFactory;
    }  


public function  getAllCustomers() {         
            $customerCollection = $this->_customerFactory->create();
            return $customerCollection;
        }

Im getting following error:

{ "message": "Invalid parameter configuration provided for $reader argument of Magento\Framework\Interception\PluginList\PluginList", "trace": "#0 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'reader', 'Magento\\Framewo...')\n#1 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)\n#2 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)\n#3 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')\n#4 /var/www/html/dreamb2b/vendor/magento/framework/Interception/Interceptor.php(42): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')\n#5 /var/www/html/dreamb2b/generated/code/Magento/Eav/Model/Entity/Attribute/Set/Interceptor.php(13): Magento\Eav\Model\Entity\Attribute\Set\Interceptor->___init()\n#6 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Eav\Model\Entity\Attribute\Set\Interceptor->__construct(Object(Magento\Framework\Model\Context), Object(Magento\Framework\Registry), Object(Magento\Framework\Api\ExtensionAttributesFactory), Object(Magento\Framework\Api\AttributeValueFactory), Object(Magento\Eav\Model\Config), Object(Magento\Eav\Model\Entity\Attribute\GroupFactory), Object(Magento\Eav\Model\Entity\AttributeFactory), Object(Magento\Eav\Model\ResourceModel\Entity\Attribute\Interceptor), NULL, NULL, Array)\n#7 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Eav\\Mod...', Array)\n#8 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Eav\\Mod...')\n#9 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Eav\\Mod...')\n#10 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Eav\\Mod...')\n#11 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Eav\\Mod...')\n#12 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Custome...', Array)\n#13 /var/www/html/dreamb2b/vendor/magento/framework/Validator/UniversalFactory.php(36): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Custome...', Array)\n#14 /var/www/html/dreamb2b/vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php(229): Magento\Framework\Validator\UniversalFactory->create('Magento\\Custome...')\n#15 /var/www/html/dreamb2b/vendor/magento/module-customer/Model/ResourceModel/Customer/Collection.php(87): Magento\Eav\Model\Entity\Collection\AbstractCollection->_init('Magento\\Custome...', 'Magento\\Custome...')\n#16 /var/www/html/dreamb2b/vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php(164): Magento\Customer\Model\ResourceModel\Customer\Collection->_construct()\n#17 /var/www/html/dreamb2b/vendor/magento/module-eav/Model/Entity/Collection/VersionControl/AbstractCollection.php(60): Magento\Eav\Model\Entity\Collection\AbstractCollection->__construct(Object(Magento\Framework\Data\Collection\EntityFactory), Object(Magento\Framework\Logger\Monolog), Object(Magento\Framework\Data\Collection\Db\FetchStrategy\Query), Object(Magento\Framework\Event\Manager\Proxy), Object(Magento\Eav\Model\Config), Object(Magento\Framework\App\ResourceConnection\Interceptor), Object(Magento\Eav\Model\EntityFactory), Object(Magento\Eav\Model\ResourceModel\Helper), Object(Magento\Framework\Validator\UniversalFactory), NULL)\n#18 /var/www/html/dreamb2b/vendor/magento/module-customer/Model/ResourceModel/Customer/Collection.php(76): Magento\Eav\Model\Entity\Collection\VersionControl\AbstractCollection->__construct(Object(Magento\Framework\Data\Collection\EntityFactory), Object(Magento\Framework\Logger\Monolog), Object(Magento\Framework\Data\Collection\Db\FetchStrategy\Query), Object(Magento\Framework\Event\Manager\Proxy), Object(Magento\Eav\Model\Config), Object(Magento\Framework\App\ResourceConnection\Interceptor), Object(Magento\Eav\Model\EntityFactory), Object(Magento\Eav\Model\ResourceModel\Helper), Object(Magento\Framework\Validator\UniversalFactory), Object(Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot), NULL)\n#19 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Customer\Model\ResourceModel\Customer\Collection->__construct(Object(Magento\Framework\Data\Collection\EntityFactory), Object(Magento\Framework\Logger\Monolog), Object(Magento\Framework\Data\Collection\Db\FetchStrategy\Query), Object(Magento\Framework\Event\Manager\Proxy), Object(Magento\Eav\Model\Config), Object(Magento\Framework\App\ResourceConnection\Interceptor), Object(Magento\Eav\Model\EntityFactory), Object(Magento\Eav\Model\ResourceModel\Helper), Object(Magento\Framework\Validator\UniversalFactory), Object(Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot), Object(Magento\Framework\DataObject\Copy\Config), NULL, 'Magento\\Custome...')\n#20 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Custome...', Array)\n#21 /var/www/html/dreamb2b/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Custome...', Array)\n#22 /var/www/html/dreamb2b/generated/code/Magento/Customer/Model/ResourceModel/Customer/CollectionFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create('\\Magento\\Custom...', Array)\n#23 /var/www/html/dreamb2b/app/code/Soulof/CustomerAttribute/Model/Account.php(117): Magento\Customer\Model\ResourceModel\Customer\CollectionFactory->create()\n#24 [internal function]: Soulof\CustomerAttribute\Model\Account->getAllCustomers()\n#25 /var/www/html/dreamb2b/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)\n#26 /var/www/html/dreamb2b/vendor/magento/module-webapi/Controller/Rest.php(244): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))\n#27 /var/www/html/dreamb2b/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#28 /var/www/html/dreamb2b/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)\n#29 /var/www/html/dreamb2b/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#30 /var/www/html/dreamb2b/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)\n#31 /var/www/html/dreamb2b/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#32 /var/www/html/dreamb2b/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http->launch()\n#33 /var/www/html/dreamb2b/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#34 {main}" }

0

Seems ,you have done wrong.

Magento2, already have rest API point, you do not create any API point like controller action. Check out Magento 2 rest API https://devdocs.magento.com/guides/v2.3/rest/bk-rest.html

If you want to get all customer list then use API pint rest/V1/customers/ Checkout all point a swagger: https://devdocs.magento.com/swagger/

Check out this answer also

Get list of ALL customers using REST API

  • Hi Bera, i know about the Customer api call, i want to customized fields and based customer i need other data also. please let me know what was the issue or any other method get customer data – Purnendar Gattu Jan 3 at 6:18
  • What you mean by customized fields? – Amit Bera Jan 3 at 8:07

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.