I'm trying to retrieve emails using Microsoft Graph(and the Microsoft Graph SDK) and i'm running into the following problem : when the email has another Outlook message attached to it and that message also has attachments, i'm unable to get them.
I'm able to retrieve the attached message with the following query, but I can't do a second expand on attachments as I'm already doing one to get the OutllokItem(message)
/v1.0/users/<UserName>/messages/<MessageId>/attachments/<AttachmentID>?$expand=microsoft.graph.itemattachment/item
Is this possible at all ? Thanks in advance.
For anyone looking for a solution, there's a feature currently available on beta only that allows you to get the whole message in Mime text format.
To get an attachment
/beta/users/<UserName>/messages/<MessageId>/attachments/<AttachmentID>/$value
To get the full initial message :
/beta/users/<UserName>/messages/<MessageId>/$value
See https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-beta&tabs=cs for details
Related
Using MS Graph SDK or MS graph explorer, we are trying to replace an attachment within a message. Updating a message attachment is not supported yet by ms graph API (or at least that's what we know). that's why we do the operation in the following steps:
get the original attachment content.
modify that content.
delete the original attachment.
then add the modified content as a new attachment with the same name.
This works. However, randomly fails, resulting in two attachments, the original and the new instead of the message having one updated attachment. the API returns success results in both cases with no indication of what might be the problem.
Here are the calls:
First Request to delete the attachment (step 3):
DELETE https://graph.microsoft.com/v1.0/me/messages/{messageId}/attachments/{attachmentId}
Second Request to add the modified attachment (step 4):
POST https://graph.microsoft.com/v1.0/me/messages/{messageId}/attachments
body:
{
"#odata.type": "#microsoft.graph.fileAttachment",
"name": "smime.p7m",
"contentType": "application/x-pkcs7-mime",
"contentBytes": "{contentBytes}"
}
Any feedback on what might be causing the issue would be appreciated.
After some research on this, it looks like this is not an issue with ms graph. The thing is that we are using outlook for mobile on IOS to check the message after being manipulated and the outlook app does not update the attachment correctly which results in two attachments being displayed. If we query the message using ms graph explorer we can see that the attachment was replaced correctly. We concluded that this is a bug in Outlook app o IOS.
To confirm, we reinstalled the outlook app on IOS and the message with its attachments was displayed correctly.
I was just trying to get a specific logs from SendWithUs, but cannot really find any info. Googled all around the place. API documentation on SWU does not say how to pull like "email_name" with a specific text in it. I want to pull the logs where "email_name" could be specified or at least "email_name" like '%specificemailname%'. Any ideas?
I will really appreciate every single answer.
There isn't a way to filter logs programatically. Sendwithus has two log API endpoints. One to get information about a log using the receipt_id returned an a send API call. The second lists email event information (opens, clicks, etc) for a given log.
Did you reach out to the support team for help?
How can I update mail to show a "warning" message that exists on a users' mailbox as like what you see when mail is moved to the "junk mail" folder using the Graph API? See attached screenshot. Obviously, I want this message to be customised with my own text. It's not possible to update messages if they aren't draft (isDraft=false).
I dont think that Transport rules are good for us because I want to add that label after the message has arrived into the users' mailbox.
I know that its possible to add Custom Attributes to a message resource - https://learn.microsoft.com/en-us/graph/api/resources/opentypeextension?view=graph-rest-1.0
Can I utilize it? any way that you can recommend to do such a thing?
Do I need to develop any addon for that?
After speaking to the PM , there is no supported scenario to do this. If you require this feature you can make a request on https://microsoftgraph.uservoice.com/
Is it possible to query for the first, or all emails from a particular conversation id using the Microsoft Graph? If not, how about with the classic Exchange API?
Scenario: I am creating an application where I am interested in tracking the user who started an email thread, and the content of their initial message.
When querying for mail using the Microsoft Graph, I can get back an id unique to that email, and a conversationId unique to that email thread. The body returns the full email thread so far, but it is none trivial to parse (are there tips to parsing the returned HTML?), and may not always be accurate if people are adjusting the mail that gets sent back and forth.
Maybe the solution here is to parse the full body HTML, but I have not seen any documentation on best practices here. Any tips?
To get all mails with same conversationId, you can use
GET https://graph.microsoft.com/v1.0/me/messages?$filter= conversationId eq 'yourConversationId'
Microsoft Graph is using OData. So you can use query parameters to customize responses.
For how to use query, please check this document.
I am reading here about the REST API of JIRA:
http://docs.atlassian.com/jira/REST/latest/#id233354
I can see there are methods to post an attachment to an issue, as well as to get information about an attachment by it's ID. But I can not find a call that can provide me with a list of attachments for a specific issue.
So my question is: How is JIRA linking the attachments to the issues? How can I get a list of attachment ids for a specific issue?
Thanks :)
EDIT
Actually, if I make the call to get the issue information (full issue information) the attachments are there as a field. Thanks for reading anyway :)
Make the call to get the issue information (full issue information) the attachments are there as a field.