When attempting to move a folder using the following endpoint:
Endpoint: https://graph.microsoft.com/v1.0/me/messages/{EmailId}/move
I'm encountering an error when the EmailId parameter contains a "/" symbol. Despite trying to encode the Email ID, the API continues to return an error.
It's important to note that the API works as expected when the Email ID does not contain a "/" symbol.
I have already attempted to encode the Email ID using URL encoding, but the issue persists. Additionally, escaping the "/" character did not resolve the problem.
The API should be able to move the folder regardless of whether the Email ID contains a "/" symbol.
Following is the code (it is working fine if emailId didn't has "/")
using (var httpClient = new HttpClient())
{
string encodedEmailId = HttpUtility.UrlEncode(emailId);
var request = new HttpRequestMessage(HttpMethod.Post, $"https://graph.microsoft.com/v1.0/me/messages/{encodedEmailId}/move");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
request.Content = new StringContent($"{{\"DestinationId\": \"{folderId}\"}}", Encoding.UTF8, "application/json");
var response = await httpClient.SendAsync(request);
string errorMessage = await response.Content.ReadAsStringAsync();
}
Following is the error
{"error":{"code":"RequestBroker--ParseUri","message":"Resource not found for the segment 'vUqoAAAIBDAAAANbsh1sqmahFnro5xH'."}}`