to those who have problems with the downloaded files, 1kb or if it is corrupt file, the problem is Jie forgot to add ,headers=headers in line 17. attachment_content = requests.get( GRAPH_API_ENDPOINT + '/me/messages/{0}/attachments/{1}/$value'.format(message_id, attachment_id), headers=headers )
Thanks a lot for the Video👏. Very Useful one. But I am getting exception. Exception: {'error': {'code': 'Request_BadRequest', 'message': "Unrecognized query argument specified: 'top,select,filter,count'.
How can we set up the orderby param? For example, if I want to sort emails by receivedDateTime desc, how would I set up the string corresponding to that param?
Thanks for this. I am getting the following error in the flow variable: "No tenant-identifying information found in either the request or implied by any provided credentials". I'm assuming this means it wants me to pass the tenantID but I don't think generate_access_token() is set up for that. Any ideas?
to those who have problems with the downloaded files, 1kb or if it is corrupt file, the problem is Jie forgot to add ,headers=headers in line 17. attachment_content = requests.get( GRAPH_API_ENDPOINT + '/me/messages/{0}/attachments/{1}/$value'.format(message_id, attachment_id), headers=headers )
Hi Jenn, thank you very much for the video. I was able to generate a token and download files with different extensions, however, when you open the downloaded attachments they only have the following: {"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty."}. Any help would be appreciated!
@@jiejenn Thank you very much for the response! To make sure that there are no typos I tried copying code from your links above. The only change I made is APP_ID and the folder where the attachments need to be saved. I am getting the same error- "Access token is empty." The attachments are saved with different extensions, but they only contain the same error message. Thank you, Jie Jenn!
@@rohanm9662 Thank you, Rohan. I actually tried the proposed modification. August 23, 2022 I was getting an error ":{"code":"BadRequest","message":"Resource not found for the segment 'messages'."} , September 5, 2022 error ":{"code":"ResourceNotFound","message":"Invalid version: v1.0me"}.
Hi Jenn, Thanks it's very helpful! I want to download attachments from a specific sender with some specific subject line. After that want to upload those attachments to aws s3 buckets without downloading into local.. could please help me to update with the modified code. Would be helpful. Thank you
@@jiejenn Thank please make it as soon as possible it will really helpful..there is not a single video on TH-cam on this topic. With the chat data we can perform various tasks with python libraries 🔥
I had same problem as you and debugged to find out that the response code for attachment_content was 401 which is unauthorized response although I already authenticated. However I forgot to add in the headers (where the access_token is stored) in the get request. It worked after adding headers = headers in the get request
to those who have problems with the downloaded files, 1kb or if it is corrupt file, the problem is Jie forgot to add ,headers=headers in line 17. attachment_content = requests.get( GRAPH_API_ENDPOINT + '/me/messages/{0}/attachments/{1}/$value'.format(message_id, attachment_id), headers=headers )
I can download my outlook attachments with specific subject and then rewrite the attachment file name with current day, but i not sure can do this in api@@TmanD54
to those who have problems with the downloaded files, 1kb or if it is corrupt file, the problem is Jie forgot to add ,headers=headers in line 17.
attachment_content = requests.get(
GRAPH_API_ENDPOINT + '/me/messages/{0}/attachments/{1}/$value'.format(message_id, attachment_id),
headers=headers
)
Thanks!!!!!
Thank you very very much, Appreciated
Thanks a lot for the Video👏. Very Useful one. But I am getting exception.
Exception: {'error': {'code': 'Request_BadRequest', 'message': "Unrecognized query argument specified: 'top,select,filter,count'.
As the error states, your query is incorrect.
Thanks for the video it really helped alot. I am looking for solution to mark mail as read after reading it using graph api.
Thank you for the video. What’s the theme and font you are using.
Hey Tridib, glad the video helped. I am using VS Code with Dark Pro color theme with my own color theme customization.
How can we set up the orderby param? For example, if I want to sort emails by receivedDateTime desc, how would I set up the string corresponding to that param?
what is the maximum size of attachment that we can fetch from the Graph API endpoint ?
Thanks for this. I am getting the following error in the flow variable: "No tenant-identifying information found in either the request or implied by any provided credentials". I'm assuming this means it wants me to pass the tenantID but I don't think generate_access_token() is set up for that. Any ideas?
I got the same response, did you manage to find a fix since?
the attachments remain as corrupted files, I can't find a solution to this, did it happen to you?
to those who have problems with the downloaded files, 1kb or if it is corrupt file, the problem is Jie forgot to add ,headers=headers in line 17.
attachment_content = requests.get(
GRAPH_API_ENDPOINT + '/me/messages/{0}/attachments/{1}/$value'.format(message_id, attachment_id),
headers=headers
)
Hi Jenn, thank you very much for the video. I was able to generate a token and download files with different extensions, however, when you open the downloaded attachments they only have the following: {"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty."}. Any help would be appreciated!
Without looking at your script, I can only guess there could be a typo somewhere.
@@jiejenn Thank you very much for the response! To make sure that there are no typos I tried copying code from your links above. The only change I made is APP_ID and the folder where the attachments need to be saved. I am getting the same error- "Access token is empty." The attachments are saved with different extensions, but they only contain the same error message. Thank you, Jie Jenn!
@@TT-hl3sm try adding ,headers=headers in line 17
@@rohanm9662 Thank you, Rohan. I actually tried the proposed modification. August 23, 2022 I was getting an error ":{"code":"BadRequest","message":"Resource not found for the segment 'messages'."} , September 5, 2022 error ":{"code":"ResourceNotFound","message":"Invalid version: v1.0me"}.
@@TT-hl3sm same problem for me i also can't open the attachments if u clear this say how to do
How can I extract an email body and subject line from a specific user?
Thanks a lot for the video. Can you please help me to export contact photos. I want to use Patch or Put request.
Hi Jenn,
Thanks it's very helpful!
I want to download attachments from a specific sender with some specific subject line. After that want to upload those attachments to aws s3 buckets without downloading into local.. could please help me to update with the modified code. Would be helpful.
Thank you
Hi Vickey, your request is quite specific. I would post your question on Stack Overflow for assistance.
@@jiejenn Thank you
@@vickey8709 Hi Vickey, did you get the solution for this
Hi Vickey, Were you able to find the solution? If yes, could you please share me that
Could you please make video on retrieve MS Teams chat in python?
I will look into it.
@@jiejenn Thank please make it as soon as possible it will really helpful..there is not a single video on TH-cam on this topic.
With the chat data we can perform various tasks with python libraries 🔥
Thanks Jie Jenn
I was able to download the attachments but it seems their size is 1kb and not able to open them
Hard to tell without looking at your script.
I had same problem as you and debugged to find out that the response code for attachment_content was 401 which is unauthorized response although I already authenticated. However I forgot to add in the headers (where the access_token is stored) in the get request. It worked after adding headers = headers in the get request
same with me , all files are of 1 kb , and its opening for me.
to those who have problems with the downloaded files, 1kb or if it is corrupt file, the problem is Jie forgot to add ,headers=headers in line 17.
attachment_content = requests.get(
GRAPH_API_ENDPOINT + '/me/messages/{0}/attachments/{1}/$value'.format(message_id, attachment_id),
headers=headers
)
Can the graph API help in extracting the whole email as a html file
Sure. response can be in either HTML or text format.
@@jiejenn thanks;
Is there a way to download .eml attachment using graph API ?
You should be able to down any file format.
Great video, thank you! However, the link to your site is not working :-(
Thanks for letting me know. I must've changed something on my hosting yesterday. Fixing it right now...
Which user's mailbox is this app id linked to?
To whichever account you authenticated.
hi i want to specific an email address and download the pdf attachment can i use the same cod ?
If you want to use specific email address, replace /me/ with /users/.
@@jiejenn thnx but if u can help im getting this error {"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty.","innerError"
You might have to Google it.
@@jiejenn thnx for your help
Can we download the messege itself in .msg format?
Msg file is specific to Windows Outlook. Are you on a Windows PC?
@@jiejenn yes, outlook with office 365 account
@@NP-zg3hq Because msg is specific to Windows Outlook application, you will have to use VBA to export emails as msg files.
Does it still hold if an email has multiple attachments?
What do you mean? The video is showing how to download multiple attachments already.
how do you get the message ID?
You can use the message list method.
how do i find emails with specific text?
Not sure if I understand your question.
@@jiejenn searching the inbox for specific words in the subject line
how can i make the script download attachment only from a specific sender@@jiejenn
I can download my outlook attachments with specific subject and then rewrite the attachment file name with current day, but i not sure can do this in api@@TmanD54
Don't know where your app id is? please refer to this video th-cam.com/video/1Jyd7SA-0kI/w-d-xo.html for instruction.
Haha, thanks! Was asking God where that came from, but it seems like it was a scroll away! :)))
How to install ms_graph?
You will have to create the module yourself. Source code is in the description.
from where to get app id?
You can refer to this video th-cam.com/video/1Jyd7SA-0kI/w-d-xo.html