-4
[
  {
    "docId": "58d8f38cd2f554fdfca4fd18",
    "__v": 8,
    "clinicDetails": {
      "5908e342236dee7e7364698e": {
        "appointmentSlots": {
          "sat": {
            "5908e342236dee7e73646a44": {
              "bookFlag": true,
              "endTime": "07:00PM",
              "startTime": "06:30PM"
            },
            "5908e342236dee7e73646a43": {
              "bookFlag": true,
              "endTime": "06:30PM",
              "startTime": "06:00PM"
            },
.......

full file https://docs.google.com/document/d/1FK1NEY1Vmjzv2gBtleFquA0VMpfYGf9FaMyblPr8vws/edit?usp=sharing

i need to access these ids like 5908e342236dee7e73646a44 before slot details i am using angular for scripting

boy man
  • 111
  • 1
  • 10

1 Answers1

1

var jsonObject = angular.fromJson(yourJsonString)

That will transform your Json to an object. Then you can iterate over any field of the object an get keys or values.

angular.forEach(jsonObject.whatever, function(value, key) {
    console.log('key : ', key);
    console.log('value : ', value);
});

Get key from JSON for API request

boy man
  • 111
  • 1
  • 10