API handling when multiple records match query (e.g., duplicate primary e-mail addresses)

Options

Many Constituent API calls that query C360 return an error when multiple Convio records match the request. For example, the getUser API call will return Error Code 8 if I send in e-mail=<email_address> and that email_address exists as 'primary e-mail' in two+ Convio records. (Our installation does not enforce unique primary e-mail addresses, yours might.)

As a result, my offline system can't do anything but report "Sorry, there's an error, there are indeed matches for this e-mail address, but I can't actually return any data at all, including how many matches there were, or the Convio IDs of the records..."

Does anyone know a way for APIs to actually gain useful information in these multiple-record cases, such as a list of the Convio IDs, Member IDs or the like? (For example I wouldn't mind it if the first API returns Error Code 8 and then I invoke a second API to get more information, if something like that would work.)

Tagged:

Comments

  • At present the SRConsAPI:getUser method will return only a single record. As you note, it will throw an error if more than one record matches the primary_email search key.

    The Web Services API will return the list of all users with a matching primary email in response to the followig Query operation:


    select * from Constituent where primaryEmail='test@convio.com'



    Here is an example request:




    <?xml version='1.0' encoding='UTF-8' ?>
    <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
    <soap:Header>
    <Session xmlns='urn:soap.convio.com'>
    <SessionId>e5b1...2010-01-25T18:42:38.631Z</SessionId>
    </Session>
    </soap:Header>
    <soap:Body>
    <Query xmlns='urn:soap.convio.com'>
    <QueryString>select * from Constituent where primaryEmail='test@convio.com'</QueryString>
    <Page>1</Page>
    <PageSize>100</PageSize>
    </Query>
    </soap:Body>
    </soap:Envelope>



    Response:


    <?xml version='1.0' encoding='UTF-8'?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <QueryResponse xmlns="urn:soap.convio.com" xmlns:ens="urnbject.soap.convio.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Record xsi:type="ens:Constituent">
    <ens:ConsId>1001001</ens:ConsId>
    <ens:ConsName>
    <ens:FirstName>John</ens:FirstName>
    <ens:LastName>Doe</ens:LastName>
    </ens:ConsName>
    <ens:UserName>johndoe</ens:UserName>
    <ens:MemberId xsi:nil="true" />
    <ens:CreationDate>2010-01-25T16:55:08Z</ens:CreationDate>
    <ens:ModifyDate>2010-01-25T16:55:08Z</ens:ModifyDate>
    <ensrimaryEmail>test@convio.com</ensrimaryEmail>
    <ens:HomeAddress>
    <enstreet1 xsi:nil="true" />
    <enstreet2 xsi:nil="true" />
    <ens:City xsi:nil="true" />
    <enstate xsi:nil="true" />
    <ens:Zip xsi:nil="true" />
    </ens:HomeAddress>
    </Record>
    <Record xsi:type="ens:Constituent">
    <ens:ConsId>1001002</ens:ConsId>
    <ens:ConsName>
    <ens:FirstName>Jane</ens:FirstName>
    <ens:LastName>Doe</ens:LastName>
    </ens:ConsName>
    <ens:UserName>janedoe</ens:UserName>
    <ens:MemberId xsi:nil="true" />
    <ens:CreationDate>2010-01-25T16:56:28Z</ens:CreationDate>
    <ens:ModifyDate>2010-01-25T16:56:28Z</ens:ModifyDate>
    <ensrimaryEmail>test@convio.com</ensrimaryEmail>
    <ens:HomeAddress>
    <enstreet1 xsi:nil="true" />
    <enstreet2 xsi:nil="true" />
    <ens:City xsi:nil="true" />
    <enstate xsi:nil="true" />
    <ens:Zip xsi:nil="true" />
    </ens:HomeAddress>
    </Record>
    </QueryResponse>
    </soap:Body>
    </soap:Envelope>

  • All of my apps just kick an email to my admin email account when they encounter duplicates. I just include whatever info I was capturing from the user, and go manually dedupe it in the backend. There's no automated way to do it.

Categories