Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
POST /me/translateExchangeIds
POST /users/{id|userPrincipalName}/translateExchangeIds
Request headers
Name
Value
Authorization
Bearer {token}. Required.
Request body
Parameter
Type
Description
inputIds
String collection
A collection of identifiers to convert. All identifiers in the collection MUST have the same source ID type, and MUST be for items in the same mailbox. Maximum size of this collection is 1000 strings.
sourceIdType
exchangeIdFormat
The ID type of the identifiers in the InputIds parameter.
targetIdType
exchangeIdFormat
The requested ID type to convert to.
exchangeIdFormat values
Member
Description
entryId
The binary entry ID format used by MAPI clients.
ewsId
The ID format used by Exchange Web Services clients.
immutableEntryId
The binary MAPI-compatible immutable ID format.
restId
The default ID format used by Microsoft Graph.
restImmutableEntryId
The immutable ID format used by Microsoft Graph.
The binary formats (entryId and immutableEntryId) are URL-safe base64 encoded. URL-safeness is implemented by modifying the base64 encoding of the binary data in the following way:
Replace + with -
Replace / with _
Remove any trailing padding characters (=)
Add an integer to the end of the string indicating how many padding characters were in the original (0, 1, or 2)
Response
If successful, this method returns 200 OK response code and a convertIdResult collection in the response body.
Example
The following example shows how to convert multiple identifiers from the normal REST API format (restId) to the REST immutable format (restImmutableEntryId).
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Me.TranslateExchangeIds;
using Microsoft.Graph.Models;
var requestBody = new TranslateExchangeIdsPostRequestBody
{
InputIds = new List<string>
{
"{rest-formatted-id-1}",
"{rest-formatted-id-2}",
},
SourceIdType = ExchangeIdFormat.RestId,
TargetIdType = ExchangeIdFormat.RestImmutableEntryId,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.TranslateExchangeIds.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users translate-exchange-ids post --user-id {user-id} --body '{\
"inputIds" : [\
"{rest-formatted-id-1}",\
"{rest-formatted-id-2}"\
],\
"sourceIdType": "restId",\
"targetIdType": "restImmutableEntryId"\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TranslateExchangeIdsPostRequestBody();
$requestBody->setInputIds(['{rest-formatted-id-1}', '{rest-formatted-id-2}', ]);
$requestBody->setSourceIdType(new ExchangeIdFormat('restId'));
$requestBody->setTargetIdType(new ExchangeIdFormat('restImmutableEntryId'));
$result = $graphServiceClient->me()->translateExchangeIds()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = TranslateExchangeIdsPostRequestBody(
input_ids = [
"{rest-formatted-id-1}",
"{rest-formatted-id-2}",
],
source_id_type = ExchangeIdFormat.RestId,
target_id_type = ExchangeIdFormat.RestImmutableEntryId,
)
result = await graph_client.me.translate_exchange_ids.post(request_body)