NodeMCU (Arduino IDE) 'DynamicJsonBuffer' was not declared in this scope
This error is caused by using a 6.x.x version of the ArduinoJson library with code that was written for a pre-6.x.x version of the library.

You have two options to solve the problem:

A. Downgrade the library to a version that is compatible with your code

For now, this is probably the best option because the 6.x.x version of the ArduinoJson is still in beta so it makes sense to wait until the new API is stabilized before porting your code. This is even recommended by the ArduinoJson developers:

https://arduinojson.org/v5/faq/error-jsonbuffer-was-not-declared-in-this-scope/


Sketch > Include Library > Manage Libraries...
Wait for the download to finish.
In the "Filter your search..." box, type: "arduinojson".
Click on "ArduinoJson by Benoit Blanchon".
From the "Select version" dropdown menu, select "Version 5.13.2".
Click "Update". Wait for the update to finish.
Click "Close".


Now your code will compile. If you have File > Preferences > Check for updates on startup enabled, you will continue to get updatable library notification for the ArduinoJson library but you need to refrain from updating back to a 6.x.x version or the error will come back.

B. Update your code to be compatible with the 6.x.x version of the ArduinoJson library

In this case you need to modify your deserialization code to use the new DynamicJsonDocument instead of the old DynamicJsonBuffer:

if (httpCode == 200) {
  // Parsing
  const size_t bufferSize = JSON_OBJECT_SIZE(1) + 50;
  DynamicJsonDocument jsonDocument(bufferSize);
  DeserializationError error = deserializeJson(jsonDocument, http.getString());
  if (error) {
    Serial.println("There was an error while deserializing");
  }
  else {
    JsonObject root = jsonDocument.as&lt;JsonObject&gt;();
    // Parameters
    int Mode = root["mode"]; // 1
    Serial.print("Name:");
    Serial.println(Mode);
  }
}


You can get more details about this here:

https://arduinojson.org/v6/doc/upgrade/