Solved

How to Parse API Response.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

11 Experts available now in Live!

Get 1:1 Help Now