Cannot retrieve contacts in a segment using API v3

Hello all,

I am trying to retrieve the contacts inside a specific segment. I am using the https://youraccountname.api-us1.com/api/3/contacts end point with segmentid parameter. I’ve went over an old post which discussed that the call has to be made twice. This is also clearly stated in the documentation. However I can’t get it to work.

I have seen a StackOverflow post discussing something similar.

I have tried using Postman, Paw and Python requests. All calls to this endpoint with the segmentid param set, return all the contacts. Has anyone figured out a way to use this?

Thanks!

Hello Elias,

Depending on the size of the list you are segmenting and/or the number of contacts that match the segment, it may take some time before the correct contacts are reflected with the segmentid parameter.

If you are still continuing to experience this issue I would recommend contacting our support team with your account name and full details on what you’re trying. They can provide further insight and help troubleshoot account-specific issues.

Thank you,
-Matt

1 Like

This answer doesn’t help.

I’ve run this query for 5minuts / 60times now, one after another. The answer is always the same: “contacts”: [] , “waiting”: true.

The only things changing on every request are the “run_id” and “memq.prefix” … looks like it’s starting a new query on each request instead of returning thre results of former querys. … just guessing

( contacted support already :crossed_fingers: )

I finaly figured this out on my own.

First and foremost: You need to perserve Cookies between the API Calls.
( Afaik no ServerSide HttpClient does this by default and an API that behaves statefull is quite ucommon, imo. )
Sadly this not documented.

Second: Don’t trust “the second call”. Sometimes - when the API is fast or the query slow - it’s the 3rd or even 4th call. You need to perform a do-while loop until waiting is false. (Not documented, too.)

But the next issue is right arround the corner.
Now, having this up and runngin, it seems that currently (at least) the listid and status filter is ignored when using segmentid. :frowning:

still in contact with Support

to be continued …