Upload files to OneDrive from outlook desktop client using outlook AddIn without user interaction - outlook

I am developing an Outlook Add-In, that will work in Office365 for both Web version and Desktop client and will able to upload files attached with the email to One-drive. Is it possible to authenticate and upload the files without user interaction(i.e. like opening popup, and providing user id and password etc).
Thanking all for your suggestions in advance.

Yes, Its possible.
What you have to do is :
1) create OutlookAddin solution with help of visual studio template.
2) It will add two projects in that solution OutlookAddin and OutlookAddinWeb.
3) Here OutlookAddinWeb is simple asp.net project that you have to covert into MVC Web API or you can add in new MVC Web API project after removing the existing OutlookAddinWeb.
4) Now,You can Microsoft Graph Client dll to use graph api functionalities to upload file in One Drive.
Note : The important thing you shouldn't forget about implementing authentication using OWIN API that is providing single sign-on as it is your main concern here
samples: https://developer.microsoft.com/en-us/outlook/code-samples

Related

Is there a API endpoint to share elements (files, items, sites, ...) with other users in Sharepoint online and on-premise via REST API (in C#)?

I am required to create a share feature (like the one in Sharepoint or OneDrive) for documents, items and folders, for Sharepoint online and on-premise, in a Xamarin app.
What I have:
Sharepoint REST API.
Xamarin app connected to a Sharepoint online and on-premise server.
Sharepoint content is available in Xamarin app and user can select the option Share item which I have to implement.
What I need:
The logic to implement to be able to create the shareable link and actually share it like the Sharepoint website online does it (check screen shot).
#Mohamed Aloui,
You could have a try the below endpoint to create a sharing link:
/_api/Web/Lists/GetByTitle(‘Documents’)/Items(1)/sharelink
or
/_api/web/GetFileByUrl(#v)/ListItemAllFields/ShareLink?#v='/sites/testsite/Mylib/test.txt'
You can get an example through F12 tool:
Below is a tutorial blog and a similar thread, you may take a reference:
How to create a shared link with an expiration date for the item of OneDrive For Business via Rest API?
https://learn.microsoft.com/en-us/answers/questions/84801/calling-the-sharelink-sharepoint-rest-api-endpoint.html
BR

Is it possible to launch Word 365 in a browser from a web app to edit documents regardless whether the user has an office 365 license?

My local school allows me to log in to their online portal and access an email account using Outlook 365 within the browser, despite the fact I do not have a license for outlook/office 365.
Is it possible to create a web application where users of this app could click a link to edit a document directly in their browser using Word 365, with us/the developers of such app being the licensee of Word and not the end-user? The remote document would be held in a Sharepoint/Webdav capable service.
If this is possible, which MS-technologies should we investigate to develop such a system? Is it the MS-Graph API or something else?
A pointer in the right direction would be greatly appreciated.
Thanks!
You can use the Graph to create a sharing link to a document. But the user will have to sign in to view the document I believe. I'm not sure what licensing they need but you can try this with your users to see.
https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http
You can use the Google Docs API to work with documents stored in Google Drive. If you are using Java there is a "Quickstart" at the following link:
https://developers.google.com/docs/api/quickstart/java

Accessing Appointments in Outlook without ActiveX

I'm currently working on a project where I'm sending and updating Appointsments. I would like to do this without the use of ActiveX since I don't want to be limited to IE. I've been googeling for quite some time now, but I couldn't find anything that helped, so here's my question. Is there any way I can access or update appointments without the use of ActiveX.
We also have access to the OutlookWebApp, so maybe there's an interface there. Would be great if someone had an idea. Thanks in advance and
Greetings Chris
You can use Exchange Web Services (web or desktop app) or the EWS Managed API (desktop app only) to access data in Exchange Mailboxes: https://msdn.microsoft.com/en-us/library/office/jj162981.aspx.
If you are working with Office 365 mailboxes you can use the Outlook REST or Microsoft Graph APIs: https://dev.outlook.com/
If your solution requires a UI in Outlook Online (OWA) then you can access contextual data (i.e. the current email or appointment) with an Outlook Add-in (you can use EWS requests from it as well): https://dev.outlook.com/reference/add-ins/

How to make Office Web App Server able to edit a document with Cobalt

I am trying to build my own WOPI host using ASP.NET MVC and its WebAPI functions according to this example
https://code.msdn.microsoft.com/office/Building-an-Office-Web-f98650d6
I successfully used that example to connect to my Office Web App Server and I can use that to access files of Excel and PowerPoint in local path and I am able to edit it, but I cannot use it to open word document in editing mode as the Post action handler isn't implemented completely without any response so that it cannot handle any edit request.
In order to add support for editing of Office document, I tried this example with POST request handler based on Cobalt library extracted from Office Web App Server.
https://github.com/marx-yu/WopiHost
With this example I managed to edit ans save all kinds of document with Office Web App Server. However, when I tried to integrate these two together I found that even if I can enter the edit window of Excel and PowerPoint and I can see that Post Requests from Office Web App Server like locking and Cobalt are handled by my WOPI Post API action handler. Those change doesn't take any effect on my local file at all. Moreover, I still cannot edit word document and when I checked the back log of Office Web App Server, I found the error message is Cobalt is not supported while I have already set the SupportsCobalt in CheckFileInfo response to true! Any help is very appreciated!
I think I have exactly what you are looking for. Check out my implementation of the WOPI host. It's an MVC6 app that takes the best from the both examples you are referring to and adds some extra features.

How to convert an existing ASP.NET Web API to Azure Mobile Service?

Recently announced at Microsoft Build is the ability to convert an existing ASP.NET Web API to an Azure Mobile Service. I was curious as to if anyone has successfully done this yet, and the steps needed to do so.
Things I've tried thus far:
Added the Azure Mobile Service .NET Backend & Azure Mobile Service -
Entity Framework Nuget Packages to my existing ASP.NET Web API
project.
Resolved an issue with OWIN and AMS(ZUMO) conflicting Startup.cs assemblies.
Ensured the ASP.NET Web API compiles locally, and published as an Azure Mobile Service.
However whenever publishing, it seems I only get a runtime error on the server.
Here was the best example of potentially doing this: http://channel9.msdn.com/Events/Build/2014/3-623
Secondly I've looked a bit into just running the OWIN pipeline via: http://www.strathweb.com/2014/02/running-owin-pipeline-new-net-azure-mobile-services/
I know that this is in a preview mode, but figured some document trail would help!
Can you try adding your existing WebAPI assets to Mobile Services project you create from VS? This will make sure all the right things are wired up. Also, check the Logs tab in the portal for any clues.
This should help..
http://blogs.msdn.com/b/azuremobile/archive/2014/04/10/creating-an-azure-mobile-services-net-backend-from-scratch.aspx
Thanks
Supreet

Resources