I'm in the middle of writing an iOS app for rainwave so I can actually do things like see the title/artist/album/artwork when connected to my car. Also, watchOS companion, possible tvOS app, etc etc.
Anywho, all things appear to be working except for the ability to 'tune in' so I'm able to vote. By looking at how the website performs this, I see a listen_key that is provided by the /bootstrap endpoint and is being used/passed to the stream.
Is this the official/only way to do this? I had planned on only storing the user ID and API key on the device and not the username and password. Any direction would be appreciated.
"Tuning In" via API
- William
- Mister Three
- Posts: 2264
- Joined: 01 Apr 2006, 09:30
Re: "Tuning In" via API
If you make a call to this endpoint:
You will get a list of stations that includes a streaming url with the user ID and listen_key already appended. Start streaming audio from one of those streaming urls and the user will be tuned in.
Code: Select all
GET https://rainwave.cc/api4/stations?user_id=<user_id>&key=<api_key>
- William
- Mister Three
- Posts: 2264
- Joined: 01 Apr 2006, 09:30
Re: "Tuning In" via API
If you prefer you can also POST:
Code: Select all
POST https://rainwave.cc/api4/stations
Content-Type: application/x-www-form-urlencoded
user_id=<user_id>&key=<api_key>
- droobah
- Donor
- Posts: 19
- Joined: 04 Aug 2016, 14:34
Re: "Tuning In" via API
Wow. I can't believe I was forgetting to send the api key and user ID to my /stations request.
So simple. Thanks!
So simple. Thanks!
- MrEmperor
- Tweetbooks Master
- Posts: 2337
- Joined: 04 Jun 2008, 16:43
Re: "Tuning In" via API
Let me know if you decide to publish your iOS app. I'm definitely interested.