More JSON deserializing problems

I’m getting the following JSON back from a service, and I want to insert into a datable in the form of:

2015-01-01, EURAED, 4.424436
2015-01-01, EURAFN, 70.253785
2015-01-01, EURALL, 139.802156
2015-01-01, EURAMD, 572.986119
…and so on

…but my deserialization goes all to hell, and I am unable to read the items within the “quotes” node.

Any help appreciated.

{
  "success": true,
  "terms": "https:\/\/currencylayer.com\/terms",
  "privacy": "https:\/\/currencylayer.com\/privacy",
  "historical": true,
  "date": "2015-01-01",
  "timestamp": 1420156799,
  "source": "EUR",
  "quotes": {
    "EURAED": 4.424436,
    "EURAFN": 70.253785,
    "EURALL": 139.802156,
    "EURAMD": 572.986119,
    "EURANG": 2.155656,
    "EURAOA": 124.139616,
    "EURXCD": 3.254155,
    "EURXDR": 0.833236,
    "EURXOF": 655.845239,
    "EURXPF": 119.000977,
    "EURYER": 258.938434,
    "EURZAR": 14.006163,
    "EURZMK": 6327.855119,
    "EURZMW": 7.731093,
    "EURZWL": 388.308881
  }
}

-Jeppe

You there, @Yoichi ? :slight_smile:

@jjes
have a look here as it is close to your case:

2 Likes

Beautiful, thank you!!

1 Like

Jesus, stuck again, how about this then?

{
  "success": true,
  "terms": "https:\/\/currencylayer.com\/terms",
  "privacy": "https:\/\/currencylayer.com\/privacy",
  "timeframe": true,
  "start_date": "2010-03-01",
  "end_date": "2010-04-01",
  "source": "USD",
  "quotes": {
    "2010-03-01": {
      "USDAED": 3.67275,
      "USDAFN": 47.758215,
      "USDALL": 102.842679,
      "USDAMD": 385.323434,
      "USDANG": 1.791  
    },
    "2010-03-02": {
      "USDAED": 3.672775,
      "USDAFN": 47.677,
      "USDALL": 102.45282,
      "USDAMD": 384.573904,
      "USDANG": 1.791
    },
    "2010-03-03": {
      "USDAED": 3.672775,
      "USDAFN": 46.179602,
      "USDALL": 101.645562,
      "USDAMD": 382.005417,
      "USDANG": 1.791
    }
  }
}

HAHAAA!!!

I figured it out. Crashing on the couch in 10 secs, will post solution when I wake up.

…not so much for you crazy Ninja-people, but for other white-belted folk out there :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.