Microsoft Graph Api Passing special characters as encoded string

Soumya Banerjee 126 Reputation points
2024-01-01T09:23:13.9266667+00:00

I am trying to fetch some emails based on internetmessageid. However "+" the plus symbol/special character is not getting passed as it is and is getting rendered as a space when sending as encoded. For example I have this as an example internetmessageid:- 'CA+Z2W6fgjsE0--ExX98Pr=******@mail.mymail.com' . Now when am passing it encoded/doublencoded, the rest of the string is rendered properly, however the "+" is getting considered as a blank space. Hence not able to fetch certain emails. I have tried passing it as %2B and also as %252B and as %2b. It's just not accepting "+" at all. Kindly suggest me a solution.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,309 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Md Asif Muztaba 325 Reputation points Microsoft External Staff
    2024-01-02T00:51:56.0066667+00:00

    The Microsoft Graph API does not support the plus (+) symbol in the UserPrincipalName (UPN) in the email. The allowed characters for UPN are A - Z, a - z, 0 - 9, ’ . - _ ! # ^ ~.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.