You need to sign in to do that
Don't have an account?

Json String deserialize help needed?
Thanks for Response.
I need one help.
i have json string value. i need to deserialize ths json string.
Json String Get Url:
http://api.crunchbase.com/v/2/organization/google?user_key=f781f4a0a7bedbad9861dd607069fd1b
Please use this url. need to deserialize ths mentioned url json string.
I need one help.
i have json string value. i need to deserialize ths json string.
Json String Get Url:
http://api.crunchbase.com/v/2/organization/google?user_key=f781f4a0a7bedbad9861dd607069fd1b
Please use this url. need to deserialize ths mentioned url json string.
https://developer.salesforce.com/page/Getting_Started_with_Apex_JSON
Try the below codes.
public class HttpCalloutSample {
// Pass in the endpoint to be used using the string url
public String getCalloutResponseContents(String url) {
// Instantiate a new http object
Http h = new Http();
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
HttpRequest req = new HttpRequest();
req.setEndpoint(url);
req.setMethod('GET');
// Send the request, and return a response
HttpResponse res = h.send(req);
return res.getBody();
}
}
String s = HttpCalloutSample.getCalloutResponseContents('http://api.crunchbase.com/v/2/organization/google?user_key=f781f4a0a7bedbad9861dd607069fd1b');
Map<String, Object> m = (Map<String, Object>) JSON.deserializeUntyped(s);
List<Object> pricing = (List<Object>) m.get('pricing');
for (Object o : pricing) {
Map<String, Object> p = (Map<String, Object>) o;
System.debug('>>> ' + p);
}
Thanks
D Naveen Rahul.