"Tuning In" via API

For developers using the Rainwave API.
Post Reply
User avatar
droobah
Donor
Posts: 19
Joined: 04 Aug 2016, 14:34

"Tuning In" via API

Post by droobah » 18 Sep 2019, 13:09

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.

User avatar
William
Mister Three
Posts: 2264
Joined: 01 Apr 2006, 09:30

Re: "Tuning In" via API

Post by William » 18 Sep 2019, 13:18

If you make a call to this endpoint:

Code: Select all

GET https://rainwave.cc/api4/stations?user_id=<user_id>&key=<api_key>
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.

User avatar
William
Mister Three
Posts: 2264
Joined: 01 Apr 2006, 09:30

Re: "Tuning In" via API

Post by William » 18 Sep 2019, 13:23

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>

User avatar
droobah
Donor
Posts: 19
Joined: 04 Aug 2016, 14:34

Re: "Tuning In" via API

Post by droobah » 18 Sep 2019, 14:57

Wow. I can't believe I was forgetting to send the api key and user ID to my /stations request.

So simple. Thanks!

User avatar
MrEmperor
Tweetbooks Master
Posts: 2337
Joined: 04 Jun 2008, 16:43

Re: "Tuning In" via API

Post by MrEmperor » 05 Nov 2019, 19:28

Let me know if you decide to publish your iOS app. I'm definitely interested.

Post Reply