My Products
Help
erik-kle
PARTNER

GET Customer by attribute not working

by erik-kle

None of the following requests works for us now. It started a week ago. And the requests takes very long time to return. 
Any suggestions?

https://integration.visma.net/API/controller/api/v1/customer?attributes={"SHOPID":"56683"}&pageNumber=1&pageSize=1

https://integration.visma.net/API/controller/api/v1/customer?attributes=%7B"SHOPID":"56683"%7D&pageNumber=1&pageSize=1  

 

https://integration.visma.net/API/controller/api/v1/customer?attributes=%7B"SHOPID":"56683"%7D

https://integration.visma.net/API/controller/api/v1/customer?attributes=%7B%22SHOPID%22:%2256683%22%7D&pageNumber=1&pageSize=1 

https://integration.visma.net/API/controller/api/v1/customer?attributes=%7B%22SHOPID%22%3A%2256683%22%7D

5 REPLIES 5
Yıldırım
VISMA

by Yıldırım (Updated ‎16-06-2021 14:21 by Yıldırım VISMA )

Hello. 

As @Florian Haase pointed out,  

currently, there is an issue on filtering with Attributes when using the Pagination.

The problem is the same as for the other endpoints when Attributes & Pagination available and used together. The reason behind this issue is that endpoints have been implemented with "join" in memory.  All attributes fetched based on the matching criterion and then skipped all inventories, customers and suppliers etc. , which are not matched with the selected attributes. This operation is done by first getting all assets based on pagination information and then joined in the memory (instead of joining attributes to the specific tables)

 

According to information that we've received from the team, the solution is that to create a new query approach for the endpoints where SQL is used to join attributes. We've once again emphasized the importance of getting this issue resolved.

 

This has been discussed on the following thread earlier, some other details can be also seen at the Issue with filtering of attributes
e.g.

customer?attributes={"TEST":"testvalue"}&pageNumber=1&pageSize=1 : Two objects match this criteria.

  • pageSize=1:
    • pageNumber=1: Incorrectly returns empty array
    • pageNumber=2: Returns 1st object
    • pageNumber=3-4: Returns empty array
    • pageNumber=5: Returns 2nd object
  • pageSize=2:
    • pageNumber=1: Returns 1st object
    • pageNumber=2: Returns empty array
    • pageNumber=3: Returns 2nd object
  • pageSize=3 & 4
    • pageNumber=1: Returns 1st object
    • pageNumber=2: Returns 2nd object
  • pageSize=5
    • pageNumber= 1: Returns both objects as expected

 

We'll keep the community updated on the latest news regarding the development plan once it has emerged.

 

Additionally, Attribute encoding and relevant information can be found at Knowledge Base > Using the Attribute Parameter

Thanks.

Florian Haase
PARTNER

by Florian Haase

Just to remember: The attribute-filter "removes" the filtered entities from the pages and does not filter the result set before paging. Right? That means if 500 customers on page 1 (without defining the PageSize) don't hit the filter you will get a blank result. Have you tried to check page 2 and 3 and so on? In your case this especially will make problems for the request with PageNumber=1 and PageSize=1, the filtered customer could be on the Page 5679 for example. (in our implementations we first get the first page and read the metadata to check how many pages we could expect)

@Yildirim: Just correct me if I do wrong here...

 

Yıldırım
VISMA

by Yıldırım (Updated ‎16-06-2021 12:17 by Yıldırım VISMA )

Hello, 

It'd be good if you could specify what has stopped working. Are the attribute parameters omitted and not filtering the assets ?

Thanks.

erik-kle
PARTNER

by erik-kle (Updated ‎16-06-2021 13:20 by erik-kle PARTNER )

I have made some tests now, and the following request finnished in 5,4 minutes. 

https://integration.visma.net/API/controller/api/v1/customer?attributes=%7B"SHOPID":"56683"%7D

 

So its most likely that we have started to received timeouts the last week, and thats the reason i thought it stopped working. Can you find any reason for such a long delay?

Yıldırım
VISMA

by Yıldırım

This might be related to size of the data being fetched, network traffic etc. Since pagination is not properly working while filtering with Attributes, we understand that clients are unable to narrow the data scope to avoid timeouts. 

Do you have a retry mechanism in place ? If so, how frequently you're receiving timeouts ?