API access broken [solved]

Mission accomplished!
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

API access broken [solved]

Unread post by DoCC »

regarding to
http://www.subsonic.org/pages/api.jsp
AND
http://beta.madsonic.org/api.jsp

It is not possible to get any info form either my own server or the demo server of MadEvil ...

I'd just wanted to get some now playing info and parse them via php.

as it says getNowPlaying.view doesn't require any additional parameters.
but there are always these error msgs

Code: Select all

<subsonic-response xmlns="http://madsonic.org/restapi" status="failed" type="madsonic" version="1.12.0">
<error code="10" message="Required parameter is missing."/>
</subsonic-response>
whats on there ?
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: API access broken

Unread post by DoCC »

was broken in 5300
is still broken in 5420
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: API access broken

Unread post by Madsonic »

just easy like 1-2-3 :)

look at the API Introduction for required parameter http://beta.madsonic.org/api.jsp

in your case for http://beta.madsonic.org/api.jsp#getNowPlaying

try this:

Code: Select all

http://localhost:4040/rest/getNowPlaying.view?u=admin&p=admin&v=1.12.0&c=php
result

Code: Select all

<subsonic-response xmlns="http://madsonic.org/restapi" status="ok" type="madsonic" version="1.12.0">
<nowPlaying>
<entry id="13343" parent="13326" title="Little Bad Girl" album="Nothing But The Beat - Disk2" artist="David Guetta" isDir="false" coverArt="13326" year="2011" genre="House" created="2013-02-07T00:49:30" duration="243" bitRate="320" track="4" size="9763522" rank="0" suffix="mp3" contentType="audio/mpeg" isVideo="false" path="David Guetta/[2011] Nothing But The Beat/Disk2/04 David Guetta - Little Bad Girl.mp3" artistId="854" type="music" username="Marty" playerId="1" minutesAgo="0"/>
<entry id="2716" parent="2715" title="City Of Ocala" album="Common Courtesy" artist="A Day To Remember" isDir="false" coverArt="2715" year="2013" genre="Rock" created="2013-10-08T11:43:20" duration="209" bitRate="320" track="1" size="8687038" rank="13" suffix="mp3" contentType="audio/mpeg" isVideo="false" path="A Day To Remember/[2013] Common Courtesy/01 A Day To Remember - City Of Ocala.mp3" albumId="63" artistId="110" type="music" username="guest" playerId="10" minutesAgo="0"/>
</nowPlaying>
</subsonic-response>
best regards
These users thanked the author Madsonic for the post:
DoCC
Rating: 7.69%
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: API access broken

Unread post by DoCC »

: ) merci

Then you should fix the API section

It clearly states : " no parameters needed "

#################################################

getNowPlaying

http://your-server/rest/getNowPlaying.view
Since 1.0.0

Returns what is currently being played by all users. Takes no extra parameters.
Returns a <subsonic-response> element with a nested <nowPlaying> element on success.

###############################################

In addition looks like your example files are broken : )
These users thanked the author DoCC for the post:
Madsonic
Rating: 7.69%
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: API access broken [solved]

Unread post by Madsonic »


no extra parameters
was referring to additionally required paramter like in this example:

http://localhost:4040/rest/getTopTrackS ... ele&size=5

Yes, the whole page is in beta phase, many parts are missing or disabled :?

best regards
User avatar
Madsonic
Administrator
Administrator
Posts: 984
Joined: 07 Dec 2012, 03:58
Answers: 7
Has thanked: 1201 times
Been thanked: 470 times

Re: API access broken [solved]

Unread post by Madsonic »

for API development this schema will be helpful

https://github.com/MadMarty/madsonic-se ... st-api.xsd

best regards
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: API access broken [solved]

Unread post by DoCC »

harr i hob was neichs zum spuin

eeerm new stuff to mess around with jihaa xD
These users thanked the author DoCC for the post:
Madsonic
Rating: 7.69%
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: API access broken [solved]

Unread post by DoCC »

a little bit of parsing, a little bit of headache with fucking css but all seems fine now

2 Examples on the fly
tracker _on.PNG


tracker_off.PNG


Next step would be ... pipe this stuff into an png graph.
mmh jo ^^

EDIT: I found a way to pipe the entire page into an dedicated "onetime-image" for the browser.
If this step works , i could think of an mysql based backend, allowing multiple users from multiple servers creating ther own images.
With custom text and maybe with custom value-fiels out of the box ...

I guess this would be a nice job burning some braincells ^^


EDIT II:
- step 1 is taken
image decprecated

EDIT III:
- step 2 is taken
i am now able to set different styles, maybe i will adapt all madsonic styles present.
at the moment there is an "tron" like and a basic orange "old school" style.
as this is the very basis i am now thinking of an mysql backend.
things stored ( encrypted ) in this db will be stuff like
- hostname
- port ( if different from 80 )
- admin login credentials ( full API access )
- username to be parsed
- desired style
if this part is done and all stuff runs as expected, i think about setting up a registration page so that users can change their values if needed to.

Hell yeah x-mess time is coming, nothing better to do then ^^
Last edited by DoCC on 17 Dec 2014, 22:26, edited 1 time in total.
These users thanked the author DoCC for the post:
Madsonic
Rating: 7.69%
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: API access broken [solved]

Unread post by DoCC »

Another step is done.

The backend is now based on mysql .
This allows to completely design the pic on the fly out of the db.
I have added pictureIDs instead of usernames.

just have an first impression :

id=GsdET3 .. this is the madsonic test account
Image

id=initial .. my own : )
Image

i will look forward to the next crazy stuff ^^
These users thanked the author DoCC for the post:
Madsonic
Rating: 7.69%
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: API access broken [solved]

Unread post by DoCC »

Please feel free for beta testing : http://madsonic.power-server.at
Post Reply