Which email address is returned?

Hi. I'm trying to determine for sure which email address is returned with the Constituent API. According to the schema it is: “The constituent's primary email address, or the constituent's first active email address if no active email address is marked as primary”. I've run queries to find Constituents with no email marked Primary. What I've found is that for those Constituents, the active email that has the earliest Date Last Modified is what is pulled. This doesn't make sense, but I've tested this with about a half-dozen records, and so far it is consistent. In cases where all the emails have the same Date Last Modified, it picks the first one.

I'm curious to know if anyone else has found this to be true, or is it actually returning the first active email?

Thank you!

RIchard

Comments

  • I'd be curious to hear a response to this one myself.

    We ended up querying the emails endpoint to get all emails so we could more intelligently map them into our system. This is not ideal as we can't do any constituent_code filtering on this endpoint so also need to sift through a lot of cruft to get what we need (querying independently per user is also viable but with volume could prove to be an issue with rate-limiting).