I'm fetching product details using an API which gives the response as a JSON object.
{
"productBaseInfo": {
"productIdentifier": {
"productId": "EKTDDD23232zYHR94E4",
},
"productAttributes": {
"title": "Nova KT 72BC 1 Electric Kettle",
"imageUrls": {
"400x400": "http://img5a.flixcart.com/image/electric-kettle/4/e/4/nova-kt-722-c-kt-722c-400x400-imadddh2fdvuzpxz.jpeg",
"75x75": "http://img6a.flixcart.com/image/electric-kettle/4/e/4/nova-kt-722-c-kt-722c-75x75-imadddh2fdvuzpxz.jpeg",
},
"sellingPrice": {
"amount": 599.0,
"currency": "INR"
},
"productUrl": "http://dl.mykart.com/dl/nova-kt-722c-1-electric-kettle/p/itmdddf398rhhhz2?pid=EKTDDDEGXYHR94E4&affid=userid"
}
}
}
Now I want to get the productId, title in ProductAttributes, and all the image urls and productURL. I tried
var productURL = JSON["productAttributes"].productUrl
But it returns an error productUrl not found error. Looking for suggestion on how to extract the data. Thanks in advance.