Selecting Spotify track or album

Selecting Spotify track or album

edited 02/08/2018 - 10:24 in SoundTouch API
andylyonetteandylyonette Posts: 8Member

Hi Zach,

I'm trying to play a track or source from Spotify but must be passing the wrong data in as I get a success message from the device but nowPlaying states INVALID_SOURCE.

I'm sending "SPOTIFY" as the source.

I'm sending the username (not email address) associated with my Spotify account that matches the sourceAccount from /nowPlaying when I play the track from the SoundTouch app.

I'm sending the location as "spotify:album:uniqueId" or "spotify:track:uniqueId" that I got from NowPlaying/trackID or NowPlaying/ContentItem/location - this is where I think I'm going wrong, can you point me in the right direction?

If I POST this whilst I have the SoundTouch app open on my phone I get an error 3404.

Thanks,
Andy

Comments

  • edited 02/08/2018 - 17:25
    Zach@Bose[email protected] Posts: 156Admin

    Hey Andy,

    It sounds like you're doing the right thing, but clearly something is afoot. Would you be willing to post the ContentItem you're using directly? (using dummies for any personal identifiers, of course). That can help me and the team to better troubleshoot what the issue might be.

    Thanks,
    Zach

  • edited 02/08/2018 - 19:08
    andylyonetteandylyonette Posts: 8Member

    Hey Zach,

    Thanks for coming back to me so quickly. This is an example of a ContentItem I'm trying to post:

    < ContentItem source="SPOTIFY" sourceAccount="andylyonette" location="spotify:track:3kqAiQwZufJCBDfeO4awZF" > < / ContentItem >

    The response from the device (currently a WIreless Link Adapter):

    < ? xml version="1.0" encoding="UTF-8" ? > < status > /select < / status>

    If I then GET now_playing I receive the following:

    < nowPlaying deviceID="7C3866D38252" source="INVALID_SOURCE" > < ContentItem source="INVALID_SOURCE" isPresetable="true" / > < / nowPlaying >

    andylyonette matches the sourceAccount value for the source SPOTIFY on the device as well as sourceProvider 15 in my SoundTouch account.

    Thanks,
    Andy

  • edited 02/09/2018 - 10:15
    Zach@Bose[email protected] Posts: 156Admin

    Hey Andy,

    After discussing with our engineering team, it looks like there's an extra field missing from the ContentItem, the "type" field. This is due to a gap in our documentation, which is missing that field and doesn't accurately capture our intent around using /select to play back streaming services.

    I'll be updating the documentation to reflect this soon, but the intent is for applications to grab ContentItems directly from /now_playing and essentially treat them as a single opaque blob, used to then start playback again later by posting the exact blob back to /select. This is the extent to which we're able to officially support at this time.

    Can you try starting playback of the track you're trying to play using the SoundTouch app, grabbing the ContentItem via /now_playing, and then using that with /select and see if you're still having issues?

    Thanks, and sorry for the inconvenience here,
    Zach

  • andylyonetteandylyonette Posts: 8Member

    Hey Zach,

    I can confirm that adding the type field worked, thanks! I'll look to send all the ContentItem properties though if that's what you recommend. Thanks again for coming back to me so quickly.

    Thanks,
    Andy

Sign In or Register to comment.