REST API Questions

Got an idea? Missing something? Post your feature request here.
jasondlee
Posts: 1
Joined: 01 Jul 2013, 18:08
Has thanked: 0
Been thanked: 0

REST API Questions

Unread post by jasondlee »

I'm having trouble reconciling data I get back via the REST API, specifically, the IDs for indexes don't match those for artists, which may make sense, but I see no way to get from one to another. For example, here's an index record:

Code: Select all

     {
      "id": 87,
      "name": "Skillet"
     },
If I then hit getMusicDirectory with ID 87, I get, as expected:

Code: Select all

{"subsonic-response": {
 "status": "ok",
 "directory": {
  "child": [
   {
    "id": 1952,
    "title": "[2009] Awake (Deluxe)",
    "averageRating": 5,
    "userRating": 5,
    "created": "2013-06-20T14:27:54",
    "parent": 87,
    "isDir": true,
    "artist": "Skillet",
    "coverArt": 1952
   },
   {
    "id": 1954,
    "title": "[2006] Comatose",
    "starred": "2013-07-08T13:43:48",
    "created": "2012-09-28T16:05:35",
    "parent": 87,
    "isDir": true,
    "artist": "Skillet"
   }
  ],
  "id": 87,
  "name": "Skillet"
 },
 "xmlns": "http://madsonic.org/restapi",
 "version": "1.10.1"
}}
Requests for music directories IDs 1952 and 1954, I get the album information I expect. However, if I look for Skillet with getArtists, I get this:

Code: Select all

     {
      "genre": "Christian Rock",
      "id": 94,
      "name": "Skillet",
      "coverArt": "ar-94",
      "albumCount": 26
     },
I don't see any way to get from one to another, which is only important, I guess, if you want the genre for the artist, etc. While we're on the subject, note that "albumCount" is off. There are 2 songs, and, I guess 26 songs (that seems high, but I haven't counted to see).

Is there a way to get from the index/music directory to the artist record, or should I just deal with the former?
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: REST API Questions

Unread post by Madsonic »

hi there,

can you tell the syntax of your REST API calls, i believe you have something mixed up.

Examples

Code: Select all

http://localhost/rest/getArtists.view?u=admin&p=admin&v=1.10.1&c=WebScript
http://localhost/rest/getArtist.view?u=admin&p=admin&v=1.10.1&c=WebScript&id=62
http://localhost/rest/getMusicDirectory.view?u=admin&p=admin&v=1.10.1&c=WebScript&id=100
http://localhost/rest/getAlbum.view?u=admin&p=admin&v=1.10.1&c=WebScript&id=53
best regards
Post Reply