How to get the data value in this Json object

35 Views Asked by At

I'm working with Flutterwave API and i just don't know what type of Json is this, because this is my first time working with Json and i want to get the value of "data" to Json map or Object

Thanks

{
"data": {
    "response_code": "02",
    "response_message": "Transaction in progress",
    "flw_ref": "MockFLWRef-1676466720721",
    "order_ref": "URF_1676466720564_5499435",
    "account_number": "0067100155",
    "account_status": "active",
    "frequency": 1,
    "bank_name": "Mock Bank",
    "created_at": 1676466720721,
    "expiry_date": 1676466720721,
    "note": "Mock note",
    "amount": "NaN"
},
   "message": "Virtual account created",
   "status": "success"
}

I want to get "data" value from the Json object to Json map

1

There are 1 best solutions below

0
Daniel Bolajoko On

I'm not sure what you mean by Json map, but you already have an object in your Json response which you can do whatever you want with it. If what you mean by Json map is looping over it through the map function in javascript, then it won't be possible since it returns only an object and not an array of objects. But if what you mean is to convert it to a javascript object, then you can call the JSON.parse() method on you json response.