Developer forum

Forum » Feature requests » Add favorite lists to WebAPI

Add favorite lists to WebAPI

Tor Leeberg
Reply

Hi

We have a customer running DW 9 headless where we have to implement product favorites.

It would be great to have favorite list management added to the webapi so we don't have to create a custom solution for this.

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Tor

I have added devops#11587 to the queue to add 

GET, POST, PATCH, DELETE for creating lists
GET, POST, PATCH, DELETE for creating items in a list
/dwapi/favorites/lists
/dwapi/favorites/items
 
Let me hear if you have other needs?
BR Nicolai
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

It looks pretty interesting.

For "creating items in a list", the operations also support quantities?

Any estimate about when this feature will make it to a release?

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes, productid, variantid, note, quantity and sortorder.

It should be completed by the end of sprint 2 of Q1/23 - ending Feb 7th. So sometime close after that when passing QA and release if the plan goes as it should.

 
Tor Leeberg
Reply

Hi Nicolai

This sounds perfect! Thanks! :)

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Any news on this subject?

Thank you,

Adrian

   
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Nicolai.

This is good news. I suppose these will not be featured in the 9.14 branch, right?

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

9.14.9

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you very much for the confirmation.

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,
We have played around with the endpoints and everything works fine, except for one thing.

The Description field is not available in none of the endpoints. At least in 9.14.13. Is that by design or simply an oversight?

Can it be added to the endpoints?

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Indeed it is missing,

devops#14616, https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_git/Dynamicweb/pullrequest/9471

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you.

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,
We have identified another missing part which is Sorting of products in Favorite lists. It is not part of the API.
It is only available for Get:

To put the need in context, we need to sort a Favorite product list by using a drag and drop interaction. For this purpose, it would be useful if we can patch the entire list with a single call, updating the order of the products inside the list (and ideally the quantities).

What do you think? Does it make sense?

Thank you,
Adrian

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

You can use the PATCH to items:

/dwapi/favorites/items/{listId}/{id}

It takes FavoriteProduct object that holds the sortorder

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have tested your suggestion and it works with one product object but I cannot send multiple ProductObjects (the entire list).

This makes updating the sort order a real pain because we would have to path every product in the list individually instead of updating the entire list at once.

Is there any other option to accomplish this scenario?

Thank you,
Adrian