Skip to main content

I am attempting to query the contacts list api and including a parameter to only get contacts updated in the last 3 days.   

I understand how to construct the UNIX time stamp (I think.)

My question is when I do the curl command below and update a single contact in our testing instance of Front I get back all contacts no matter the updated_at date.  Am I misunderstanding how the q works and should I only get a list of the ones that have been updated?

curl --request GET \
--url 'https://api2.frontapp.com/contacts?q=\qupdate_after\]=1679933002.000' \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'

Result for contact when it has not been updated

"updated_at": 1679932512.707,

Result for contact after I update it

"updated_at": 1679933920.514,

In both cases I am still getting a list of all contacts.

Hi Tom,

There’s a minor mistake in how you’re using the q query param. You’re setting the value of q to update_after]

What we want to do is set the value of qfupdate_after] to the timestamp. The following snippet should have the effect you’re looking for:

curl --request GET \
--url 'https://api2.frontapp.com/contacts?q\cupdate_after\]=1679933002.000' \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'

Let me know how that goes!


Hi Jason,

Thanks for the reply.

The curl command is updated to

curl --request GET \
--url 'https://api2.frontapp.com/contacts?q\[update_after\]=1679931601.000' \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'

I am still getting back every result including the one I have updated.  Should this be returning only the results that match (in my case 1 match?)


🤦‍♂️ Sorry I didn’t spot this sooner - we have a typo!

 

The param is updated_after, not update_after - I think editing this should fix the issue 🤞


That fixed it.  Thank you.

 

For any future readers make sure to double-check the spelling :)


Reply