AnsweredAssumed Answered

Not Working : Search Contacts or Accounts using emailaddress (any email, not just primary email)

Question asked by Stéphane Zanoni on Mar 20, 2015
We are trying to query contacts using any email address and using following query:
https://MySugarUri/rest/v10/Contacts&filter[0][email_addresses.email_address]=test@email.com
It returns the record, only if the email address is the primary address. Also, email2 is not getting populated here. So, can't use email1, email2 to query. Here is the response -
 "email": [                {
                    "email_address": "test@email123.com",
                    "primary_address": true,
                    "reply_to_address": false,
                    "invalid_email": false,
                    "opt_out": false
                },
                {
                    "email_address": "test01@email123.com",
                    "primary_address": false,
                    "reply_to_address": false,
                    "invalid_email": false,
                    "opt_out": false
                },
                {
                    "email_address": "test03@email123.com",
                    "primary_address": false,
                    "reply_to_address": false,
                    "invalid_email": false,
                    "opt_out": false
                }
            ],
            "email1": "riva02@email123.com",
            "email2": "",
            "invalid_email": false,
            "email_opt_out": false,
            "email_addresses_non_primary": "",



If the email address is not primary, we get :
{    "next_offset": -1,
    "records": []
}

Same is the case for Accounts as well. However, it works fine for Users.

Outcomes