Solved

How to Parse API Response.

Posted on 2013-01-03
1
356 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

717 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