My program is returning the correct URI for the contact list, however, when I try and download it, I'm getting an HTML file that doesn't have any useful information versus the .CSV. I copied the URI into a browser and got prompted to log in with my Genesys Cloud account and then it downloaded so that tells me that I need to pass the token in with my call but I'm stuck as to where and how to do that. I've tried many examples that I've found online, using both WebClient and HttpClient but have had no success--the same file contents gets downloaded.
Can someone please point me to a .NET example that shows what I need to do in order to pass in the token and actually download correct contents of the file?
Here is my code to download, everything from the 2 API calls that I'm using work and to eliminate scoping issues, I have everything in one procedure as this is just a "stub" program.
Dim myUri As New Uri(resultURI.Uri)
Dim wc As New WebClient
wc.Headers.Add("Authorization", "Bearer" & Configuration.Default.AccessToken)
wc.DownloadFile(myUri, "Agentless.csv")
I'm attaching the results. I even tried calling the RestClient.Download data like you suggested and I'm still getting the attached contents.