When does 'primary_email' actually mean 'primary_email or username'? (Constituent API)

Options

Hello everyone,

Ran into an interesting observation. This involves the getUser method for the Constituent API.

The documentation claims that the parameter

primary_email = the primary email address that uniquely identifies the constituent

http://open.convio.com/api/#constituent_api.getUser_method.html

So, if you send in just primary_email (that is, omit cons_id and omit member_id), you should get back data for the Convio record with the primary e-mail you seek. Fair enough.

I claim that this should read

primary_email = the primary email address or username that uniquely identifies the constituent

What you get back might not be the record with that primary_email address. You might get back the record with that username.

The way this affected me was that I have code that pulls back the Convio record for a user with a particular value in their primary email field, and if there is no such record, is supposed to report Error 8. What I found was that I wasn't getting the Error 8, but that the API was also looking in username to do the match. Therefore, I got back a record whose username was the value I wanted for primary_email, and whose primary_email was something completely different.

It's a subtle but important distinction, unless I'm off my mark, which is also possible.

Tagged:

Categories