How to Add the email id with special characters (includes # $ ' etc) in a collection, in microsoft perview ?

Casepoint Developer 66 Reputation points
2023-12-08T07:44:08.6966667+00:00

I have created a case and a collection in Microsoft Purview. Now I have to add an email as additional sources for a particular collection. The email contains special characters such as (# , $ , ' etc.). If we are calling the API with the exact email , The API response is "Invalid Email". If we encode email using HTTP Utility encoding. The email is added successfully. But No items are collected. If we observe collection parameters in the particular collection, the exchange email is shown in encoded form, Not decoded form.

API call :

https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases/{Case id}/searches/{Search id}/additionalSources

Request Body:

{

    "@odata.type": "microsoft.graph.security.userSource",

    "email": "abc#_t#@abc.co",

    "includedSources": "mailbox"

}

API response if we don't encode the email :

{

    "error": {

        "code": "BadRequest",

        "message": "Invalid email."

    }

}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,028 questions
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,386 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Debarchan Sarkar - MSFT 1,131 Reputation points Microsoft Employee
    2024-01-26T05:28:14.8+00:00

    From your description, it appears there might be a challenge with how encoded emails are handled on the Microsoft Purview side, particularly when it comes to decoding those emails for use in collections.

    Indeed, URL encoding is a standard practice for handling special characters in URLs or API calls. However, if Purview isn't correctly decoding the email addresses before using them, it could lead to issues as you've described. If emails are not being decoded automatically by Purview, and this is causing collection failures, this may be a more complex issue that requires direct support from Microsoft. While I would recommend reaching out to Microsoft Support for further assistance, here's a potential workaround:

    • Preprocess Email Addresses: Before adding them to your case, you could preprocess your email addresses to replace special characters with equivalent acceptable characters. For example, replacing '#' with 'HASH', '_' with 'UNDERSCORE', etc. This way, you're avoiding the encoding-decoding problem altogether.

    Remember, this is a workaround and might not be feasible depending on your specific requirements or the volume of email addresses you're dealing with. Therefore, contacting Microsoft Support might still be the best course of action.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.