Wrong Error Code With getUser

Options

I'm using getUser as part of an email gathering form. I'm basically just using it to see if the person is already in our database or not. I've found that when I query an email address of which there are multiple in Convio I get Error 16: Record Doesn't exist. What I think I should be getting is something like Error 15 or 11 which denote multiple records found. Any thoughts?

Tagged:

Comments

  • Just so we don't go looking down the wrong path. Am I correct in assuming that you are using the server API? If using the client API, you can only get the user who is logged in.

  • I did quickly look at the code, and you are correct. The getUser will search the database for a matching email and return the consitituent ID if it finds exactly 1 and a not found if it finds 0 or more than 1. There's actually a reason behind this. The general idea is that if you have a situation where multiple records match the email address and it is a new constituent, you don't really have the option to ask him/her which one is correct since that would expose more data than the user has provided and potentially let him steal an identity. You also don't necessarily want to arbitrarily pick one of the records. So the long-standing logic has been that if you have multiples on file already, then this new interaction will create a new constituent record and it is going to be up to the organization to resolve.

    I agree though that in the context of the API, it doesn't make sense to hide this difference from the API user. I'm going to go ahead and enter a bug for this and change it to a more appropriate error that is returned.

  • DavidHart :

    I did quickly look at the code, and you are correct. The getUser will search the database for a matching email and return the consitituent ID if it finds exactly 1 and a not found if it finds 0 or more than 1. There's actually a reason behind this. The general idea is that if you have a situation where multiple records match the email address and it is a new constituent, you don't really have the option to ask him/her which one is correct since that would expose more data than the user has provided and potentially let him steal an identity. You also don't necessarily want to arbitrarily pick one of the records. So the long-standing logic has been that if you have multiples on file already, then this new interaction will create a new constituent record and it is going to be up to the organization to resolve.

    I agree though that in the context of the API, it doesn't make sense to hide this difference from the API user. I'm going to go ahead and enter a bug for this and change it to a more appropriate error that is returned.

    Thanks for that. While I do see what you're talking about, we were hoping to display an error page prompting the person to contact our records managment group concerning the multiples. By adding a seperate error, we can then handle them in either way.

  • I'll try to get the change made in the upcoming release.

Categories