Outlook API: Receiving 'ErrorIrresolvableConflict' when trying to send Draft

寵の児 提交于 2020-01-24 15:46:06

问题


When trying to send a draft, I receive an error:

"ErrorIrresolvableConflict","message":"The send or update operation could not be performed because the change key passed in the request does not match the current change key for the item., Item could not be saved because conflicts were detected when saving.

The message seems to send later when trying in a sandbox.


回答1:


I fixed this by inserting a timeout between the creation of the draft and sending the draft. Essentially, race condition issues.




回答2:


while send email using office365, below code is added for to get searchkey to get thread id in future use (if thread id not generated), this code gives error - "The send or update operation could not be performed because the change key passed in the request does not match the current change key for the item", if I attach bigger file in size more than 3 MB.

FileAttachment fileAttachment = new FileAttachment( "C:\\send_files\\100 Percent 
Automated Support - NCUCCC.pdf" );// 4.6MB file attached
AttachmentId attachmentId = service.createAttachment( fileAttachment, messageId );
messageId.setChangeKey( attachmentId.getRootItemChangeKey() );

FileAttachment fileAttachment1 = new FileAttachment( "C:\\send_files\\getting-started-with-hadoop-planning-guide.pdf" );// 3.1MB file attached
AttachmentId attachmentId1 = service.createAttachment( fileAttachment1, messageId );


messageId.setChangeKey( attachmentId1.getRootItemChangeKey() );
messageFromDrafts = service.getMessage( messageId );
searchKey = messageFromDrafts.getSearchKey();
service.send( messageId );

below code works fine to send email with attachment of bigger size files. so better use this code to send email with attachment of bigger files.

ItemInfoResponse response = service.send( messageId );

below 3 MB file size as attachment is not giving any issue



来源:https://stackoverflow.com/questions/43105115/outlook-api-receiving-errorirresolvableconflict-when-trying-to-send-draft

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!