Tricky question, mail addresses are not stored directly in the bean. What I can show you is how to retrieve the related mail address though:
{
"session": "{{sessionid}}",
"module_name":"Contacts",
"query": "contacts.id='someId'",
"order_by": null,
"offset": null,
"select_fields": [
"id", "first_name", "last_name"
],
"link_name_to_fields_array": [
{
"name": "email_addresses",
"value": [
"id",
"email_address",
"opt_out",
"primary_address"
]
}
],
"max_result": 1
}
The problem with the query-parameter: it only contains the âwhereâ statement of the query, so itâs not possible to enter joins directly. Instead, you can retrieve related records by using the âlink_name_to_fields_arrayâ.
Technically, it should therefore be possible to retrieve the mail addresses first and then filter for the specific mail to return the contact.
Approach:
{
"session": "{{sessionid}}",
"module_name":"EmailAddresses",
"query": "email_addresses.email_address='demo@example.com'",
"order_by": null,
"offset": null,
"select_fields": [
"id", "email_address"
],
"link_name_to_fields_array": [
],
"max_result": 2
}
â would return the specific emailaddresses-object and its ID. The last step is now to load the related contact too, but I wasnât able to figure out the correct link name. But maybe someone else here is able to help.