We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    While you’re working with the REST API in Magento you can retrieve the Rest Webapi Request Parameters.

    Magento has its own OOTB Webapi module that is dealing with Rest API functionality.

    Required Class, MagentoFrameworkWebapiRestRequest

    <?php
    namespace MagemonkeysRestParamsModel;
    
    use MagentoFrameworkWebapiRestRequest;
    
    class GetRestParam
    {
        /**
         * @var Request
         */
        protected $request;
    
        public function __construct(
            Request $request
        ) {
            $this->request = $request;
        }
    
        public function getParamValue()
        {
            $filter = $this->request->getParam('paramerer_name');
        }
    }

    In the above example, ‘paramerer_name’ is your actual parameter name to retrieve the value from the request.

    If you want to get all the parameters for the Rest API,
    $this->request->getParams();  print the all list of key & value for the request parameter.

    field_5bfb909c5ccae

      Get a Free Quote