Closed jim0wheel closed 7 years ago
Full console output:
> library(gmailr)
>
> setwd("D:/R Data")
>
> my_message = messages("report", 1, NULL, TRUE)
Auto-refreshing stale OAuth token.
>
> messageid = id(my_message,"message_id")
Error in !drop : invalid argument type
In addition: Warning message:
id() is deprecated
>
> path = "C:/Users/xxx/Desktop""
>
> attachments = save_attachments(message(messageid),NULL,path,"me")
Error: is_string(id) is not TRUE
Can you run traceback()
after the error message?
2: id_var(.variables[[1]], drop = drop)
1: id(my_message, "message_id")
The values I'm getting are as follows:
> my_message
message_id thread_id
1 15e9e1538b37a6c8 15e7a3e2d71cefb2
> messageid
$messages
$messages[[1]]
$messages[[1]]$id
[1] "15e9e1538b37a6c8"
$messages[[1]]$threadId
[1] "15e7a3e2d71cefb2"
$resultSizeEstimate
[1] 8
The id issue is because you have dplyr attached and it also has an id()
function. use gmailr::id()
to make sure you are calling the gmailr function.
What an idiot! That fixed it! Thanks Jim!
I'm trying to save the attachment from the most recently received email, but getting the following error message when using the
id()
function:Full code below: