enable/disable external sharing in SharePoint and Teams using Rest API? - sharepoint

Can we enable/disable external sharing in SharePoint and Teams using Rest API?
i am not getting any documentation related to this query.

As far as I know, we cannot enable/disable external sharing through Rest API
We have to go to the admin center(needs to have admin permissions) to change external sharing settings.
Reference: https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off

Related

Access Sharepoint List from Teams Tab created using Teams toolkit

I am currently using Graph APIs to connect to share point list from the Teams tab(NOT SPFX TAB) that I created using Teams Toolkit. I would like to know if it's possible to use REST API or PNP library to connect to Share point list items other than Graph API.
Thanks.
You can directly use Sharepoint REST API in Teams Tab. Note that you need to update permission for Azure AD app and request for access token with proper permission with TeamsFx SDK to call Sharepoint REST API.

Is it possible to create agents via the API?

So I've been reviewing the DialogFlow documentation and wondering if it's possible to use the API fully programmatically and create agents via the API as well? A sample use case being the user on my platform being to able to create their own bot. I'm not able to find the functionality listed in their docs and wanted to double check with the community here.
You can now create and update agents with the API. See the REST and RPC documentation.
You can’t create an agent through the API but once it’s been created in the UI it can be edited through the API. Users will need to grant your service account the dialogflow editor IAM role and then tell you their project ID.

Get SharePoint group names with Graph API

Is there a way to get the SharePoint security groups at site collection/site level with Graph API? I have followed Graph API article by MS but no where they mentioned about pulling information from security groups. I want to use this Graph API url in my power apps to apply role based security.
It isn't possible to interact SharePoint's own user or group resource via Microsoft Graph at the moment. For the time being you would need to use the classic SharePoint REST API (i.e. /_api/web/siteusers) for this.

How to access Sharepoint site's document library via Microsoft Graph API?

I'm working on accessing document libraries for Sharepoint sites via Mircosoft Graph, but haven't had any luck so far.
Here is my setup:
I have two sites
https://mydomain.sharepoint.com
https://mydomain.sharepoint.com/teams/MyTestSite
When I make an api call to https://graph.microsoft.com/v1.0/drives, the response doesn't contain id of document library for second site (https://mydomain.sharepoint.com/teams/MyTestSite).
I have gone through documentation and haven't found anything on how to accomplish this. If anyone got any idea about this, please share.
Thanks.
I was able to figure out a solution for this. A sharepoint site is represented as a Group in Office 365. I found that out by doing some hit and trial.
So, after looking up their documentation for anything related to a Group, I got to this: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/group
And, by using the List groups endpoint I was finally able to get a list of all the Sharepoint sites which the authenticated user can access.
This API call requires Group.Read.All scope while requesting access token and only Admin users can authorize this scope. So, this will need a separate interface for Admin to list groups, potentially store the group-user mapping on my app for the user to be able to make api call (/groups/{group-id}/drive/items/{item-id}) related to the drive.
The V1.0 API has a way to list your doc lib as follows
GET https://graph.microsoft.com/v1.0/sites/mydomain.sharepoint.com:/Teams/MyTestSite:/drives
Hope this helps.
The beta API also exposes a Sharepoint endpoint.
You can also use the path if you already know your site structure:
GET https://graph.microsoft.com/beta/sharepoint:/sites

Which set of APIs should be used for Office365 Sharepoint

Which set of APIs should be use to access Office365 sharepoint which includes both sharepoint2013 and sharepoint2016.
Have gone through the following APIs
1) Sharepoint2013 REST APIs(https://msdn.microsoft.com/en-us/library/office/jj860569.aspx).
2) OneDrive new APIs(https://github.com/OneDrive/onedrive-api-docs) through which we can access the Directory folder which contains directory and files. But the present focus of APIs are for OneDrive Personal and Business.
Apart from this is there any other APIs which can access the office365 sharepoint?
You could use SharePoint REST API to retrieve, update, and manage data in Sharepoint Online ,you could find code samples and videos from here.
With Graph API you could get files/users/groups ,but SharePoint sites and lists are not yet available via Microsoft Graph .
In addition ,you could also use SharePoint client object model (CSOM) to manage data in Sharepoint Online,please read below article:
Connect to SharePoint Online using Client Object Model

Resources