The get function returns a string used to extract data from the CiaoData object. CiaoData could contains more than one information and all of these informations are accessible trought the index parameter. Data and informations extracted and the index number depends on how the specified connector is implemented. See Connectors to know the meaning of each index.
NoteCiaoData for an XMPP connector is usually composed by an id (index "0"), a sender (index "1") and the message (index "2"). To extract this information you can follow the example steps.
String id = data.get(0);
String error = data.get(2);
Serial.println("Error:" + error);
Written by arduino.org