Help Wizard

Step 1

NEXT STEP

401 on Get Current User's Profile

401 on Get Current User's Profile

Plan

Free/Premium

Country

NL

Using UiPath Studio

 

My Question or Issue

I want to use Get Current User's Profile. 


I have obtained a token with the right scopes:

 

accesstokenfromPreviousstep

contents:
"{\"access_token\":\"BQBRbiggest part deletedOb0uX2NdEFSXYUxka2aGqWJSwvzwVo_B0bHRgAqf2Iu2Yhj-ds\",\"token_type\":\"Bearer\",\"expires_in\":3600,\"scope\":\"user-read-email user-read-private\"}"

 

When I call Get Current User's Profile, I still get:


@"{
""error"" : {
""status"" : 401,
""message"" : ""Unauthorized.""
}
}"

 

With same token, If I call:

"https://api.spotify.com/v1/users/number"

 

I do get the correct answer:

 

output
@"{
""display_name"" : ""number"",
""external_urls"" : {
""spotify"" : ""https://open.spotify.com/user/number""
},
""href"" : ""https://api.spotify.com/v1/users/number"",
""id"" : ""number"",
""images"" : [ ],
""type"" : ""user"",
""uri"" : ""spotify:user:number"",
""followers"" : {
""href"" : null,
""total"" : 9
}
}"

 

What am I doing wrong?

Reply
5 Replies

May I ask how you got that token?

Without authorization (logging in) you can't use endpoints with authorization that require autorisation.

Yes ofcourse you may ask 🙂

I called:

"https://accounts.spotify.com/api/token"

HalloDitBenIk_0-1718043821625.png

 

 

more information: 

 

this is how I filled in the certificate and password:

HalloDitBenIk_1-1718044279165.png

 

hmmm... 

Looking into this:

https://developer.spotify.com/documentation/web-api/tutorials/code-flow

 

when I do the first step, I get html code returned, which (when I put it in a html page format) gives a black screen... 

 

 

 

 

If you receive HTML code instead of the expected behavior when starting the authorization flow, there could be several reasons for this: 1. **Bad redirect URI** - Make sure the `redirect_uri` parameter you are providing in the request Authorization exactly matches one of the URIs you specified when registering your app with Spotify. Any deviations, including case differences or slashes, can cause the authorization flow to fail. 2. **S-Server

Suggested posts