How to retrieve attachments of an ItemAttachment from Office 365 REST API? - office365api

Assume I have an event (that has attachments) attached to my email, then I will use the api call provided here and get the event details, but I see that "Id" property is missing in the response. The same happens for messages as attachments. My problem is if I do not have the eventId or messageId, then I am not able to get their attachments.
Please see the below picture which shows the response from the provided api call here.

As mentioned here, we can use the following api call:
GET https://outlook.office.com/api/beta/me/messages/[message-id]?$expand=Attachments($expand=Microsoft.OutlookServices.ItemAttachment/Item($expand=Microsoft.OutlookServices.Event/Attachments))

Related

Microsoft Graph API GET onlineMeeting via joinUrl

Current using Microsoft Graph API v1.0 to create onlineMeetings via POST /me/events. Reason being, if you create an onlineMeeting directly and add a user in the meeting, it doesn't create a calendar event.
The params I use for that call is:
:isOnlineMeeting => true,
:onlineMeetingProvider => "teamsForBusiness"
Which works great and returns a joinUrl under onlineMeetings.
However, I'd like to pull attendance data from the GET onlineMeeting route to get attendance information since the attendees section of the event only seems to return users that were added to the actual event, not who attended the actual onlineMeeting.
I have tried doing a get request like such:
/v1.0/me/onlineMeetings?$filter=joinWebUrl%20eq%20'https://whateverthejoinurlis'
but the response says it's not a valid filter.
Any guidance would be appreciated.
Posting the Answer for better knowledge
Copying from #Shiva Keshav Varma comments
Try it in beta version
/beta/me/onlineMeetings?$filter=joinWebUrl%20eq%20'https://whateverthejoinurlis
You can also get the attendeereport using beta/users/{userId}/onlineMeetings/{meetingId}/attendeeReport as specified in the document.

List channel subscriptions returns only my channel

So, I have a request that should list my subscribers who do not have the private subscriptions option enable. My request is:
response = youtube.subscriptions().list(
part="snippet",
maxResults=50,
mySubscribers=True
).execute()
However, in items resource, every channel returned is my own channel. My channel name, ID and profile images. Is this the problem with the API or am I making a wrong request?
I also tried using the Try this API option on the documentation, but it also returns the same result.
https://developers.google.com/youtube/v3/docs/subscriptions/list
Thank you for any help you can give
According to the official docs you already quoted, you should have passed to your API call the parameter part as:
part="snippet,subscriberSnippet".
The subscriberSnippet part gives you the needed info:
subscriberSnippet (object)
The subscriberSnippet object contains basic details about the subscriber.
For what concerns the snippet part, the official doc is indeed a bit ambiguous:
snippet (object)
The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
Nevertheless, the info you get from part="snippet" only is correct.

How can I determine the original message of a reply?

Using Microsoft Graph, how can I determine which message an outgoing message is a reply to?
The internetMessageHeaders property is not available for items in the Sent Items folder of mailboxes (using the Graph API, at least -- they are available using EWS or IMAP). If it were, I'd look for the in-reply-to header. In the absence of this, is there something in the standard Graph message properties that will tell me this?
You can check the "Subject" or "bodyPreview" to check if the content contains "RE:", if the answer is yes, the message is reply to.
You can group the message by conversationId and then order by lastModifiedDateTime. This way can check if the message is the original one, if it is not ,it will be reply-to/follow-up one.
Get the message list first(/me/messages or /users/{id | userPrincipalName}/messages and so on), and then foreach the message id to call reply api(/users/{id | userPrincipalName}/messages/{id}/reply and so on). The result in the reply is a reply to.
To Test this, you can use the Graph Explorer first and then paste the JSON to a JSON viewer tool. For further use, you need to use net/java and so on to handle.
API reference: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/message
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/message_reply

How to filter outlook messages by attachment name or subject using “Microsoft Graph” rest API?

We have integrated outlook to our iOS application using Microsoft Graph API. We have a use case where we have to filter outlook messages by attachment name or by subject. We are using query parameters to hit graph API.
Link to microsoft documentation.
As per above documentation, $search parameter is used to filter outlook messages. When are hitting below API, we are getting wrong responses. It’s returning messages which have “Test Mail” in both subject and message body. But it should return only the messages whose subject line is “Test Mail”.
https://graph.microsoft.com/v1.0/me/messages?$search="subject:Test Mail”
The same problem we are facing when we filter messages by attachment name, by hitting below API. In fact we are getting a empty response in this case.
https://graph.microsoft.com/v1.0/me/messages?$search=“attachments:test.png”
Is the above URL formation is correct? Why we’re not getting desired response? Please help us out on this.
For searching Subject only, you can use:
/v1.0/me/messages?$search="subject:search term"
or a filter:
/v1.0/me/messages?$filter=contains(subject, 'my search term')
(in this method the search term must exactly match a portion of the subject string)
For searching attachments only, you must use the keyword 'attachment' instead of 'attachments' (exchange documentation):
/v1.0/me/messages?$search="attachment:search term"

How to get to invoice link in invoices api

I am interested to have a invoice link/pdf from the api which returns the invoice using new freshbooks api endpoint https://api.freshbooks.com/accounting/account/<accountid>/invoices/<invoiceid>
Even including direct_links I am unable to get the link to the invoice. With direct_links it returns json with fields id, contactid, created_date, type, userid, objectid, token.
I currently work at FreshBooks.
Unfortunately these direct link tokens will only work with old FreshBooks, which isn't mentioned in the documentation -- I'll see if we can fix that.
Poking through, it doesn't look like we've has exposed a way to access a PDF version of the invoice through the public API just yet. But I'll pass that on to the appropriate channels and I'll update this answer if that changes.

Resources