I am trying to automate the extraction of data from Xero into my azure db, and have set up the authentication flow to get and refresh tokens via the key vault etc.
However when it comes to calling various API's via a web activity, I run into issues if trying to use the "If-Modified-Since" header. The xero endpoint simply returns an error as below
But when I remove the If-Modified-Since header, everything works fine. I have also tested the url in Postman and it works fine.
I have tried multiple date formats, utcnow(), getpastdate(), wrapping it all in a string etc etc, and they all fail. I know it will be something simple, but cant work it out!
Below is the call i am making
{
"url": "https://api.xero.com/api.xro/2.0/Invoices?includeArchived=false&unitdp=2&Page=1",
"method": "GET",
"headers": {
"Authorization": "Bearer xxxx",
"xero-tenant-id": "xxx",
"If-Modified-Since": "2021-06-01"
}
}
Thank You Greg for pointing me in the right direction. I had come across that post, but assumed as the Xero staff had replied, saying that they accept many formats, and it was an old post, it was no longer relevant! The working code i have in adf is
@concat(getPastTime(1,'Day','ddd, dd MMM yyyy hh:mm:ss'),' GMT')