we are trying to use the measurement/series API, but we are getting an error when parsing the result.
While checking we found that there are 15 Series Specs, but only 14 Entries in the values Arrays.
Is this supposed to happen? How would one interpret the values if they don’t align with the series size? It looks like most of the time it happens to match, even if not all series have values.
Here the faulty response:
weird.txt (4.9 KB)
it seems your device did not send a measurement for this series:
Missing measurements are indicated by an null placeholder in the array. If the missing measurements are in the end of the array these null vallues are left out as part of the response.
Yes, this is intentional. The ‘values’ can be less entries than the ‘series’, if for any of the series there is no value to return. The sequence of ‘values’ matches the sequence of ‘series’ so from your weird file it looks like there is no reading for Furnace_Zone_7_Temp_PV - the last of the ‘series’.
If there’s no reading for a ‘series’ that is not at the end of the list then I think it puts null in the ‘values’ list.
Thanks @Tristan_Bastian and @Robert_Neale. The documentation is not really clear about that. By the way: we also found that comma-separating the series param does not work  for us, but using multiple &series params does.
 Cumulocity IoT - OpenAPI Specification
@Mario_Heidenreich2 Did you raised a defect about the documentation issue?
@Joerg_Hartmann Where would I do that? Empower Support or Aha?
For documentation improvements you can actually use the Feedback button in the lower right hand corner of the Browser window:
In my experience, issues reported that way are resolved quickly.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.