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