Let's say there is a file in onedrive and it is opened by some user. Is it possible to delete it despite of the lock, using API?
Related
I want to process a file "sent" via ms teams in a personal chat with an ms teams bot app. However only uploaded files appear in the activity not "linked" files from a sharepoint folder shared with onedrive.
click the attachment icon, select onedrive, select a file from a shared folder to be linked:
https://i.stack.imgur.com/iDGc4.png
https://i.stack.imgur.com/HW5xT.png
bot receives an activity with the following attachments:
context.activity.attachments has the value
[{contentType: 'text/html', content: '<p>test </p>'}]
How can I know which link the user has sent? Is there maybe another event I can listen to to know which file the user linked?
When I upload a new file instead of using one from the shared sharepoint folder then each context.activity.attachments contains a content.downloadUrl from which I can download the file just fine.
I have been working for a project that makes use of google-APIs to create/write and read google sheets. I also wanted to duplicate a template on every user onboard.
I'm trying to use Files.Copy API, but I'm unable to do so with the Google API Key. It always restricts the copy with an error message ''This error may be due to using an insufficient credential type. Try using OAuth 2.0."
Is there any way to copy the google sheet using only API key other than OAuth?
Here are the steps that I followed to overcome this issue.
Create a folder in GSuite drive
Share the folder with the service account
Move the template sheet that needs to be copied to the shared folder
Share the template key with the service account
User File.Copy (Drive API) to copy the template sheet to the shard folder itself.
This way you can achieve both copying a template and viewing it. Without a shared folder, it ain't possible to view the sheets created by a service account
Previously I wasn't able to copy the sheet because it was owned by another user and had to get the consent from the user through oAuth. Now its resolved by sharing the parent folder of the template with the service account email.
It appears that using the docusign portal, you can create your own folders in addition to the default folders that a user has. I am wondering if there is a way to create one of these custom folders using the API. There are APIs to move envelopes between folders, delete folders, get envelopes from folders, but I cant find one that lets me create a folder. I am hoping it exists, and that i just am not finding it.
No it not currently possible to programmatically create new account folders through the REST or SOAP API.
The closest you can do is to move envelopes from one folder to another, including moving envelopes into the recyclebin to delete them or void them if they are draft or in-process, respectively. But there's no way to create a new folder through the APIs, you'll need to do that through the Web Console.
Working on windows store apps:
I am trying to access the files and folders of office365 documents library.
I can access the one drive documents as described in this link Common file tasks using the Office 365 client library
But it do not provide a way to access the files and folders in other than onedrive document library.
e.g [https://my-office365-tenant.sharepoint.com/mysite/mydocumentslibrary]
However i had tried a way and it do get the files and folders other than onedrive.
I had not used any capability i created SharePointClient as given below:
var client = new SharePointClient(new Uri("https://my-office365-tenant.sharepoint.com/mysite"),
async () => await AcquireTokenAsync(AuthenticationContext, "https://my-office365-tenant.sharepoint.com"));
IPagedCollection<IItem> items = await client.Files.ExecuteAsync();
In this way i get the files of default "Shared Documents" document library inside "mysite", but i want to get the files and folders of another documents library "mydocumentslibrary" inside same site "mysite".
Can anyone please guide me how to do that or am i missing something? or there is anyother way to do this using office365 api only.
I just went through the documentation of this new API, it seems the file operation is limited to the one drive, I doubt you can get file in another document library.
To get files in other document library, as you're developing windows store APPs, you can SharePoint mobile object model or REST APIs:
Overview of the SharePoint 2013 mobile object model
Get started withthe SharePoint 2013 REST service
The APIs allows access only to default document library. Example:
OneDrive for Business: https://{tenant}-my.sharepoint.com/_api/v1.0/me
SharePoint sites: https://{tenant}.sharepoint.com/{site-path}/_api/v1.0
I have added a menu item in ECB of document of document library. On click of that menu i want to copy that document to my application. For this purpose i need to create a temporary file of the document on the same machine where SharePoint server is installed. Now the problem is that where should i create the temporary file.
One solution is TEMP folder of current user(who has logged in sharepoint). But in sharepoint, Users from Active Directory can also login but temp folder is only available for users on that machine.
In short requirement is to create temporary file in a folder where every user (users on that machine as well as AD users) have rights to create and delete file.
Does sharepoint recommend any specific location for this purpose?
SharePoint uses .NET, so you should use .NET features for this:
string tempFilename = System.IO.Path.GetTempFileName();
The service account's notion of TEMP will be used, not the logged-in user's.
-Oisin