user13242: I'm having a problem extracting the Object/Array from this sample json

[
   {
     "sensor":"gps1",
     "time":1351824120
   },
   {
     "sensor":"gps1",
     "time":1351824120
   }
]

Would anyone have some pointers or sample code to allow me to extract the 'time' from each of the objects ?
Thanks

user3430: You can use the ArduinoJson Assistant on arduinojson.org to create a skeleton.
Here is what it generates in your case:
const size_t bufferSize = JSON_ARRAY_SIZE(2) + 2*JSON_OBJECT_SIZE(2) + 70;
DynamicJsonBuffer jsonBuffer(bufferSize);

const char* json = "[{\"sensor\":\"gps1\",\"time\":1351824120},{\"sensor\":\"gps1\",\"time\":1351824120}]";

JsonArray& root = jsonBuffer.parseArray(json);

const char* root_0_sensor = root[0]["sensor"]; // "gps1"
long root_0_time = root[0]["time"]; // 1351824120

const char* root_1_sensor = root[1]["sensor"]; // "gps1"
long root_1_time = root[1]["time"]; // 1351824120


13242: <p>I'm having a problem extracting the Object/Array from this sample json
<code>
[
   {
     "sensor":"gps1",
     "time":1351824120
   },
   {
     "sensor":"gps1",
     "time":1351824120
   }
]
</code></p>

<p>Would anyone have some pointers or sample code to allow me to extract the 'time' from each of the objects ?</p>

<p>Thanks</p>
 3430: <p>You can use the <a href="https://arduinojson.org/assistant/" rel="nofollow noreferrer">ArduinoJson Assistant</a> on <a href="https://arduinojson.org/" rel="nofollow noreferrer">arduinojson.org</a> to create a skeleton.</p>

<p>Here is what it generates in your case:</p>

<pre><code>const size_t bufferSize = JSON_ARRAY_SIZE(2) + 2*JSON_OBJECT_SIZE(2) + 70;
DynamicJsonBuffer jsonBuffer(bufferSize);

const char* json = "[{\"sensor\":\"gps1\",\"time\":1351824120},{\"sensor\":\"gps1\",\"time\":1351824120}]";

JsonArray&amp; root = jsonBuffer.parseArray(json);

const char* root_0_sensor = root[0]["sensor"]; // "gps1"
long root_0_time = root[0]["time"]; // 1351824120

const char* root_1_sensor = root[1]["sensor"]; // "gps1"
long root_1_time = root[1]["time"]; // 1351824120
</code></pre>
