Fin user email was sent to

Hi. The email message returned by /conversations/emails/:conversationId/messages/:messageId contains from and to email address, but I would like to find the user and/or external contact that sent or received the message.
How can I do it?

Hi @Vereb_Laszlo

You can use the GET /api/v2/externalcontacts/contacts resource to search external contacts by email or name.

Likewise you can search users with POST /api/v2/users/search with a request body similar to:

{
  "query": [
    {
      "fields": [
        "addresses.email"
      ],
      "type": "EXACT",
      "value": "XXXXXXXX@example.com"
    }
  ]
}

Getting a user with /api/v2/users/:userId the response contains userA@domainA.com email address, but the email message contains a userA@domainB.com email address. They are not the same.

In that case you can replace "EXACT" with "STARTS_WITH" in the user search request body above, and replace the value with the prefix of the email (before the @) to find the matching user

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.