ews-java-api icon indicating copy to clipboard operation
ews-java-api copied to clipboard

Tasks for other users using EWS Java API

Open nshowkath opened this issue 11 years ago • 2 comments

With the EWS JAVA API I can only create tasks for the signed in user and also the REST APIs don't support tasks. I couldn't find a way to create tasks for other users. Is there any way to create tasks for other users using EWS Java API?

I have seen one workaround over internet for EWS .net Managed API, "You would need to create the tasks in the "assigned" user's Task folder. That would require that the signed-in user have delegate access { Delegate access and EWS in Exchange : https://msdn.microsoft.com/EN-US/library/office/dn641957(v=exchg.150).aspx } to the assigned user's Task folder, or you'd need to consider using an app-only token to get access to all users' mailboxes. " , if this workaround works for java api , can you provide sample .

Thanks, Showkath.

nshowkath avatar Oct 08 '15 06:10 nshowkath

Hi ,

I could able to solve problem by writing below code .

                              FolderId parentFolderId = null;
            List<String> assignees = new ArrayList<String>();
            assignees.add("[email protected]");
            assignees.add("[email protected]");
                            assignees.add("[email protected]");
            for (int index = 0; index < assignees.size(); index++) {
                Mailbox mailbox = new Mailbox(assignees.get(index));
                parentFolderId = new FolderId(WellKnownFolderName.Tasks, mailbox);
                task.save(parentFolderId);
                //To be verify - for each user - how is response            

            }

Hope this helps.

Regards, Showkath.

nshowkath avatar Oct 15 '15 05:10 nshowkath

I think above approach misleads to self-task creation in their inbox as I have used impersonating users inbox , so this is not right approach for "How can one user assigning task to other user in O365 "

nshowkath avatar Nov 12 '15 06:11 nshowkath