AutoTools JSON READ - Spotify URI

Discussion in 'AutoApps' started by Brian86, Jul 26, 2017.

  1. Brian86

    Brian86 New Member

    Joined:
    Jul 26, 2017
    Messages:
    9
    Likes Received:
    1
    I'm trying to write a task that will allow me to ask Alexa (Via AutoVoice) to play an artist from Spotify.
    My current flow is as follows
    ->"Alexa, play <artist>" - (Spotify is my default media source so Alexa will play songs by the artist on the echo device)
    -> "Alexa, ask AutoVoice to Cast Inside" - (This triggers a task that will select my Chromecast Audio Indoor Group via Spotify connect)
    From here Alexa will no longer control spotify without the help of AutoVoice so when I would like to ask Alexa to change artist,
    -> "Alexa, ask AutoVoice to play <artist>" - (This triggers a task with the MEDIA_PLAY_FROM_SEARCH intent and querys %avcommnofilter, however, Spotify will only play the 4 songs listed in the search results)
    *I could use AutoInput to select the first artist and then select shuffle play, but this will skip the currently playing track.
    My idea was to instead of using the "Extra: query %avcommnofilter", I would use JSON READ to find the URI via https://api.spotify.com/v1/search?type=artist&q=%avcommnofilter and use "Data: spotify:artist:%artistid" which would direct me to the artist page instead of the search results.
    (This particular task won't auto play but AutoInput should get the job done)
    Unfortunately it seems that Spotify no longer allows unauthenticated calls to their web API and I receive the following error
    com.joaomgcd.common.Util$a: { "error" : { "status" : 401, "message" : "No token provided" }}

    Could anyone help me with a solution?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    Unfortunately Spotify disabled access to the API without providing an authentication token, sorry! You have to use AutoWeb for that now: https://joaoapps.com/beta-testing/
    Hope this helps!
     
    Brian86 likes this.
  3. Brian86

    Brian86 New Member

    Joined:
    Jul 26, 2017
    Messages:
    9
    Likes Received:
    1
    This is great
    My only question so far is, when using the Spotify API and "Search Artist" Action, is it possible for it to only return the top search result? It looks like its returning all 4 search result URI's

    Edit: This should probably be moved to the AutoWeb section
     
    Last edited: Jul 27, 2017
  4. Brian86

    Brian86 New Member

    Joined:
    Jul 26, 2017
    Messages:
    9
    Likes Received:
    1
    I figured it out, I used the %artist_name1 variable.
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    great! :)
     
  6. xmarcs

    xmarcs New Member

    Joined:
    Mar 20, 2019
    Messages:
    2
    Likes Received:
    0
    Is AutoWeb still supported? I'm getting this same message through autoweb now for spotify tasks. status 401. I had several autoweb processes in tasker and it won't run any of them now. It just says access token expired
     
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    Yes, AutoWeb is supported. When are you getting that exactly?
     
  8. xmarcs

    xmarcs New Member

    Joined:
    Mar 20, 2019
    Messages:
    2
    Likes Received:
    0
    Sorry for multiple posts, but still going through authentication problems. That's definitely the issue. Once I hit "reauthenticate" it seems to work for another half hour or so before it times out. Is there a way to completely remove my authentication and reenter? I keep getting taken back to the checkmark and x screen for joaoapps.com/autoweb. Is there a way to completely clear my old authentication? I think that's what the problem is.

    Thank, bud! Your work is crazy inspiring. Really so cool having voice control on my spotify. Really appreciate all your apps!
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    HHmm, maybe Spotify changed something about their authentication methods... I'll give it a try myself!
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    Hmm, I didn't have to reauthenticate... Are you maybe able to revoke AutoWeb permissions on the spotify website?
     

Share This Page