I want to use the Volumio rest api locally, using a shell script und curl (or wget, if that’s enough).
What’s the correct way to do this?
things like
curl http://localhost/api/v1/commands/play
result in
curl: (7) Failed to connect to localhost port 80: Connection refused
Do I have to use a different port?
Try port 3000.
I am trying to get similar to work (play) from a 2nd web browser window but it brings up the same web front-end as the first window rather than starting to play the song.
you can call it from CMD as follows
wget -qO- localhost:3000/api/v1/commands/?cmd=play
wget -qO- localhost:3000/api/v1/commands/?cmd=pause
wget -qO- localhost:3000/api/v1/commands/?cmd=next
etc.
from the browser you can do it like this
x.x.x.x/api/v1/commands/?cmd=play
port 3000 not exposed outside of volumio
Hello,
I tried the command “curl volumio.local/api/v1/commands/?cmd=playplaylist&name=xxx” form another raspberry to start the playlist. No success.
In the webinterface the Same command as “volumio.local/api/v1/commands/?cmd=playplaylist&name=xxx” works. Commands like play and stop are working also fine with curl form another client. Is there somebody who knows what to do? Maybe something with permissions?
Sincerly leo
Finally I found the solution:
The command needs to be enclosed by single quotes:
volumio.local/api/v1/commands/?cmd=‘playplaylist&name=xxx’
That works. Thx to this forum.