Solved

oData API CurrencyRate ValidFrom data format?

  • 2 March 2022
  • 1 reply
  • 292 views

Userlevel 1
Badge +2

Hi, we are using oData Restful API to update currency rates into IFS:

https://domain.ifs.cloud:48080/int/ifsapplications/projection/v1/CurrencyRatesHandling.svc/CurrencyRateSet(Company='601',CurrencyType='1',CurrencyCode='GBP',ValidFrom='2022-03-31')

 

But keep getting this error:

{

    "error": {

        "code": "ODATA_PROVIDER_ERROR",

        "message": "An internal server error occurred. Contact administrator.",

        "details": [

            {

                "code": "INVALID_KEY_VALUE",

                "message": "The key value 'ValidFrom' is invalid."

            }

        ]

    }

}

 

We tried different permutation of date format, including “2022-03-31-00.00.00’, “31-03-22”, /, March, T...00.00.000Z, etc etc… /Date1607xxxxx(unix time_t seconds from 1970.1.1), ... none worked.

 

Please advise what exactly is needed here for Valid From field in oData Dateformat?

Many thanks!

Charles

 

icon

Best answer by charles-cai 3 March 2022, 12:03

View original

This topic has been closed for comments

1 reply

Userlevel 1
Badge +2

OK, it’s this format: just don’t use single quotes around date type, not like other multi-keys which require single quotes, even for integer value:

 

/v1/CurrencyRatesHandling.svc/CurrencyRateSet(Company='601',CurrencyType='1',CurrencyCode='AED',ValidFrom=2022-03-01)