exporting contacts of outlook into excel/sharepoint using outlook add in - outlook

I am working in a project where i have to access outlook contacts and have to give specific domain-name and export into sharepoint list or excel sheet .
i wonder if outlook REST api be usefull to access contacts and if accessible will i be able to compare the inputted domain name with other contacts in outlook and export through a click in excel .
is there any other way i can do this project using "add in" only
please note:-(yes there are many ways we can export the excel sheet and all but i want to automate this thing using an "add in")

Outlook web add-ins work under the context of currently selected item in Outlook only. To access other item you may consider using Microsoft Graph API which is a RESTful web API that enables you to access Microsoft Cloud service resources.
See Outlook personal contacts API overview for more information about contacts API.

Related

Listing All Emails in Inbox by Outlook Web Addin

I am able to get details of previewed email by this JavaScript command:
console.log(Office.context.mailbox.item);
But I need to list all emails in the inbox (not only previewed one) by using Office JS, is it possible, if so how can I do it? (Its also okay receiving details from specified ID or e-mail number, if possible.)
Thanks!
No, it is not possible. Office web add-ins work under the context of currently selected item in Outlook only. If you need to access other items in the user's mailbox I'd suggest using Graph API, see Outlook mail API overview and Authorize to Microsoft Graph with SSO for more information.
Also you don't forget that VSTO based add-ins allows dealing with all items in Outlook stores. See Walkthrough: Create your first VSTO Add-in for Outlook for more information.
Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: “Type: product feature request” at https://aka.ms/M365dev-suggestions .

access contacts in outlook using Script lab

can Oauth be used in script lab(custom made) for authentication and can it be used to access and fetch outlook contacts ?
if yes then how is it possible ?
Outlook web add-ins work under the context of currently selected item in Outlook. So, the ScriptLab add-in was developed for playing with APIs for the current item (OfficeJS) and getting sample pieces of code. If you need to access other items/contacts I'd suggest using MS Graph API instead or EWS (discontinued with a time) as well as Outlook REST API.

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

How to upload outlook attachments to a web service using outlook add-in (Office add-in)?

I have a Outlook Add-in developed using VSTO,that among other features allows a user to select attachments from an email and then upload it to a website. The uploading is done by calling an web-service that resides on the website. I want to convert the VSTO add-in to a Office add-in for making the add-in available on platforms other than Windows. I was searching how this can be achieved. As per the SO post here, Access to the attachment in Outlook web add-in, Outlook Add-in cannot pass the attachments of a selected item directly to the remote service that runs on your server. Instead, the add-in can use the attachments API to send information about the attachments to the remote service. The service can then contact the Exchange server directly to retrieve the attachments.
My clients do not use an Exchange server. If Outlook Add-in cannot pass the attachments directly, I need to download the attachments to a temporary folder on the user's machine and then upload it to the web service from the outlook add-in. Is this possible ? Is there any other alternative to achieve what I want ?
I need to download the attachments to a temporary folder on the user's machine and then upload it to the web service from the outlook add-in. Is this possible ?
This is exactly what I do. Get the path to a folder like Roaming with
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) //C#
download the attachments, encode them, create a json object and send them to your service.
This is the most convenient solution imo
As per this link, Office Add-ins are not supported for Outlook using POP or IMAP accounts.
Requirements for running Office Add ins
I am pasting below the relevant text from the article.
This is unfortunate. This means there is no way to provide customized solutions in Outlook for the following use-cases.
Outlook on Mac or IPad with a POP or an IMAP email account.

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/

Resources