API is not returning desired data

Hi,

I am trying to GET ‚customer‘ data using this request. http://templatebar.com/test/shopware/api/customers/1

From this request I am getting all information of that Customer.

But when I am trying to fetch data using ‚date‘ filter, using this request, http://templatebar.com/test/shopware/api/customers?filter[0][property]=firstLogin&filter[0][expression]=>&filter[0][value]=2017-11-27

This call is not returning full data of that customer. Please look into this & provide some solution. Best, Souvik

Dear Souvik,

The API is working as expected. Please have a look at the documentation here.

In your first try (http://…/api/customers/1) you are using “example 2: getting a specific customer” which returns all information on the customer.

With your second try, you are in fact using example 1 (getting all customers), and you are simply adding a filter to not retrieve all customers, but only A LIST of customers satisfying your filter. Probably you are confused because your filter returns only 1 customer in your specific case/filter. If more customers satisfy the filter, you will however receive a list.

And a list of customers returns not the full data of each customer by design.

1 Like