Solved

How to Parse API Response.

Posted on 2013-01-03
1
347 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
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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now