title: Retrieve Embedded Keys with ArduinoJSON Parser
body: <p>I'm using this JSON parser, <a href="https://github.com/bblanchon/ArduinoJson" rel="nofollow">https://github.com/bblanchon/ArduinoJson</a>. With the example below, I can retrieve the keys and values just fine. I'm having trouble figuring out how I would get the embedded Keys in the second example.</p>
  
  <p>Example 1:
      #include </p>
  
  <pre><code>const char* sensor;
  long time;
  double latitude;
  double longitude;
  
  void setup()  { 
  
      Serial.begin(115200);
      char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
  
      StaticJsonBuffer&lt;200&gt; jsonBuffer;
  
      JsonObject&amp; root = jsonBuffer.parseObject(json);
  
      sensor      = root["sensor"];
      time        = root["time"];
      latitude    = root["data"][0];
      longitude   = root["data"][1];
  
      for (JsonObject::iterator it=root.begin(); it!=root.end(); ++it)
      {
         Serial.println(it-&gt;key);
      }
  
  } 
  
  void loop()  { 
      // do absolutely nothing
  }
  </code></pre>
  
  <p>Example 1 Output:</p>
  
  <pre><code>sensor
  time
  data
  </code></pre>
  
  <p>How would I get the keys from JSON like this?</p>
  
  <p>Example 2:</p>
  
  <pre><code>#include &lt;ArduinoJson.h&gt;
  
  void setup()  { 
  
      Serial.begin(115200);
      char json[] = "{\"Devices\":[{\"Name\":\"something\",\"ModelNumber\":\"1234\"}]}";
  
      StaticJsonBuffer&lt;200&gt; jsonBuffer;
  
      JsonObject&amp; root = jsonBuffer.parseObject(json);
  
      for (JsonObject::iterator it=root.begin(); it!=root.end(); ++it)
      {
         Serial.println(it-&gt;key);
      }
  
  } 
  
  void loop()  { 
      // do absolutely nothing
  }
  </code></pre>
  
  <p>Example 2 Output:</p>
  
  <pre><code>Devices
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Trying the suggested test:</p>
  
  <pre><code>#include &lt;ArduinoJson.h&gt;
  
  void setup()  { 
  
      Serial.begin(115200);
      char json[] = "{\"Devices\":[{\"Name\":\"something\",\"ModelNumber\":\"1234\"}],\"AnotherKey\":\"itsValue\"}";
  
      StaticJsonBuffer&lt;200&gt; jsonBuffer;
  
      JsonObject&amp; root = jsonBuffer.parseObject(json);
  
      for (JsonObject::iterator it=root.begin(); it!=root.end(); ++it)
      {
         Serial.println(it-&gt;key);
      }
  
  } 
  
  void loop()  { 
      // do absolutely nothing
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Devices
  AnotherKey
  </code></pre>