Create document library (inside Sharepoint site) through graph APIs? - sharepoint

When I am trying to create Document library using below endpoint its creating folder inside existing document library.
POST /drives/{drive-id}/root/children
I need to create Document Library at site level. e.g. at https://domain.sharepoint.com/sites/<site_name> through graph APIs
Any Inputs?

You can use following endpoint to create a list (Document library):
https://learn.microsoft.com/en-us/graph/api/list-create?view=graph-rest-1.0&tabs=http
Example:
BR

Related

Graph API list of application inside a collection

Hi I would like to use the graph api
https://graph.microsoft.com/v1.0/applications
To gather name, icon and link of all the application of a user.
The application are inside a collection.
How can I get via API only applications inside a collection?

DocuSign API - Update Template PDF Document

I have an existing DocuSign Template setup and working well. I would like to be able to update the PDF file used for the Template via the API using a locally stored PDF file that I have. Is there a way to update the PDF file used by the DocuSign Template via the API?
I can see that you can update a Template here:
https://developers.docusign.com/esign-rest-api/reference/Templates/Templates/update
but can't work out what I need to do to replace the PDF file with a new one?
Is there a way to update the PDF file used by the DocuSign Template via the API?
Yes. You use the compositing templates API feature to substitute a document for the existing one in the "server template" (a template stored on the server).
See DocuSign Rest API to replace single template document for a code example.
(From a comment)
How do I update the template's definition to use a different document?
See the TemplateDocuments::update API method.

How to access a document library in a sharepoint online site using MS graph

I am able to access the documents on my one drive with requests like this one:
https://graph.microsoft.com/v1.0/me/drive/root/children
I am able to access a document library of a root sharepoint site of my company with a request like this:
https://graph.microsoft.com/v1.0/drive/root/children
It gives me the contents of the "root" library:
https://<my company>.sharepoint.com/Shared%20Documents
I am not able to access the document library of a SP subsite I created. e.g. this one:
https://<my company>.sharepoint.com/samplesp/Shared%20Documents
How can I access such a document library with MS Graph?
For accessing SharePoint sites and lists check out documentation of the SharePoint API in Microsoft Graph.
Update:
For those who have problems with accessing default Drive (formerly "Documents" library) on a specific SharePoint site using MS Graph API:
You should look into the documentation for accessing files on OneDrive.
As said in the question, this endpoint gives us a list of files on private OneDrive:
.../me/drive/root/children
Drive on SharePoint's sites works in the same way, but instead of me you should provide global Id of the site you want to access (global Id is <hostName>,<siteCollectionId>,<siteId>).
In conclusion: this endpoint gives us a list of files on a specified site's default drive:
.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/drive/root/children
If you want to access files on a specific list, all you need is the id of the list:
.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/lists/<listId>/drive/root/children
Now it should be obvious.

accessing files and folders other than sharepoint site's default shared documents using office365 api

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

Sharepoint Online DocumentSharing API

trying to share a file with external users via the API, our in-house app will upload the file to sharepoint, return the view only link and we can then send that link to external users avoiding emails etc.
Is this possible with .NET C#?
Yes, it is possible. with the SharePoint client object model, your application can: Upload the document to the document list, and set the permission for that item, then return the link to external user.

Resources