Answered

Using 'before' parameter when retrieving responses

  • 28 December 2022
  • 2 replies
  • 70 views

I am attempting to use the ‘before’ query parameter to filter responses by date using Postman, but am being met with consistent 400 Bad Request responses, with the following body:

"code": "BAD_REQUEST",
"description": "The provided value is invalid.",
"details": [
{
"code": "INVALID_PARAMETER",
"description": "value should be alphanumeric: before",
"in": "QUERY",
"field": "before"
}
]

I have tried several iterations of the value for the ‘before’ parameter including:

2022-11-28T01:01:01Z
2022-11-28T01%3A01%3A01Z
2022-11-28T01:01:01
2022-11-28T01:01:01.001Z
2022-11-28T00:00:00Z

 

Snapshot of formatting from Postman

I am using URL: https://api.typeform.com/forms/{{form_id}}/responses?page_size=1000&before=2022-11-28T01:01:01Z

Am I missing some trick to this?

icon

Best answer by mathio 30 December 2022, 12:51

View original

2 replies

Userlevel 7
Badge +5

Hi @Simplyclose Thanks for stopping by the community! @mathio or @picsoung may be able to help you with this. 

Userlevel 7
Badge +5

Hello @Simplyclose 

as per docs, the before parameter is supposed to be used for pagination and should have a value of token. Eg. if you were to retrieve 3 responses (via page_size=3 parameter) you will receive responses A, B and C sorted by date (A being the latest). Then you can do another request with before=<token-from-response-C> to retrieve responses older than that.

To filter via date and time you can use parameters since and until.

Reply