api icon indicating copy to clipboard operation
api copied to clipboard

Receiving 'Invalid Parameter' for a valid rfc-3339 date using filter[since]

Open robase opened this issue 3 years ago • 2 comments

Hitting issues when attempting to filter transactions from the /transactions endpoint by date using filter[since] with a timestamp that has a positive timezone offset.

running:

curl https://api.up.com.au/api/v1/transactions \
  -G \
  -H 'Authorization: Bearer <token>' \
  -d 'filter[since]=2022-09-14T10:23:50+10:00'

returns:

{
  "errors": [
    {
      "status": "400",
      "title": "Invalid Parameter",
      "detail": "invalid date-time value (must be rfc-3339)",
      "source": {
        "parameter": "filter[since]"
      }
    }
  ]
}

This example uses a date value from an example provided in the docs

The param works fine if using Z or a negative offset e.g -10:00 does work but +10:00 doesn't

robase avatar Sep 17 '22 02:09 robase

I'm also running into this issue. Seems to be an issue with the encoding of the '+' character - seems to be incorrectly url encoded as %2 instead of %2B. If a already encoded url is shot through with %2B, this works fine, but if a raw + is sent it is being incorrectly interpreted.

joshsimonis avatar Sep 20 '22 03:09 joshsimonis

I'm still seeing this issue with the API today.

https://api.up.com.au/api/v1/transactions?filter[since]=2023-08-01T00:00:00%2B10:00 works.

https://api.up.com.au/api/v1/transactions?filter[since]=2023-08-01T00:00:00+10:00 fails with the same error as above.

mcclown avatar Aug 08 '23 07:08 mcclown

This can be surprising but query params do need to be correctly URL Encoded. We've tried to call this out in the docs at the end of the Query Parameters section.

Screenshot 2024-03-20 at 5 09 45 PM

markbrown4 avatar Mar 20 '24 06:03 markbrown4