Bryan Bryan - 1 year ago 73
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
with js

Answer Source
var data = JSON.parse(apiResponse);

var phoneNumber = data.phoneNumber;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download