Here are the 10 official examples of ArduinoJson. They are available in the "Examples" menu of the Arduino IDE.

deserializeJson(doc, input);
const char* sensor = doc["sensor"];
long time = doc["time"];
double latitude = doc["data"][0];
double longitude = doc["data"][1];
JSON Parser

This example shows how to deserialize a JSON document with ArduinoJson.

View example
StaticJsonDocument<200> doc;
doc["sensor"] = "gps";
doc["time"] = 1351824120;
serializeJson(doc, Serial);
JSON Generator

This example shows how to generate a JSON document with the ArduinoJson library.

View example
deserializeMsgPack(doc, input);
const char* sensor = doc["sensor"];
long time = doc["time"];
double latitude = doc["data"][0];
double longitude = doc["data"][1];
MessagePack parser

This example shows how to parse a MessagePack input with ArduinoJson.

View example
client.println("GET /example.json HTTP/1.0");
client.println("Connection: close");
client.println();
client.find(endOfHeaders);
deserializeJson(doc, client);
JSON HTTP Client

This example shows how to parse a JSON document in an HTTP response. It uses the Ethernet library, but can be easily adapted for Wifi.

View example
udp.beginPacket(remoteIp, remotePort);
serializeJson(doc, udp);
udp.println();
udp.endPacket();
JSON UDP Beacon

This example shows how to send a JSON document to a UDP socket. It uses the Ethernet library but could easily be changed to support Wifi.

View example
client.println("HTTP/1.0 200 OK");
client.println("Content-Type: application/json");
client.println();
serializeJsonPretty(doc, client);
client.stop();
JSON HTTP Server

This example shows how to implement an HTTP server that sends JSON document in the responses.

View example
File file = SD.open(filename);
deserializeJson(doc, file);
file.close();

config.port = doc["port"] | 2731;
JSON Configuration File

This example shows how to store your project configuration in a file. It uses the SD library but can be easily modified for any other file-system.

View example
long time = obj[String("time")];
obj[String("time")] = time;
String sensor = obj["sensor"];
sensor = obj["sensor"].as<String>();
String objects and ArduinoJson

This example shows the different ways you can use String objects with ArduinoJson.

View example
long time = obj[F("time")];
obj[F("time")] = time;
obj["sensor"] = F("gps");
obj["sensor"] = serialized(F("\"gps\""));
Flash strings and ArduinoJson

This example shows the different ways you can use Flash strings (PROGMEM) with ArduinoJson.

View example
StaticJsonDocument<200> filter;
filter["list"][0]["dt"] = true;
filter["list"][0]["main"]["temp"] = true;

deserializeJson(doc, input, DO::Filter(filter));
Filtering

This example shows how to filter a large input to keep only the relevant fields.

View example