Q about Consuming Rest service - Spotify example, and one another

Hi experts. I'm trying to test the REST API service as a data source, and no success yet displaying any data.

I followed the instruction per the link below, down to a T. OAuth implemented.
[Consume REST service (Blazor) (radzen.com)] (Consume REST service (Blazor))

And, while the available tables and fields showed up in the page's grid scaffolding, I couldn't get data to show up.

Getting:

System.Exception: Correlation failed.

An unhandled exception occurred while processing the request.
Exception: Correlation failed.
Unknown location

Exception: An error was encountered while handling the remote login.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync()

.... "cookie not found."

Snapshot attached.

That was by putting the Client ID and Secret used in the example.
I went ahead into my spotify account, developer's dashboard and created an Application there, with Edit Settings -> Redirect URIs link, assigned a user.

By the way, I don't know what callback address was used in the example (on the spotify's end) but I had quite a time getting that URI link right.
It turned out, in my case at least, that I wasn't supposed to trust the spotify's textbox placeholder and that I should omit the slash at the end.
In other words, out of the following four, only the last option worked for me. Without it, I was getting "INVALID_CLIENT: Invalid redirect URI
Unhandled exception rendering component: Response status code does not indicate success: 401 (Unauthorized).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized)."

http://localhost:5000/callback/
http://localhost:5000/spotify-callback/
http://localhost:5000/callback
http://localhost:5000/spotify-callback && working!

A side-question: do we name the Application on the Spotify's dashboard after the Radzen's Application name (SpotifyPlayer in this case) or the name of the Data source (Spotify)?

Anyway, I was wondering if anything needs to be updated, going along with Spotify updates.
Are the instructions still valid and giving results on the screen? Or, most probably, I'm doing something wrong.
Even if it's just for a simple task of retrieving Devices that the account has Spotify on.
I was going to verify the steps by using cURL but that's a different procedure and I don't think it'll help me figure out what I'm doing incorrectly.

To add to the conviction that I'm missing something fundamental, I tried following Benjamin Fadina's instructions on consuming REST service from Pixabay.
The original worked as supposed (thanks Benjamin!) but I wanted to see if I could do the same in the latest Radzen version.
Without writing FetchImages() Task but using the REST API as a data source from the Radzen IDE. i.e, scaffolding the REST instead of defining it in C# .
I've tried both for just pictures, which lands on the root ( https://pixabay.com/api/?key=xxxxxxxxxxxxxxx ) and \videos ( https://pixabay.com/api/videos/?key=xxxxxxxxxxxxxxx ) .
To no avail. Speaking of which, what do we put in Data Source -> ... -> Resource, when the final endpoint is the root. Just "/" ?
In the Pixabay's pictures, the main endpoint is https://pixabay.com/api/, and the Resource is the same - no "subfolder" there.
Also, I hope I'm using correctly "in Query string" for the API Key authorization, and not "in Header". Although I tried both, seemed to give me the same result ...
The record shows up, the fields too but no data displayed in the grid, only the column's headers.
With the debugging info in the Radzen's output:

Dotnet: fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'lPEy7aMgb8XYUokSZMjIAodOLNg8kkP25YwkIzYxfV4'.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).

Fairly self-explanatory. I know I haven't constructed the request correctly, but I'm not sure where I'm making the mistake(s).
No filtering with the "q=yellow+flowers" concatenation, just the basic show it all.

Thanks in advance to anyone capable and willing to help with this!
Sime

Here is a Radzen Blazor application created from our Spotify tutorial. Here is what it displays after running it and logging in.
blazor-rest.zip (60.0 KB)

We are not sure what your Spotify app configuration is and to be honest Spotify is just given as an example - an API which uses OAuth authentication.

Thanks Atanas!
I'll check it out.
A few days ago I tried Blazor-Rest, extracted from radzen-examples-master package, but for some reason it wasn't a standard (if there is such) REST case.
It came up as githubIssues procedure, with a "repo" parameter equal to "aspnet/AspNetCore". To be honest, I have a vague idea on what it does but I can't grasp how it does it and connects to the database of current github issues. That's for another day :slight_smile:
So Blazor-Rest I had was for githubIssues not for Spotify OAuth usage example - thanks for attaching the zip. I might have an outdated download of examples.
Sime

Edit: this blazor-rest does show the Spotify. Thanks again!
And it works like a charm. I'll dive into the DataSources (Spotify and MSGraph?) when I get a chance and try to figure out what was I missing earlier.
PS I don't really understand assigning the port for the localhost run: it is 5001 for this application, not 5000?

The attached example uses HTTPS as some OAuth implementations require it. This is why it runs on port 5001.

I see, I got it now.
Thanks!

I get:

Cannot open D:\blazor-rest\BlazorRest.sln: Project file not found: 'D:\blazor-rest\server\BlazorRest.csproj'

... error when trying to open in Radzen in windows.

The attached application is for Radzen Studio. You are probably using Radzen Blazor Studio which is why it doesn't work as the generated files (C#, csproj) are not part of the zip file.

Are there any examples for Radzen Blazor Studio?