Solved

Bad link / page token from Events response

  • 10 December 2022
  • 1 reply
  • 84 views

Badge +2

We're working with a third party company on an integration with our data in Front, and we're hoping to get some support on pagination through the Events API.

 

 I am trying hit the list events endpoint. I am able to make the first request successfully.

In the response, I see

"_pagination": {

"next": "https://api.frontapp.com/events?q=after:2022-08-11T16:05:03.088883Z&page_token=XXX..."

}



However, when I make the request with this link, I run into the following 400 response with this message

"status":400,"title":"Bad request","message":"Query parameter page_token is invalid."

 

I was hoping you might have some insight here?

 

icon

Best answer by Javier - Developer Relations 10 December 2022, 02:51

View original

1 reply

Userlevel 5
Badge +8

It looks like the query parameter is being specified incorrectly.

 

We're expecting a request that looks more like this;

 

  curl '.../events?q\[after\]=1660233903'

 

(that timestamp is the epoch timestamp converted from 2022-08-11 16:05:03 UTC)

 

In query string format, this would look like the following without bracket escaping:

/events?q[after]=1660233903

 

If you also need to include event type filters in your request, it might look like this:

 

  curl '.../events?q\[after\]=1660233903&q\[types\]=inbound&q\[types\]=outbound&\[types\]=out_reply'

 

I hope this is helpful - I think making this change should resolve the error response you're getting right now.

 

--Molly

Reply