Pradeep Rawat

Pradeep Rawat

  • NA
  • 286
  • 8.5k

how to get the value from Deserialized data

Nov 7 2020 12:22 AM
HI, i am trying to retrieve data from API but i am unable to get the data(billFetchId, context), i have metioned Data formate below as well tried code with output.(screenshot inside zip file)
 
//Api data //
"data": {
"billFetchId": "hUQhddsk5UpaFL",
"context": "eyJjdXN0b2dsafdsafdsfdsafiAiTG9hbiBOdW1iZXIiLCAidsfsdafxGZXRjaElkIjogImhVUWhkU0xGazVdsf"
},
"statusCode": "success",
"statusMessage": "API is successful"
  1. //Tried code//  
  2. var billerserializes = new System.Web.Script.Serialization.JavaScriptSerializer();  
  3. var billerdata = billerserializes.Serialize(billfetchrequest);  
  4. var billerresponse = webClient.UploadString(url, billerdata);  
  5. BillFetchRequest2 billfetchrequest2 = new BillFetchRequest2();  
  6. billfetchrequest2 = billerserializes.Deserialize<BillFetchRequest2>(billerresponse);  
  7. public class BillFetchRequest2  
  8. {  
  9.     public object data { getset; }  
  10. }  

Attachment: Pspldata.zip

Answers (6)