Cayenne GET Request Authorization


#1

Hi all, I’m having a bit of a problem figuring out how to do a GET request via Xamarin C# to Cayenne,

in my Postman App, I can do the request just fine, it returns the value of the sensor just fine,

but when it comes to my C# code, which is in here:

I get an “Unauthorized” response status, is there something wrong with my code specifically the get request? I tried running it with and without the X-API-Version, only that line of GET request from Visual studio is having a problem getting the sensor data, but on Postman’s request it doesn’t have any problem retrieving the data…Thanks in advance


#2

Okay silly me, I solved it with the help of googling around, the problem is not in the GET request, but the JSON data that the Cayenne API sends, what is happening is that the link for getting your sensor data seems like it sends ARRAYS of JSON objects, my code as you can see can only de-serialize an object of single nature, not an array, so what happened now is I followed the solution here:

Deserialize JSON array

Thanks!

Can now mark this as Solved!