CurrencyExchangeProviderWorldspanImpl Resource

An API to interact with currency exchange rate services.

GET /currency/getExchangeRatesForDay/{date}

Get all exchange rates for a particular day.

Request Parameters
name type description
date path The day to get exchange rates for.
Response Body
media type data type description
application/json array of ExchangeRate (JSON) All rates for that day.
application/xml list of exchangeRate (XML)

Example

Request
GET /currency/getExchangeRatesForDay/{date}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "date" : 12345,
  "currencyCode" : "...",
  "rate" : 12345.0,
  "id" : 12345,
  "version" : 12345,
  "violations" : [ {
    "propertyName" : "...",
    "failureMessage" : "...",
    "stackTrace" : "..."
  }, {
    "propertyName" : "...",
    "failureMessage" : "...",
    "stackTrace" : "..."
  } ]
} ]
                
              

GET /currency/getExchangeRate/{date}/{code}

Get the exchange rate for a particular day.

Request Parameters
name type description
code path The currency to get the exchange rate for.
date path The day of the exchange.
Response Body
media type data type description
application/json ExchangeRate (JSON) The rate for that currency on that day.
application/xml exchangeRate (XML)

Example

Request
GET /currency/getExchangeRate/{date}/{code}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "date" : 12345,
  "currencyCode" : "...",
  "rate" : 12345.0,
  "id" : 12345,
  "version" : 12345,
  "violations" : [ {
    "propertyName" : "...",
    "failureMessage" : "...",
    "stackTrace" : "..."
  }, {
    "propertyName" : "...",
    "failureMessage" : "...",
    "stackTrace" : "..."
  } ]
}
                
              

GET /currency/convertCurrencyFromDollar/{amount}/{date}/{code}

Convert a currency given the date and the currency from USD.

Request Parameters
name type description constraints
amount path The amount to convert. double
code path The currency to exchange it to.  
date path The date of the exchange.  
Response Body
media type data type description
application/json JAXBDouble (JSON) The amount in the other currency or null if it could not convert.
application/xml JAXBDouble (XML)

Example

Request
GET /currency/convertCurrencyFromDollar/{amount}/{date}/{code}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "Value" : 12345.0
}
                
              

GET /currency/convertCurrencyToDollar/{amount}/{date}/{code}

Convert a currency given the date and the currency to USD.

Request Parameters
name type description constraints
amount path The amount to convert. double
code path The currency to exchange it to.  
date path The date of the exchange.  
Response Body
media type data type description
application/json JAXBDouble (JSON) The amount in USD or null if it could not convert.
application/xml JAXBDouble (XML)

Example

Request
GET /currency/convertCurrencyToDollar/{amount}/{date}/{code}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "Value" : 12345.0
}