I'm trying to fetch all the sites under our tenant and some are missings. We recently created a new site (not subsite) and we cannot found it when searching with Microsoft Graph.
Here's the request url that we are using:
https://graph.microsoft.com/v1.0/sites/?search=*
I also tried to use this url from beta docs but it's not working either:
https://graph.microsoft.com/beta/sites?filter=root%20ne%20null&select=siteCollection,webUrl
Though, I can found it with the get by path url:
https://graph.microsoft.com/v1.0/sites/{hostname}:/{site-path}
Does the site need to have a specific setting to appear in the result when searching?
I want to be able to list all the sharepoint sites that exists.
Based on my latest test, the following url not handle same data so different results(Attetion to my code comment):
//just return the team site(subsite of teams/sites)
https://graph.microsoft.com/v1.0/sites/{hostname}:/{site-path}
//Will return the tenant site collection
https://graph.microsoft.com/beta/sites/root?select=siteCollection,webUrl&filter=root%20ne%20null
To get the modern team sites for the groups, we need to use groups end point from Microsoft Graph. No API to list all the modern team sites directly, we can loop through the groups and then get the site URL with this API: https://graph.microsoft.com/v1.0/groups/<group-id>/drive/root/webUrl.
Please check if the site in your case with issue is a modern team sites?
Some reference from 3rd blog:
https://www.eliostruyf.com/get-the-site-url-of-an-office-365-group-via-the-microsoft-graph/
Related
When I load pages via
https://graph.microsoft.com/v1.0/me/onenote/sections/{ID}/pages?$top=100&$orderby=createdDateTime%20desc
the results are not up-to-date, even though changes have been synced across other devices.
There should be 4 pages in the section. This is what is in the response:
two existing pages (two are missing)
several other pages that were previously deleted, but when I try to fetch the HTML contents, I get a 404. The pages were deleted via DELETE https://graph.microsoft.com/v1.0/me/onenote/pages/{ID} per the docs
Does it work via the OneNote API?
Per #codeye's suggestion (see comments), I'm trying to access the pages via the one note API. It seems unclear whether this is still possible:
The API is deprecated and scheduled to sunset November 2022.
The docs refer to registering the application in the Microsoft account Developer Center, which appears to be obsolete and points back to the Azure portal
Later in the same doc, they refer to permissions like office.onenote_update that no longer seem to exist i.e. I can't find them in the Azure Portal. I do see permissions with the same name from two places: Microsoft Graph and OneNote - perhaps the permissions have been renamed?
However, after adding One Note ->
Notes.ReadWrite, logging out and reauthenticating, I'm still getting HTTP errors on onenote.com URLs like:
401 from https://www.onenote.com/api/v1.0/me/notes/sections/{ID}/pages?$top=100&$orderby=createdDateTime%20desc (as #codeye suggested below, tried with and without query parameters)
401 from https://www.onenote.com/api/v1.0/notebooks (URL from the docs
404 from https://www.onenote.com/api/v1.0/me/notebooks (same URL as previous, but with me/ segment added
Trying to use Microsoft's Graph API to iterate through Sharepoint sites, in order to find and remove a user's access to sites when they go out of the country.
Graph / Sharepoint API documentation: https://learn.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-1.0
I get a list of all sites using the Get Sites endpoint:
https://graph.microsoft.com/v1.0/sites
I then filter out personal / OneDrive sites, and try to use the List Site Permissions endpoint to try to get admins/members: https://learn.microsoft.com/en-us/graph/api/site-list-permissions?view=graph-rest-beta&tabs=http
Unfortunately, I get an empty value array in response for all sites:
{'#odata.context': "https://graph.microsoft.com/v1.0/$metadata#sites('<domain>.sharepoint.com%asdfasdgsdf-ca8f-4ec1-bb3e-sdfsdfsdgsdf%2Cbed949c3-3f83-47c2-a263-sdfsdfsdgasdf')/permissions", 'value': []}
I know that the query is fine, because if I change it to instead hit the Site Lists endpoint, I get a response which includes various values:
{'#odata.context': "https://graph.microsoft.com/v1.0/$metadata#sites('<domain>.sharepoint.com%sdfsdfsdgsd-7dce-4564-9de8-eb2dfc02eb86%sdfsdgsdfsdf-ab8c-464f-a77d-sdfsdfsdgsdg')/lists", 'value': [{'#odata.etag': '"sfwsdgsdg-aff1-4295-8443-sdfsdgasdf,7"', 'createdDateTime': '2020-08-26T16:17:41Z', 'description': 'This library contains items that have been modified or deleted but must remain available due to eDiscovery holds. Items cannot be modified...
...
So, the Site ID I am passing to the permissions request must be correct. Is this the wrong endpoint then? Or, is this functionality missing from the Graph API, and my only solution is via the SP Powershell module?
I have tried with both the v1.0 and beta vesions of the API.
Thanks!
According this it looks like a bug in Graph API.
I'm trying to get all the users which are there in a project,
I went throught this API https://docs.atlassian.com/software/jira/docs/api/REST/7.9.2/#api/2/user-findAssignableUsers, but idk why I'm getting {"errorMessages":["Internal server error"],"errors":{}}.
I also followed this article https://community.atlassian.com/t5/Answers-Developer-Questions/List-of-users-in-project-REST-API/qaq-p/536820 but I'm getting 401 unauthorised, as I don't have admin rights, I can't use the plugin mentioned in the above article. I'm stuck :( . I'll be thankful if anyone can help me.
Thanks.
First of all as Mech suggested, you will need to have admin access to the project to get required details. REST API uses exactly the same permissions as that of the normal JIRA UI.
If you want to fetch all the users(including different project roles) who have access to the respective project, then you need a chain of Jira REST Api calls as below,
Using this api to fetch all the available roles for a project,
GET /rest/api/2/project/{projectIdOrKey}/role
You will get some response like,
{
"Administrators": "http://www.example.com/jira/rest/api/2/project/MKY/role/10002",
"Users": "http://www.example.com/jira/rest/api/2/project/MKY/role/10001",
"Developers": "http://www.example.com/jira/rest/api/2/project/MKY/role/10000"
}
Then for each of the project roles(fetched in the first step), call the below jira rest api to give the respective list of users by passing the role id and project key,
GET /rest/api/2/project/{projectIdOrKey}/role/{id}
This is how you can get all project memebers (users) :
https://{YourCompanyName}.atlassian.net/rest/api/3/user/assignable/search?project={JiraIdProject OR JiraProjectKey}
We currently have an issue when creating private channels on a team which was created using the "/teams" Graph API endpoint.
When adding a private channel from the Graph API, the SharePoint site associated to the channel is not provisioned. User needs to visit the "Files" tab in the MSTeams client for the site to be created.
We noticed that this is not the case when initially creating the Team from the MSTeam client or from the "/groups/{id}/team" endpoint (which is marked as being soon deprecated). Using either of those two methods to create the team, SharePoint sites are automatically created when adding a private channel.
We were wondering if this was the expected behaviour or a bug. It is an issue for us as we have no way to automate the creation of the private channel's site and thus we cannot copy files into the site as long as a user did not visit the "Files" tab.
#odrouin - This is not expected behavior. We have bug created for this issue. Thanks for reaching out.
I think I've found a workaround for this issue. It seems like if you first make a call to the filesFolder endpoint on the primaryChannel of the team (the General channel), then the site will be provisioned for a private channel created afterward.
I've been trying this scenario on a couple of different tenants so far:
use an existing team or create a new one through the UI
add a tab (let's say OneNote) to a channel
query the list tabs endpoint (through graph explorer)
I always get a 404 response. If I replace in my query tabs by messages I get the messages.
In terms of permissions I have the default graph explorer one + Group.Read.All.
Here is the latest request Id I got 2a180611-b637-4aa4-be27-9e42cbb27ab9 on tenant dev2tolead12. (GET https://graph.microsoft.com/beta/teams/7471ee8d-0ed3-4f22-80ee-3b513e42e6ac/channels/19:9a0544b274654ef8ac97761ebd91b471#thread.skype/tabs)
My question: what am I missing for this request to work?
Sorry, we thought we had deployed the tabs API to all tenants, but had actually deployed it to only some of them – this has been fixed.
The endpoint started working in my tenants today. My guess is Microsoft fixed something recently