java - Get value of second JSON node on same level -


hello have json like:

 {     "status": {         "code": 200,         "name": "name",         "description": "login success."     },     "message": "login success.",     "data": {         "att_ticket": "ticket_0625172f00ae7737bbab3c558c877b046e6b23ba",         "ktk_session_id": "735efe0e9af14eee3aa5839cbc609e66"     }  } 

i able read status name when try read data attribute att_ticket get

jsonobject("data") not found. 

the code using is:

string attticket=object.getjsonobject("data").getstring("att_ticket"); 

thanks!

for getting att_ticket should work:

jsonobject obj = new jsonobject(clientstring);  jsonarray params = obj.getjsonarray("data"); jsonobject param1 = params.getjsonobject(); string ticket = param1.getstring("att_ticket") 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -