Forums » Bugs & Problems Search

Catalog Feed/Read Updates New Reply

Author Post
Posts: 3
Registered: Oct 22, 2011

I've made a catalog and put 4 artists in it (Katy Perry, U2, Barry Manilow, Adele), but I'm not getting results back from the read or feed methods in the API:

:: http://developer.echonest.com/api/v4/catalog/feed?format=xml&api_key=xxx&id=yyy&results=15&start=0&bucket=news

:: http://developer.echonest.com/api/v4/catalog/read?format=xml&api_key=xxx&id=yyy&results=15&start=0&bucket=news

I verified that there were no pending_tickets in the catalog profile, and that each artist's ticket was marked as "complete."

This is the response I'm getting from both requests:

<response>
  <status>
     <version>4.2</version>
     <code>0</code>
     <message>Success</message>
  </status>

Is there some kind of delay before I should expect to get a response with some feed or read data in it?

Posts: 30
Registered: Sep 20, 2009

Hey imbschlank,

The catalogs should update immediately. Does the catalog/profile call claim that there are items (the 'total'/'resolved' values)?

Can you provide the code snippets you used to create/populate the catalog. If you can provide the catalog ID, we can investigate a little deeper.

Posts: 3
Registered: Oct 22, 2011

Sure! Here's what I'm doing.

Check to see if Catalog has been created:

send GET request: http://developer.echonest.com/api/v4/catalog/profile?format=json&api_key=xxx&name=test-12
Response:{"response": {"status": {"version": "4.2", "code": 5, "message": "This catalog does not exist"}}}

Create catalog:

send POST request: http://developer.echonest.com/api/v4/catalog/create
POSTVARS: format=json&api_key=xxx&name=test-12&type=artist
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "type": "artist", "name": "test-12", "id": "CAKFWCZ1332C5836CD"}}

Search for artist IDs:

send GET request: http://developer.echonest.com/api/v4/artist/search?format=json&api_key=xxx&name=U2
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "artists": [{"name": "U2", "id": "ARUJ5A41187FB3F5F1"}]}}

send GET request: http://developer.echonest.com/api/v4/artist/search?format=json&api_key=xxx&name=Barry+Manilow
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "artists": [{"name": "Barry Manilow", "id": "ARVZDOM1187B9B49C9"}]}}

send GET request: http://developer.echonest.com/api/v4/artist/search?format=json&api_key=xxx&name=Adele
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "artists": [{"name": "Adele", "id": "AR7J9AP1187FB5BD64"}]}}

send GET request: http://developer.echonest.com/api/v4/artist/search?format=json&api_key=xxx&name=Katy+Perry
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "artists": [{"name": "Katy Perry", "id": "AR0IVTL1187B9AD520"}]}}

Send a catalog update:

send POST request: http://developer.echonest.com/api/v4/catalog/update
POSTVARS: format=json&api_key=xxx&id=CAKFWCZ1332C5836CD&data=%5B%7B%22action%22%3A%22update%22%2C%22item%22%3A%7B%22item_id%22%3A%22ARUJ5A41187FB3F5F1%22%2C%22favorite%22%3Atrue%7D%7D%2C%7B%22action%22%3A%22update%22%2C%22item%22%3A%7B%22item_id%22%3A%22ARVZDOM1187B9B49C9%22%2C%22favorite%22%3Atrue%7D%7D%2C%7B%22action%22%3A%22update%22%2C%22item%22%3A%7B%22item_id%22%3A%22AR7J9AP1187FB5BD64%22%2C%22favorite%22%3Atrue%7D%7D%2C%7B%22action%22%3A%22update%22%2C%22item%22%3A%7B%22item_id%22%3A%22AR0IVTL1187B9AD520%22%2C%22favorite%22%3Atrue%7D%7D%5D&data_type=json
DATA: [{"action":"update","item":{"item_id":"ARUJ5A41187FB3F5F1","favorite":true}},{"action":"update","item":{"item_id":"ARVZDOM1187B9B49C9","favorite":true}},{"action":"update","item":{"item_id":"AR7J9AP1187FB5BD64","favorite":true}},{"action":"update","item":{"item_id":"AR0IVTL1187B9AD520","favorite":true}}]
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "ticket": "CAKFWCZ1332C5836CD524EDAC1F01845"}}

Load the profile by name:

send GET request: http://developer.echonest.com/api/v4/catalog/profile?format=json&api_key=xxx&name=test-12
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"resolved": 0, "pending_tickets": [], "name": "test-12", "total": 4, "type": "artist", "id": "CAKFWCZ1332C5836CD"}}}

