Rest api? #3802
|
Hello I am really enjoying music assistant, I am interested in integrating it with my own code since I am not a home assistant user. I found https://github.com/music-assistant/client but nothing in the documentation about it, is there some reference for the server api that i could use? I am looking for something like a REST or websocket api Thanks |
Replies: 5 comments 8 replies
|
We don’t publish full details about the api. What are you wanting to do? |
@JarbasAl even if you are not using Home Assistant yourself it might still be a good idea to look at its integration code for Music Assistant? That it, suggest you also look at the The Maybe also look into how it is integrated into home-assistant's frontend as well (though think it's deeply embedded with the backend core?)? |
@JarbasAl might it also be a good idea to partially study documentation for the general/generic Home Assistant WebSocket API integration as indirect reference since there at least looks to be plenty of documentation for that and can maybe assume that Music Assistant's approach is similar, or? |
|
There is now API documentation for the 2.7.0 beta and later versions of Music Assistant. The API documentation is automatically generated and available at http://your_ma_server_ip:8095/api-docs |
|
Is there way to remove tracks from playlist by uri instead? like in add track to playlist or alternatively some way inside home assistant to get the position of the track that is currently in a playlist? i am having trouble using this call to get all tracks in playlist so that i can compare and get the position... can't decipher what the parameters are? |
MA uses a websockets API which is also partially exposed as json/rest API.
Look at the client library for reference: https://github.com/music-assistant/client
or if you prefer javascript/typescript, see the frontend code: https://github.com/music-assistant/frontend/blob/main/src/plugins/api/index.ts
It's super straight forward so you should be able to figure it out quickly enough.
Unfortunately we do not have the capacity to write docs for the API now and we prefer if people use the official python client.