Exposing the Gmail API from R.
my_drafts = drafts()
my_history = history(start_num)
my_labels = labels()
my_messages = messages("search query")
my_threads = threads("search query")
modify_thread(thread_id, add_labels=c("label_1"), remove_labels=c("label_2"))
trash_message(message_id)
trash_thread(thread_id)
untrash_message(message_id)
untrash_thread(thread_id)
delete_message(message_id)
delete_thread(thread_id)
By default gmailr will use a global project. However if you are going to be doing a heavy user and will do a lot of queries please setup your own project with the steps below.
APIs
On
, and other API status to Off
APIs & auth->Consent screen
APIs & auth->Credentials
Use the downloaded JSON file as input to gmail_auth()
R gmail_auth('file.json')