Solved

How to Parse API Response.

Posted on 2013-01-03
1
355 Views
Last Modified: 2013-01-04
Does anyone know a decent way to parse a response that look like this.  Ultimately I'm going to drop it in a database but  could work with it in an array.  there will be multiple groups and subgroups involved.   Any help is greatly appreciated.

[{"name":"AIR CONDITIONER & HEATER","key":"108","htaccess":"air-conditioner---heater-108","groups":
    [{"name":"Condenser, compressor & lines","key":"30128","htaccess":"condenser--compressor---lines-30128","subgroups":
       [{"name":"Check valve ","htaccess":"check-valve--47177","key":"47177"}
        ,{"name":"Clutch","htaccess":"clutch-31529","key":"31529"}
        ,{"name":"Clutch coil ","htaccess":"clutch-coil--46412","key":"46412"}
        ,{"name":"Compressor assy","htaccess":"compressor-assy-31060","key":"31060"}
        ]
      }
     ]
  }
]
0
Comment
Question by:Josh_Blade
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
sognoct earned 500 total points
ID: 38740105
It seems a JSON string, so, if you are developing under framework 4.5 there is the native :
System.Json Namespace

that allows you to parse sentence with :
JsonValue value = JsonValue.Parse(string2parse);

if the framework is 4.0 then you can read this article :
http://www.codeproject.com/Articles/349646/Dynamic-JSON-parser

if the framework is under 4.0 then try :
http://json.codeplex.com/
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question