I'm migrating EWS Managed api to Graph. When I use EWS Managed API, it has the function UploadItemFts(string folderId, byte[data]). This function helps to move a message(it has all properties) from mailbox X to mailbox Y.
public string UploadItemFts(string folderId, byte[] data)
{
try
{
UploadItem itemToUpload = new UploadItem(_service)
{
ParentFolderId = folderId,
Data = data,
CreateAction = CreateAction.CreateNew
};
var uploadItemResult = _service.UploadItem(itemToUpload);
if (uploadItemResult.Result == ServiceResult.Success)
{
return uploadItemResult.Id.UniqueId;
}
else
throw new Exception(uploadItemResult.ErrorMessage);
}
catch (ServiceResponseException srex)
{
string details = Shared.DumpServiceResponseException(srex);
XLogger.Debug(this, string.Format("ExportMessageFTS >> ServiceResponseException >> {0}", details));
throw new Exception(details);
}
}
public UploadItemsResponse UploadItem(UploadItem item)
{
//XLogger.Audit(this, AuditCategory.Exchange, CommonUtils.GetLocalIPAddress(), "UploadItem({0})".FormatString(item?.Data));
UploadItemsRequest request = new UploadItemsRequest(this, ServiceErrorHandling.ReturnErrors);
request.Items = new UploadItem[] { item };
return request.Execute()[0];
}
I don't see any Graph API to support doing this. Could you guys have any recommendations? Thanks.
Graph does not support
UploadItemsoperation or anything similar. You can try to work with the raw MIME source, but that will miss all MAPI-specific properties that are not mapped to MIME.