0

I have below response from an API get call. How do i read the value of dummyId and testcontactId. Below is the sample response:

{
   "pageCount":1,
   "pageIndex":0,
   "pageSize":200,
   "totalCount":1,
   "dto":{
"data":[
     {
            "callDuration":"0:00:07",
            "dummyId":20,
            "testcontactId":"3002",
            "id":54
         }
      ],
      "columns":[
         {
            "fieldName":"test1",
            "displayName":"test Id",
            "show":true,
            "sortable":true,
            "fieldType":"string",
            "order":1
         }
      ]
   }
}

1 Answer 1

1

I can't place a comment to ask what language you're using, Here is how you'd do it in JavaScript

Parse your API Result to a Object with var data = JSON.parse() JSON.parse()

Then you can just go data.dto.data[0].dummyId Since dto.data is an array, You can just use the indexes to access each option. if you need to find specific values, You might want to take a look at Array.find

In the future, Please add a tag with your programming language and things you've tried.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.