How to migrate a function UploadItemFts(string folderId, byte[data]) on ews managed api to graph function

Dung Lee 5 Reputation points
2024-02-02T15:13:25.7+00:00

I'm migrating ews managed api to Graph. When I use EWS Managed API, it has function UploadItemFts(string folderId, byte[data]). 
This function to help 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 to do this. Could you guys have any recommendations?
Thanks.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Microsoft 365 and Office Install, redeem, activate For business Windows
Microsoft Security Microsoft Graph
Developer technologies C#
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Dung Lee 5 Reputation points
    2024-02-05T08:49:41.3333333+00:00

    Nobody know about it?

    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.