I am working on retrieving USD -> GBP exchange rates from CurrencyLayer using a C# script task in SSIS. I have used the following code:
string url = Dts.Variables["User::CurrencyLayerURL"].Value.ToString();
WebClient wc = new WebClient();
var jsonString = wc.DownloadString(url);
To successfully retrieve the following JSON string:
{
"success":true,
"terms":"https:\/\/currencylayer.com\/terms",
"privacy":"https:\/\/currencylayer.com\/privacy",
"historical":true,
"date":"2015-11-28",
"timestamp":1448755199,
"source":"USD",
"quotes":{
"USDGBP":0.66527
}
}
However, I am not sure at this point how to retrieve just the 0.66527 value that corresponds to the "USDGBP" rate and pass it to a variable. I have seen a number of suggestions to use the JSON.net library, but I am not able to add any third-party libraries to this project. Any help would be appreciated.