Office 365 - Filter on expanded messages - odata

Thanks to How do I retrieve the event for an eventMessage we've sucessfully retrieve now the events in our inbox on o365.
Now our problem is that we want to show the user only events to which he hasn't responded. We've tried things like:
$expand=Microsoft.OutlookServices.EventMessage/Event($filter=ResponseStatus/Response%20eq%20'NotResponded')
But without success, we still get accepted events. If we try to put it outside in a filter
$filter=Microsoft.OutlookServices.EventMessage/Event/ResponseStatus/Response%20eq%20'NotResponded'
we get an error like "message": "The query filter contains one or more invalid nodes."
Is there an easy way to achieve that without a filtering inside the application?

It seems that ResponseStatus/Response is marked as not filterable, so this cannot be achieved in this fashion

Related

Expanding and Filtering MS Graph API Does Not Work

I need to get an eventMessage from a user's mailbox that is associated with a specific event.
I have the event's iCalUId but I am unable to filter on it:
/users/${roomEmailAddress}/messages
?$expand=microsoft.graph.eventMessage/event($filter=iCalUId eq '${iCalUId}')
What I am trying to do is get all messages, then expand so that I see the events associated with each message, then filter each event to find the one I care about.
However, I get a response with all events and the filtering mechanism is not working.
Where am I going wrong?
Graph doesn't support including a $filter in the $expand. From the documentation:
$expand:
No support for nextLink
No support for more than 1 level of expand
No support with extra parameters ($filter, $select)
What you can do is leverage the $search parameter to parameter to find all of the event messages ($search="kind:meetings) and then $expand the associated event:
/me/messages?$search="kind:meetings"&$expand=microsoft.graph.eventMessage/event
This worked for me, first I filtered then I expanded list
https://graph.microsoft.com/v1.0/sites/{sideID}/lists/{listID}/items?$filter=fields/{Name of Field} eq '{VALUE}'&$expand=fields

Is it possible to get a single event's originalStart with Graph API?

I'm working with Microsoft's Graph API for Outlook calendar events, and I need to fetch the originalStart for exceptions to recurring events on a calendar.
When fetching events using the List events function, I am provided with the events' original start dates, but when I grab a single event using the Get event function, the object returned has no originalStart.
I do receive the event's originalStartTimeZone and originalEndTimeZone, but the original start date is simply missing.
The event resource lists this as a property for events, so I would expect it to be showing up. Any way to get this event without grabbing the entire list of events anew?
I ve checked and confirm originalStart is missing or giving null value. You can look over there as the issue is already known : https://github.com/microsoftgraph/microsoft-graph-docs/issues/4353
I am able to get the originalStart by specifying it in the select query parameter:
https://graph.microsoft.com/v1.0/me/events/<id>?$select=id,subject,originalStart

How to search for a message by a specific ts

I am trying to get the parent message of a threaded reply with the Slack API. When a new reply is put, it has a "thread_ts" attached to it, which corrsponds to its parent message's "ts". I tried to do a searchall with the ts as the query but this didn't work. How would I do this?
See Slack's docs on retrieving a single message with channels.history. This "selecting 1 item from a range" approach should also work with other channel history methods and conversations.history.
The easiest way is to provide the thread_ts value you want to look up as the latest parameter to conversations.history, along with the containing channel ID as channel, and a limit of 1 to ask for a single message. You will need the corresponding *:history scope to make the request.
Example:
GET /api/conversations.history?token=TOKEN_WITH_CHANNELS_HISTORY_SCOPE&channel=C2EB2QT8A&latest=1476909142.000007&inclusive=true&limit=1

Select fields on Microsoft Graph list of Messages

I'm using Microsoft Graph to get a list of messages for a user.
I'm using the following URL
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages
One important thing that is returned by this is the meetingMessageType when the message revolves around a meeting request.
I would also like to get the uniqueBody of the message. However, that's not provided by default. One needs to specifically ask for that field. I can do that by adding ?$select=uniqueBody to the URL.
However, that now means that I need to add the rest of the fields I want to the $select query parameter. That's not a big deal until I run into meetingMessageType. Microsoft Graph returns:
Could not find a property named 'meetingMessageType' on type 'Microsoft.OutlookServices.Message'.
What can I do to ensure I get both uniqueBody and meetingMessageType?
Try this:
$select=uniqueBody, microsoft.graph.eventMessage/meetingMessageType
Yogesh's answer is close but will result in a Only one level select is supported error.
As long as you don't care about the value of meetingMessageType, you can use this select:
$select=microsoft.graph.eventMessage, uniqueBody
You'll note that the results no longer include meetingMessageType as a property. The list however is limited to only those messages that are eventMessage, effectively giving you a result set filtered to only show meeting requests.

Mixpanel Query Events with properties

I'm tracking referral source for how users ended up on a specific page
$mixpanel.track('Page View',
'doctor_profile_id': doctor_uuid,
'patient_profile_id': currentUser.uuid,
'referral_source': 'News Feed', // this could be ['Search', 'Recommendations'] etc
});
I'd like to be able to query the Mixpanel API and get a count of Page View specifying a parameter such as doctor_profile_id and recieve a response with a count of page views and also counts for the various referral sources.
I was looking at the event endpoint but it looks like you can only get back 'Page Views'. You could accomplish this task by exporting the CSV but that's far from ideal.
Is this the right approach to solving this problem or am I using mixpanel incorrectly?
I was able to do this using the segmentation endpoint

Resources