reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

Contact Email address doesn't match when applying an email filter to Contacts endpoint #5565

Closed stebrough closed 2 years ago

stebrough commented 2 years ago

Describe the bug When applying the "email" filter against the "/contacts" endpoint, a single contact is returned but with a different email address.

To Reproduce

  1. Call /contacts with a specific email address (Please contact me for the email address and account in question)

Expected behaviour The contact returned has the email filtered for.

Specification

"additionalContactDetails": [
{
    "type": "Business Email",
    "value": "email@email.com"
},
{
    "type": "Business Telephone",
    "value": "020 000 1112"
}]
plittlewood-rpt commented 2 years ago

Hi @stebrough - I suspect this is happening because the platform API contract only exposes a single email address on a contact, however it is possible to assign more than one email address to a contact in AgencyCloud. As a result there is a chance, where a contact has multiple email addresses in AgencyCloud that the one you are searching for is a secondary email address, so it looks like your results are inaccurate.

plittlewood-rpt commented 2 years ago

Hi @stebrough - thanks for sending me the detail for this ticket, I can confirm that what I've suggested above is accurate. We need to investigate this further and see if there is something we can do to make this a nicer experience for developers. The results you get are accurate in the fact that the contact you get back does have that email address assigned to them, but obviously it doesn't look like that in the API output. It will boil down to whether or not there's an appropriate way to model the additional contact details (where the number and types are not known from resource to resource) in a standard way, which is what we need to be able to do in the Platform APIs.

designreact commented 2 years ago

I have a related issue.

We have an external dataset that contains emails which are in reapit but sometimes set to "Business" rather than "Email".

We use the Email address from the Reapit contact to look up data in our dataset. Where we have data set against "Business" emails we are unable to match up the results.

something like the following in the response would be great:

otherEmails: [{
  type: 'Business'
  value: 'someone@businessemail.com'
}]

... or perhaps otherEmails should be "contactDetails" containing an array of all the details added?