yotoplay / yoto-sample-app

A demo of Yoto Auth and MQTT
MIT License
26 stars 5 forks source link

API docs #1

Open ahume opened 10 months ago

ahume commented 10 months ago

Is this a public and documented API for developers to build applications with? If so, where can I learn more, and how can I create an oauth app id, etc...?

cooperised commented 9 months ago

I'd be interested to know this too - looking to automate some things with my kids' Yoto players from Home Assistant, a documented API would be awesome!

kvikindi commented 7 months ago

Hopping onto this train as well - using the API with HA would be spectacular indeed!

cdnninja commented 6 months ago

I was looking for home assistant integration and came into this. I was considering start a python library and reverse engineering the app. It looks like some official approach may be out or coming. Following for more.

cdnninja commented 6 months ago

From a code standpoint it looks like most is here but I suspect we need an access token:

https://github.com/yotoplay/yoto-sample-app/blame/0a5568ce0b450fcbfe9e03f17674d91f6cc6205b/src/utils/yotoAuthService.js#L4

I tried sniffing traffic but it looks like they are doing cert pinning in the app. I have a few others ways to try get around that. I will try at some point and see.

TonySherman commented 6 months ago

@cdnninja - for what it's worth, I ran this sample app and was able to authenticate just fine, even though the access token is hard coded to 'access_token'

cdnninja commented 6 months ago

Excellent. Good to know.

cdnninja commented 6 months ago

I'm thinking I start a GitHub repo for a python api library. Once we get that roughly working can do the home assistant front end.

kvikindi commented 6 months ago

Don't know if this might be of use to us?

https://github.com/blast-hardcheese/Yoto-Music

cdnninja commented 6 months ago

Good find. That doesn't look to support login but rather steals the session from a browser. I'll get a repo setup for us to move this chat to. I'll post it when created.

ahume commented 6 months ago

Just noticed @gregyoto with commits on this repo in the last week. Would be great to get an understanding from him on the possible developments with this API. :)

cdnninja commented 6 months ago

Yes they did. I am going to get started on a wrapper. I can always align if Yoto makes an official announcement. My impression is they are considering it. Shell of a repo is here: https://github.com/cdnninja/yoto_api

bushbrother commented 6 months ago

Following after looking to see if there was a way to integrate to HA ...

buzzeddesign commented 5 months ago

wen

Would be great to have the card library integrated in Home Assistant as a media source - I've scraped the JSON and it's straightforward to grab the card artwork and MP3 link from the JSON result

endpoint: https://api.yotoplay.com/card/family/library

Something like (poorly written PHP):

foreach response["cards"] as card {
  id = card.cardID
  cover = card.content.cover.imageL
  details = get_json("https://api.yotoplay.com/card/details" + id)
  chapters = details.card.content.chapters
  stream_urls = array()
  foreach chapters as chapter {
    array_push(stream_urls, chapter.tracks[0].trackUrl)
  }
}
cdnninja commented 5 months ago

I couldn't sniff the traffic. If you could come to my repo and help out I'm happy to build the home assistant side. Just could use a hand on api.

cdnninja commented 5 months ago

FYI will be my last post here. The shell of a Home assistant integration are now put together. Should be working soon. It isn't truly function but wanted to post here to let others know.