Ms Teams Channel: Drives are not fetching - sharepoint

I am creating Microsoft Team and channel under it using graph API.
Here is my code execution
/Groups --Post
/groups/{groupid}/team --Post
/teams/{groupid}/channels --Post
But when I am trying to fetch the drives list under this group using
/groups/{groupid}/drive/root/children
it just returns the General channel drive.
It's not returning the newly created channel drive.
It was working as expected before as it was returning me drives for both the channels.
I used to put some dealy too and using re-try 5 times with 10 seconds delay.but no luck.
In my finding, I found that when I click on Files tab of this team then the endpoint
/groups/{groupid}/drive/root/children
also starts returning data for both the drives.
This problem just introduced today.
is there any change in API?
or is the and limit to create automatically drives for the channels??

Related

MsGraph get latest deltaToken

Is is possible to get latest dalta link for messages and do not iterate through all messages until we reach last page?
/v1.0/me/mailFolders/{folderId}/messages/delta API
From documentation https://learn.microsoft.com/en-us/graph/delta-query-overview "Resources stored in Azure Active Directory (such as users and groups) support "sync from now" scenarios. This allows you to skip steps 1 and 2 (if you're not interested in retrieving the full state of the resource) and ask for the latest deltaLink instead. Append $deltaToken=latest to the delta function and the response will contain a deltaLink and no resource data."
But that does not work for messages how i understood. Is there another way to do this?

Not able to get the drive items of newly created channel using graph api

I am first creating a channel using graph api and the trying shares/url end point url is encoded, and when I try it I am getting
Code: accessDenied Message: The sharing link no longer exists, or you
do not have permission to access it.
Neither I am getting the driveitems by passing the drive id which I get from endpoint teams/teamsid/channels/channel id/filesfolder.
I need to create certain folders immediately on creation of channel
When you create a channel, it won't create a files folder in share-point. You need to go to channel and click on files tab to create a files folder in share point. Teams create the files folder in share pint on Demand. This is by design. Could you please try going to channel in UI and redirecting to files tab and then check the folder using Graph API.
for getting driveitems look into following documents:-
https://learn.microsoft.com/en-us/graph/api/driveitem-search?view=graph-rest-1.0&tabs=http

LogicApps outlook.com connector GetEmails trigger - get oldest emails

I am trying to get oldest emails from outlook.com mailbox within LogicApp. I have done number of test and seems like both triggers available GetEmails and GetEmails(2) always start from the newest messages.
My use case:
Emails after processing are moved to Processed folder and shall be stored there for a month. So am looking for a way to get list of x number of oldest emails to check whether they are older than 30 days, and delete them if condition is met.
With the current functionality, I would have to get all the emails from the folder, what might be few thousands within 30 days time slot. This creates an unnecessary workload on the outlook.com but also within LogicApp. Additionally I am afraid I can reach thresholds for this connector.
Is there a way to get x number of emails starting from the oldest ones?
If you want to get top X oldest emails in a folder of outlook mailbox, you can use Microsoft Graph API by Http action in Logic App to get emails you want directly.
For instance , if I want to get top 5 oldest emails in Processed folder, use the API below :
GET https://graph.microsoft.com/v1.0/users/<username>/mailFolders('Processed')/messages?$orderby=receivedDateTime&$top=5
In logic App :
I have tested on my side and it works perfectly for me.
Details of Microsoft Graph outlook mail API see here .
And how to customize responses from API
And Auth for Microsoft Graph API.
If you have any further concerns, pls feel free to let me know.

How to connect an azure logic app to a shared calendar

I am creating a countdown api, it's almost embarrassingly simple. When an http request is received, get the events from a calendar, cut the response down a bit (filter) then return the number of days until the next event (js). (I am also trying to do this with a function app, but got stuck here)
I can connect to one of my own calendars without any problems, but when I try to connect to a shared calendar, I have no luck. I can access the shared calendar using the graph explorer with this url: https://graph.microsoft.com/v1.0/users/calendarName#whereIwork.com.au/events?$select=subject,start So I know that part of the system works.
I've tried several options for an ID, including the ID from the graph explorer
"id": "AAMkADljMGQ0ZjNlLTY1MDktNGFmZi05OTBlLWQyNjE1ZjVlNzUxOQBGAABAAABvxqd01Z8OTK1ajR2m-ahiBwAlvPDp3V3YTK9QFfbU2TzGAABAAAEGAAAlvPDp3V3YTK9QFfbU2TzGAABAABHZAAA=",
The name of the calendar, the name with users/ prepended, and a few other versions:
What is the correct way to connect to this type of calendar?
You can use API request to get all events you want too, try the action below :
For how to get app id and app secret , pls refer to my previous post for you .

Outlook REST API - getFolders not returning all folders

I'm just getting started with the Outlook REST API. My baseline is the tutorial that uses node-outlook.
First order of business is to retrieve all of the folders in my mail account.
So I issue this REST request:
GET https://outlook.office.com/api/v2.0/Me/MailFolders
Instead of returning all of my folders, it only returns the "well known" folders:
Clutter
Deleted Items
Drafts
Inbox
Junk Email
Outbox
Sent Items
Trash
Am I missing a query parameter or something that says, "no, really, all of them please"?
UPDATE
I tried a different email account, and I also don't get all of my actual folders, but I get a different subset (some of which are well-known, others aren't).
I am implementing the paging protocol (using the #nextLink parameter) so it's not a matter of page sizes. I am getting these 8 folders on one account, and 18 folders on another.
So there must be something that decides what folders will be returned.
UPDATE 2
I changed to doing a folder sync instead using the "beta" API. In this case, I also get an unnamed folder in the list, which is the parent of the other folders. It comes along with a ChildFolderCount which is accurate. However, when I do a child folder request on that folder id I get the same list.
UPDATE 3
Here's the request url I'm using when I attempt to read the child folders of the one folder that comes back with a non-zero ChildFolderCount.
GET https://outlook.office.com/api/beta/Me/MailFolders/AAMkADRmMzFmNjZmLWU3MjctNGZiNi1iZTg4LTRmNGQwYTVhMDgxYgAuAAAAAAB8IxaZ5KGbQom4EPywGCSdAQDVy0eYwAzLS63k5pohzykCAAAAAAEJAAA=/childfolders
Here's what appears to define what folders are returned by this API and what are not:
If I create a folder in office365 directly on outlook webmail, it shows up in this query.
If I create a folder in Mac Mail, it does not.
Mac Mail accesses the service using EWS, so I would expect a folder created by it would be like any other folder.
So there is something about folders created on Mac Mail that prevents them from being returned by this API.
Folders created in Mac Mail DO show up in web mail and vice versa.
Folders created on an iPhone DO show up, so in my limited testing it looks like Mac Mail may be the only app suffering from this problem. The problem I have is most of my folders were created in Mac Mail and I have no easy way of rebuilding them.
I'm thinking this is just a BUG in the API. At any rate, this answers my original question and should help anyone out there trying to use the new API.
If I find a workaround I'll post it here.

Resources