One drive business is not supporting embedding excel files. but i have a strong requirement to do so. in this example they explain how to do it manually using the classic one drive interface. is there anyway i can do it through coding ?
graph client snippets this is the line to get a share link
Permission permission = await graphClient.Me.Drive.Items[id].CreateLink("view", "organization").Request().PostAsync();
but only view and edit is available. i tried adding " &action=embedview" to the url end but it also not working. anyone have any idea how to achive this ?
and also how to generate the preview link from this
Permission permission = await graphClient.Me.Drive.Items[id].Preview("",100).Request().PostAsync();
this says cannot convert item preview info to permission.
Thank you in advance
The &action=embedview is not supported by the Graph. The following pic show the suppoted value.
Note: Not all Graph API can be access by the Graph Client Library.
this says cannot convert item preview info to permission.
For this, you need to use such Preview preview but not the Permission permission. They are not the same type. On my side, I don't have the Preview method, so we maybe not use the same version Graph Client Library.
Related
I have been looking into connecting a Word Add-in to SharePoint list data using a task pane.
I have completed the following two tutorials that guide you through creating an add in that uses SSO to access user data and then update the add-in to get data from one drive instead.
https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/sso-quickstart
https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/sso-quickstart-customize
However, these tutorials have you edit the .ENV file with a new GRAPH_URL_SEGMENT and SCOPE etc, however I see no reference to how editing the ENV would actually effect anything, no code that makes use of this information and no details of when the call using the Graph api is actually made and what configuration it uses.
I have been able to get a call working to SharePoint in the graph explorer but cannot move that over to the word add-in.
Could someone please help me understand where the calls endpoint is used to make the Graph call and how someone would go about to change this to make a call to SharePoint.
The call to get Microsoft Graph data is in the library office-addin-sso. Specifically, the files \node_modules\office-addin-sso\src\app.ts and \node_modules\office-addin-sso\src\authRoute.ts
You will see in those files where the ENV variables are read.
To get your SharePoint data, use the URL you constructed in the Graph Explorer to set the GRAPH_URL_SEGMENT and the QUERY_PARAM_SEGMENT in the ENV file. Also, update the SCOPE variable in that file as needed. See the section https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/sso-quickstart-customize#changes-required-for-any-type-of-add-in for an example.
You will also need to update the permissions you request in the Azure portal as described in this section: https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/sso-quickstart-customize#update-app-permissions-in-azure
The task is to write a code that applies a sensitivity label to a document in a SharePoint Online document library without downloading the file.
I have explored the following APIs so far:
SharePoint REST API v1: Can be used to set a Retention label but not a Sensitivity label.
Microsoft Graph REST API: Can’t find any public methods for setting any labels in this API. All label-related properties seem to be read-only.
Microsoft Information Protection (MIP) SDK: Sensitivity labels can be applied to a local file. A stream (e.g. memory stream) is also accepted as input/output so it is possible to apply labels in memory. But it still requires downloading the file from SharePoint.
#P-39 Airacobra
Can be done by PowerShell script:
https://learn.microsoft.com/en-us/microsoft-365/compliance/sensitivity-labels-teams-groups-sites?view=o365-worldwide#use-powershell-to-apply-a-sensitivity-label-to-multiple-sites
But I'm looking for the same, like to apply settings using the unattended way, like REST API, saw something in Microsoft Graph API BETA:
https://github.com/microsoftgraph/powershell-aad-samples/blob/master/ReassignSensitivityLabelToO365Groups.ps1
But not tested yet.
Seems found something, will look later:
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/modern-experience-site-classification
I have a bunch of documents for which I want to determine the public links. Reading https://support.google.com/drive/answer/2494822?hl=en says I can get a "Anyone with a shareable link".
However no matter what I do I cannot find that option. The only links I can get is for ".... in the Organisation" All I need to do is get the link so I can embed it in an iFrame on another site.
Can anyone give me any pointers. This is not obvious as I think the fact it is in a Google Apps environment is preventing me getting what I need.
If you do not see the option, likely your administrator has restricted sharing with outside sources. You will need to speak with your domain administrator to either change these settings, or to figure out an alternative method of sharing the document.
Your administrator can find this in Apps > Google Apps > Drive > Sharing settings in the admin console.
https://support.google.com/a/answer/60781?hl=en
I was wondering if it is possible to open an Excel file (or any Office file) stored on an Azure Blob account within a browser or, better yet, embedded on a web page. Kind of like a preview function instead of always prompting the user to download the file. I know this could be easily done by storing the file in Sharepoint or OneDrive and using it's embed functionality but I'm trying to steer clear of those since we already implement the blob storage.
I've been searching but most results only lead me to Sharepoint/OneDrive.
Any help would be appreciated. :)
Edit (2014-07-14)
As per RGregg's suggestion below, I tried looking into creating a custom WOPI Host and I do think it would perfectly fit what I need. But I think I'm missing something. I cannot get the preview running. I am always getting a "Server not found" error. I tried replacing the old discovery file directed at owa1.wingtip.com with officeapps.live.com/hosting/discovery and it now goes as far as the loading image of Word Online but it gets stuck there. Couldn't really find other materials that expounds on how to make it work and it doesn't show any error whatsoever.
I also tried to create my own (in an attempt to simplify everything with just the mere basics) by implementing the GetFile and CheckFileInfo methods required. It sucessfully retrieves the file and the info but I still can't integrate it with the Web Apps. I think I'm missing a big chunk of something but I can't really figure it out. :(
I think it'd be easier to convert your backend over to Office 365 or OneDrive than to make your blob storage solution work with the Office apps, but I think what you would need to do is implement a WOPI host, like in this article: http://code.msdn.microsoft.com/office/Building-an-Office-Web-f98650d6. That would at least get you to a point where Excel Web App could load files from your blob storage.
I've just recently found out about Google Doc Preview. Basically, you'll just need an online URL of your document and appended it to:
https://docs.google.com/viewer?url=
and put that in an iframe. For wholeness:
<iframe src="http://docs.google.com/viewer?url=http://<blobServer>/<filename>&embedded=true" width="600" height="780" style="border: none;"></iframe>
It already provides some sort of a "Print Preview" on an IFrame so you have to keep in mind of pagination when creating the document for a prettier view. It also doesn't require you to have any google account to access it.
I still have some issues with it though:
Security. No required account = less security.
Doesn't render charts well. I had a pie chart and it appears as one whole solid circle.
Doesn't render filters at all thus...
Doesn't provide interactivity unlike OneDrive's embed.
But, this still answers the question so I'm posting it here for anyone looking for a solution. :)
Any answers are still welcome. :)
I have written some code to connect to a SharePoint online server and get a list of *.docx (Microsoft Word) files from a folder on there.
I then display this list of files in a web page and each file is a tag, so that the user can click on it and "open" the file.
When the user clicks on the file, it prompts the user to Open/Save the file (the standard IE/Chrome file open/save dialog). Instead, I want the file to open up in Word Online (in the same/separate browser tab).
I tried searching for possible API support online, but can't seem to find any. SharePoint Online itself seems to be able to do this. If you click on a .docx (or any other Office file), it will open it in Office 365 (provided you have that provisioned).
Any help would be greatly appreciated.
You need to add the appropriate parameters to the link that the user clicks on.
Have a look at an existing document library and see the links that it creates:
https://mytenant.sharepoint.com/_layouts/15/WopiFrame.aspx?sourcedoc={1767368F-62FB-4C40-B3F2-C4EE44E88735}&file=My%20Document.doc&action=default
If the user is not licensed for Office 365, I think that they will still be offered a download. Not entirely sure though as we don't allow that on our tenancy. Certainly if they are only provisioned with SP Online and not the rest of O365, they can view the document online but cannot edit. Though recently we've seen people still able to edit - not yet sure if that is one of Microsoft's secret updates or a mistake by them.
RESPONSES TO COMMENTS:
When I say not provisioned in the rest of O365, I really meant that they were licensed for SharePoint but not anything else (a P2 license rather than an E3), that doesn't give rights to use the online (or iPad) editors. As far as I know, the only real way to test for that is to either try it or to use an Admin account to look at the license.
You cannot "pass credentials" to WOPI since credentials for Office 365 applications come from a separate system. You have to get credentials before you are allowed to access anything in Office 365. Basically Azure AD is the service & the login is done via login.microsoft.com, the login provides a token to your browser that is exchanged with the server on every request. To reuse an existing credential, you have to be using an application that "knows" you have already logged in. Typically, Microsoft use a helper application that picks up the login from IE if that's how you logged in and makes it available to other applications such as Office. If you are using Firefox to log in, IE & Office may not know that you have done so (though there is a plugin for FF that gets installed if you let it which does the same thing).
By the way, if you know how it REALLY works, please don't shoot me down for trying to simplify the process for others. :)