How to get list of events via GRAPH API with LimitedDetails permissions? - microsoft-graph-api

I try to get a list of events via List calendarView
It works as expected when users have Reviewer permissions in the exchange server, but as soon as they have only LimitedDetails - I have an error "access denied".
I assume that the problem is that with LimitedDetails I can only get subjects (without event body).
How can I request the list of events (I need Subject, ICallId and IsAllDayEvent properties) in this case?

Limited Details is a FreeBusy permission so it should work in https://learn.microsoft.com/en-us/graph/api/calendar-getschedule?view=graph-rest-1.0&tabs=http as this queries the users freebusy time but it won't work when trying to query the calendar which requires reviewer or greater.

Related

Getting Meeting IDs from Events in an M365 Group

I've been tasked with a project to get attendance information from specific types of Teams. I have a service account that is already a member of these Teams, however it is unable to access an endpoint needed to resolve JoinWebUrls to meetingIDs (See example #3, 'Retrieve an online meeting by JoinWebUrl').
I have done the following thus far:
Create a new App Registration and assigning it 'OnlineMeetings.Read.All' as an Application permission (this process needs to run as a script, meaning that Delegate permissions won't work here)
Create a new Application Access Policy, assigned the aforementioned App Registration's App ID to it, and granted it to the service account.
Signed into MS Graph as the service account (using the 'password' grant_type) and retrieved the 'events' within the Team (via /v1.0/groups/$GroupID/events)
Extracted the JoinWebURL parameter from each of those events.
Step 5 would be to resolve the meetingID from the JoinWebURL, however when I all of the following requests fail:
GET /v1.0/me/onlineMeetings?$filter=JoinWebUrl eq '$JoinWebURL' (as the service account, which should be able to interact with the meeting)
GET /v1.0/users/$ServiceAccountObjectID/onlineMeetings?$filter=JoinWebUrl eq '$JoinWebURL' (as the service account to access it's own object's meetings, however this does seem to be the endpoint for Application permissions rather than Delegate permissions)
GET /v1.0/users/$ServiceAccountObjectID/onlineMeetings?$filter=JoinWebUrl eq '$JoinWebURL' (using the App Registration mentioned earlier, signing in with the 'client_credentials' grant_type)
GET /v1.0/me/onlineMeetings?$filter=JoinWebUrl eq '$JoinWebURL' (as the App Registration trying to access any meeting, however this does seem to be the endpoint for Delegate permissions rather than Application permissions)
Basically, I'm stuck. Is there something obvious that I'm missing? I'm also considering raising a support call with Microsoft, to see if the behaviour I'm experiencing is merely a bug.
Thanks in advance.
Events and online meetings are two different API's, you have created an event and trying to get online meeting details. That's the reason you are getting those errors. If you want to get event details please try this document.

Microsoft Graph API SDK .NET Issues getting other users emails

I am using the Microsoft Graph SDK as downloaded from NuGet (1.2). I authenticate to Azure AD (using ADAL).
I am using Client Credentials flow (not authenticated as any particular user) and am using Application Permission roles to access resources.
We are going to set up one service mailbox with a bunch of aliases. The aliases are given to the clients. This is so they are emailing an address that has a meaningful name to them.
My app will run as a service, and routinely scan new emails in this inbox. It should find the To address, and depending on what alias was used, file the email in a location relevant to that client.
The resource I want is: GET /users/<id | userPrincipalName>/messages
However, there doesn't appear to be a method in the SDK for it.
I can get users with this:
IGraphServiceUsersCollectionPage filteredUsers =
graphApi.Users.Request()
.Filter("userPrincipalName eq 'user#domain.com'")
.GetAsync().Result;
When I loop through the collection, I can see that the User has a 'Messages' property, but it is always null.
If I manually build a request message with HttpClient I can get the messages.
The second problem is that the Recipient property is always the userPrincipalName of the mailbox. How can I get the alias that was used by the sender?
While you are able to get your collection of users successfully, you have to make another request to receive the messages. This would look something like:
IUserMessagesCollectionPage userMessages =
graphApi.Users["user_id"].Messages.Request()
.GetAsync().Result;
To answer your second question, at this time you cannot access the original recipient through the Graph API, but you can do this through EWS. This is due to the fact that you can only retrieve the SMTP message headers through EWS. You can read more about how to do this here.
If this is something you believe is valuable to you in the Graph, I would encourage you to post it in our UserVoice.
If you want to get the email as a file, you can simply get the body as bytes through the SDK:
byte[] asBytes = Encoding.Unicode.GetBytes(message.Body.ToString());

Public/Private Events When Querying Facebook Graph API

I'm building an RoR application that uses the Facebook Graph API, scraping a users events via their user_access token. I'm essentially taking that user token and making a Graph call to the API, getting all the events the user has either given a rsvp, created, declined, maybe and not_replied response to the events they've been invited to. Here is my query...
GraphAPIEndPoint = [created, declined, maybe, not_replied]
GraphAPIEndPoint.each do|endpoint|
data = Koala::Facebook::API.new(access_token)
events = data.get_connections("me", "events/#{endpoint}", fields: ['id',"name","description","place","start_time","end_time","timezone","ticket_uri", "cover"])
end
This query gives me the desired data but I'm unsure whether I'm getting private events from the user, which I don't want. After I've received the data, I've checked some source url's in my browser, which show a Facebook default error page saying, "Sorry this page isn't available". Other Facebook url's I've tested show me their events as public events, only the ones that seem specific to a group of friends or family give me this default error page. Also, if the events were deleted by the author (which could be an answer as to why I'm getting the default error page), why am I still getting the JSON for the event?
My only assumption is that I am, and if so, what are the privacy parameters to prevent this from happening and give me only the public events?(Please no FQL suggestions)
Thanks for your help!

YouTube Api Explorer Usuage as ContentOwner: forbidden

I'd like to get the impressionBasedCpm from the Api Explorer ( and later from my app).
I can log in with an youtube partner account and toggle the oauth switch. I set all scopes to checked.
Then I try to enter
ids: contentOwner==NAME_OF_CONTENT_OWNER (not the id, retrieved from the content API, https://developers.google.com/youtube/partner/docs/v1/contentOwners/list#try-it)
metrics: impressionBasedCpm
start-date: '2015-05-01'
end-date: '2015-06-01'
The output still tells me:
You do not have permission to execute this method.
Can someone help me?
My guess is that when I authorize the application I seam to still login as a channel, so the query as a content owner is not allowed. I picked the main one with the email address. But when I'm on youtube I can switch to a specific Content-Manager Channel/Account.
Even when I try to just get the 'likes' for the contentOwner it doesn't work. If I try to get the likes based on the channel_id it works. But I like to get reports for a youtube partner that uses youtube's cms.
cheers
This query won't work because it does not follow the semantics of the API. You need to provide the ID of the contentOwner in order to get a 200 OK response. Name of Content Owner cannot be unique and hence would lead to erroneous results.

Eventbrite - Getting past events

I'm using eventbrite.com, and I'm trying use the rest API to get all the previous events for my user (organizer in eventbrite). I am expecting to get events that have occurred in the past.
I'm using the following url:
https://www.eventbrite.com/xml/event_search?organizer={MyOrganizerName}&app_key={MyAppKey}&date=past
However, I get nothing returned. ever. I am sure that have some events that happened in the past.
I am successfully getting events in the future. so there's nothing wrong with my client\app key\spelling\whatever.
With the newer Eventbrite APIv3 the endpoint changed to /users/me/owned_events The API comes with an API Explorer, which lets you see detailed debugging information for any endpoint just by going to it in a web browser.
Paste this url with your token id into your browser to get all past events:
https://www.eventbriteapi.com/v3/users/me/owned_events/?token=YOURTOKENID
The result is a paginated response of all the events your user account is organizing.
The event_search method is meant to return publicly available information about upcoming events only.
Try user_list_events instead:
https://www.eventbrite.com/xml/user_list_events?app_key={YOUR_APP_KEY}&user_key={YOUR_USER_KEY}&event_statuses=ended
You also have the option of creating an Organizer Profile Page, allowing you to group similar events together. The organizer_list_events API call may be useful for folks who are using that feature.

Resources