PSB Management API - Seat Usage question

Greetings,
Is it on purpose that the object "daily" under Seat Usage has bunch of properties rather than array of objects?
For example one of our clients has this kinda result:
{
"product": "psbWorkstationSecurity",
"summary": {
"currentSeatUsage": 17,
"monthlyMaxSeatUsages": {
"1527811200000": 17,
"1530403200000": 17
}
},
"daily": {
"1529107200000": 17,
"1529539200000": 17,
"1527811200000": 17,
"1528243200000": 17
... bunch more
}
}
This might be easy to parse with javascript to parse through all the keys under object, but what comes to c# automatically parsing result into objects this would be insane.
I would have to create a class with all the possible dates as propertynames.
Would it be possible to make this an array of objects that have timestamp and seatUsage for example?
I am skipping this completely now because I don't see any point of creating some sub-parsing method that parses this into some other objects then.
BR,
Olli Elolähde
Receptum Oy
Comments
-
Hey Milka,
From PSB Management API,
PSB Management API - Seat Usage Report
/companies/123/reports/seat-usage
It's ok if it's meant to be that way, but still feels a bit weird that you've got timestamps as property names... I can manage with it and just ignore it but would be nice to view history of the license counts to customers.
0 Like -
The endpoint was designed having in mind mostly our UI. As a result, it does not always look the most convenient for other use cases. At this point however we don't have any plans related to redesigning the endpoint or providing alternative ones.
To help you with your specific problem, I can ony suggest loading the data in C# into a dictionary, similarly as here: https://stackoverflow.com/questions/43351824/deserialize-json-with-numbers-as-property-names
6 1Like