Request read:

send GET request: http://developer.echonest.com/api/v4/catalog/read?format=json&api_key=xxx&id=CAKFWCZ1332C5836CD&results=15&start=0&bucket=news
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"start": 0, "total": 4, "name": "test-12", "items": [], "type": "artist", "id": "CAKFWCZ1332C5836CD"}}}

Request feed:

send GET request: http://developer.echonest.com/api/v4/catalog/read?format=json&api_key=xxx&id=CAKFWCZ1332C5836CD&results=15&start=0&bucket=news
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"start": 0, "total": 4, "name": "test-12", "items": [], "type": "artist", "id": "CAKFWCZ1332C5836CD"}}}

Make Another request:

Check to see if Catalog has been created:

send GET request: http://developer.echonest.com/api/v4/catalog/profile?format=json&api_key=xxx&name=test-12
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"resolved": 0, "pending_tickets": [], "name": "test-12", "total": 4, "type": "artist", "id": "CAKFWCZ1332C5836CD"}}}

Request read:

send GET request: http://developer.echonest.com/api/v4/catalog/read?format=json&api_key=xxx&id=CAKFWCZ1332C5836CD&results=15&start=0&bucket=news
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"start": 0, "total": 4, "name": "test-12", "items": [], "type": "artist", "id": "CAKFWCZ1332C5836CD"}}}

Request feed:

send GET request: http://developer.echonest.com/api/v4/catalog/read?format=json&api_key=xxx&id=CAKFWCZ1332C5836CD&results=15&start=0&bucket=news
Response:{"response": {"status": {"version": "4.2", "code": 0, "message": "Success"}, "catalog": {"start": 0, "total": 4, "name": "test-12", "items": [], "type": "artist", "id": "CAKFWCZ1332C5836CD"}}}

Please let me know if there's something I missed!

(On an unrelated note, is there any way to make my username in the forum just the first part of my email?)

Posts: 40
Registered: Sep 08, 2009

hi imbschlank,

You need to post the items with something we can use to resolve them as well as the item_id. So, for example, you might want to POST an item block like this:

{'action': 'update', 'item': {'artist_id': 'ARUJ5A41187FB3F5F1', 'favorite': True, 'item_id': 'ARUJ5A41187FB3F5F1'}}

(The item_id does not have to be the artist_id, it's really any identifier you want to use to identify this item.) You can find a full list of the fields we will use to resolve an item in the catalog api documentation here. There's a bug on our end that is letting your POSTs get through with out this information, which we're looking at. I hope this helps you get started though, and thanks for pointing this out.

Tyler

Posts: 3
Registered: Oct 22, 2011

That makes sense, and it's now working as expected after adding the artist_id into my request.

Thank you very much!

Posts: 35
Registered: Dec 18, 2011

Hi there, I'm reading this thread since 2 hours and I still don't understand how should I update my catalog. I have create a .json block like this: [ { "action":"update", "item": { "artist_id": "ARN5NHX1187FB4F755", "favorite": True, "item_id": "TRVLWSG1383CC477F8" }} ]

Then I tried to upload it via Terminal:

curl -X POST "http://developer.echonest.com/api/v4/catalog/update" -F "api_key=My api key" -F "data_type=json" -F "format=json" -F "id=My catalog ID" -F "data=@/my path/ name of the file.json"

But the answer is always : "Invalid item block in the input: data is not properly json-encoded"

What's wrong!?

I'm a newbie, if anyone got time to answer me in an easy way...it would be very kind from you :)

Thank you in advance!

Posts: 2
Registered: Nov 04, 2011

Radosky, it seems that your json body it's actually mal-formed.

The point is the "favorite": True should be "favorite": true (downcase). I tried it using ruby json parser and it worked out.

Hope it helps you.

Posts: 35
Registered: Dec 18, 2011

Oh god...a T was the problem... thank you edulan :)

Posts: 35
Registered: Dec 18, 2011

Oh god...a T was the problem... thank you edulan :)

Posts: 35
Registered: Dec 18, 2011

Oh god...a T was the problem... thank you edulan :)

Posts: 35
Registered: Dec 18, 2011

I've got another couple of questions: I would like to create a Catalog with songs that actually are not in the database. When I write the .json block I should write the artist ID and an item id, but I don't have an item id cause the songs are not in the database indeed.

1) What should I write in the "item_id" field? 2) In the field "track_number" if I write the number like "1" or "01" I get an error, why!?

I know these are stupid questions, forgive me :)

Reply to this Thread

You must log in to post a reply.