Shopping_list api marking complete

I’m trying to make items complete on my shopping list through the api. I can successfully get all the items on my shopping list, add new items and even clear all the completed items on the shopping list all through api calls. But when it comes to updated an item to completed I can’t seem to make it work.

this url will return all my items:
http://homeassistant.local:8123/api/shopping_list/

I can add items with this url using json in body name: test
http://home assistant.local:8123/api/shopping_list/item

according to this page: https://github.com/home-assistant/home-assistant/blob/a119932ee590b9115afc97ddf56b9a95fd9f2c00/homeassistant/components/shopping_list/init.py
i should be able to use http://home assistant.local:8123/api/shopping_list/item/{ENTER MY ITEM ID }
to update my items as being complete , but all i get is {“message”:“Item not found”}

Anybody try this before? Anybody had any success?

1 Like

This works for me from command line, where “beer” is the name of the item on shopping-list:

curl -k -X POST -H “Content-Type: application/json” -H "Authorization: Bearer [token] http://[HA_IP]:8123/api/services/shopping_list/complete_item -d ‘{“name”:“beer”}’

yes, yes, yes! That did it! Thanks.

Your request body should contain complete attribute, based on validation schema.

{
  complete: true
}