api
api copied to clipboard
Receiving 'Invalid Parameter' for a valid rfc-3339 date using filter[since]
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
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.
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.
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.