Using 'before' parameter when retrieving responses | Community
Skip to main content
Answered

Using 'before' parameter when retrieving responses

  • December 28, 2022
  • 2 replies
  • 108 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?

Best answer by mathio-tf

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.

View original

2 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14883 replies
  • December 29, 2022

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


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • December 30, 2022

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