Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameTypeDescriptionMandatory
BrickIdsGuid[]Filter by array of BrickIds. 
Codesstring[]Filter by array of currency codes. According to ISO-standard 
PriceDateDateTime?Filter by date on the current rate. 
StatusKeysstring[]Statuses 

...

Code Block
languagec#
themeRDark
titleC# - Get EUR/SEK and EUR/USD quotes
linenumberstrue
collapsetrue
//Use the GetCurrencies to retreive EUR/SEK and EUR/USD quotes
var client = new BFSServiceReference.bfsapiSoapClient();

var credentials = new BFSServiceReference.Credentials()
{
    UserName = bfsusername, //Username of administrative user in your instance of BFS
    Password = bfspassword, //Password of the administrative user in your instance of BFS
};

var currency = client.GetCurrencies(new BFSServiceReference.GetCurrencyRequest()
{
    Credentials = credentials,

    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS  

    Args = new GetCurrencyArgs()
        {
            Codes = new []
             {
                "SEK",
                "USD",
            },
            PriceDate = new DateTime(2016,01,11),
        },

    Fields = new BFSServiceReference.GetCurrencyFields()
    {
        BrickId = true,
        Code = true,
        Price = true,
        PriceDate = true,
        StatusKey = true,
    },

});

foreach (var c in currency.Result)
{
    Console.WriteLine(c.BrickId + ";" + c.Code + ";" + c.Price + ";" + c.PriceDate + ";" + c.StatusKey);
}