Bryan Bryan - 17 days ago 5
Javascript Question

How to get certain data from json give by the api

How do I clasify the data in json given by the api with js.

The data given by the api :

{ "referenceNumber" : "55f97f3be4b0503165e858c5", "phoneNumber" : "7877599999", "amount" : 15.00, "transStatus" : "COMPLETED", "responseStatus": { "status" : "SUCCESS", "statusDescription" : "The request is successful." } }


I want to receive the number from
phoneNumber
with js

Answer
var data = JSON.parse(apiResponse);

var phoneNumber = data.phoneNumber;
Comments