Forums » Bugs & Problems Search

jen-api: CatalogUpdater.favorite() results in an invalid action New Reply

Author Post
Posts: 18
Registered: Feb 07, 2011

Hi,

I was trying to create a new song catalog and add a song to it. Problem is, the favorite() doesn't work.

Sending 1 3 1316205883585-->     http://developer.echonest.com/api/v4/catalog/profile?name=test_codehead&api_key=XXXX
received-->     {"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"resolved": 0, "pending_tickets": [], "name": "test_codehead", "total": 0, "type": "song", "id": "CAEHWFW13273FA18C9"}}}
Sending-->     http://developer.echonest.com/api/v4/catalog/update
   id=CAEHWFW13273FA18C9
   api_key=***
   data=[{"item":{"item_id":"SOEKXNR12A6D4FB78D"},"action":"favorite"}]
received-->     {"response": {"status": {"version": "4.2", "code": 5, "message": "Invalid item block in the input: favorite is not an acceptable action"}}}

Best Regards, Samuli Piela

Posts: 18
Registered: Feb 07, 2011

A-ha! So the CatalogItem ID has to be unique and is self-defined, so I managed to do it like this:

final CatalogUpdater updater = new CatalogUpdater();
final CatalogItem item = new CatalogItem("SOEKXNR12A6D4FB78D");
item.set("song_id", "SOEKXNR12A6D4FB78D");
updater.update(item);
There's got to be a cleaner way to manage a SongCatalog :)

B.r., s.

Posts: 32
Registered: Sep 08, 2009

Hi playmedia,

'favorite' isn't actually an action, but you can use the 'update' action with 'favorite' = True to favorite something. I hope this helps.

Tyler

Posts: 18
Registered: Feb 07, 2011

Yes, thanks Tyler!

Reply to this Thread

You must log in to post a reply.