Skip to main content

I am looking to use the Iterable API to get all userId’s in a static list. I can see in the documentation there is a parameter for preferUserId. When I send a request, I get email’s back regardless of if preferUserId is set to true or false. 

 

I am wondering if there is anyway to get back userId’s rather than emails from the api/lists/getUsers endpoint?

https://api.iterable.com/api/docs#lists_getLists_0


here is my example request: 

https://api.iterable.com/api/lists/getUsers?listId=391&preferUserId=true

Hey ​@justinfundrise!

 

Answering from mobile so apologies for brevity. Check out the Export section of the API documentation. It sounds like you might want that list of user IDs to perform some other downstream task, in which case Export CSV or Export JSON should do the trick. 
 

Let me know if that doesn’t work or if you have any follow up questions!


Hi ​@justinfundrise ,

This may not be possible, depending on the project type. For email-based projects, this endpoint will only return email values. For userId-based projects, only userId values will be returned.

For hybrid projects, you can toggle between email and userId with the “preferUserId” field/flag in the request.

If you are exporting user data, as ​@drakeballew mentioned, just keep in mind that you would have to export all users and manually filter down to users who are subscribed to a particular static list. Dynamic lists also don’t reflect on user profiles so this is another limitation to consider.

If your project is email-based, one option is to take the resulting email values and send separate requests to get the corresponding userId values for each user. Alternatively, if you don’t need to manage this with our API, you could export a CSV of the list members from within the app UI and select the userId field for inclusion.

With that said, it sounds like you may be referencing users by userId instead of email outside of Iterable. If that’s the case, it may be worthwhile to connect with your CSM to see how we can better support your flow.


Reply