'description' => 'Access Gmail mailboxes including sending user email.', 'version' => 'v1' 'rootUrl' => 'https://www.googleapis.com/', 'servicePath' => '/gmail/v1/users/', { 'id' => 'gmail:v1', 'title' => 'Gmail API', 'description' => 'Access Gmail mailboxes including sending user email.', 'icons' => { 'x16' => 'https://www.google.com/images/icons/product/googlemail-16.png', 'x32' => 'https://www.google.com/images/icons/product/googlemail-32.png' }, 'name' => 'gmail', 'preferred' => true, 'discoveryRestUrl' => 'https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest', 'version' => 'v1', 'documentationLink' => 'https://developers.google.com/gmail/api/', 'kind' => 'discovery#directoryItem', 'discoveryLink' => './apis/gmail/v1/rest' }, ## SEE ALSO - https://github.com/APIs-guru/openapi-directory/blob/master/APIs/googleapis.com/gmail/v1/swagger.yaml
GOALS
- show summary details pulled from discovery docs
- show all methods in HTML table with description including code snippets for worked examples
- describe helper functions the simplify data handling
- inform improvements to core Modules ( param parsing / validation / feature evolution etc )
- idenitfy opportunities for use in full working applications
LIST
SCOPES TO access messages->list->
'https://mail.google.com/',
'https://www.googleapis.com/auth/gmail.metadata',
'https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.readonly'
GET {userId}/messages/{id}
{
format => [ ... 'full', ],
}
'https://mail.google.com/',
'https://www.googleapis.com/auth/gmail.metadata',
'https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.readonly'
send
'httpMethod' => 'POST'
path' => '{userId}/messages/send',
'mediaUpload' => { accept =>'message/rfc822', maxSize => 35MB, protocols=> {simple=> resumable => }
'https://mail.google.com/',
'https://www.googleapis.com/auth/gmail.compose',
'https://www.googleapis.com/auth/gmail.modify',
'https://www.googleapis.com/auth/gmail.send'
review_emails_from_last_month_using_agent( $gapi )
A simple email send example. Creates an encoded RFC
TODO: * handle pagination where results list exceeds single query response maximimum - indicated by tokens in reponse
REFERENCES: construct 'q' query filters as per https://support.google.com/mail/answer/7190?hl=en
get_email_content_from_id_using_agent( $id, $gapi )
Get a single email and extract content
TODO: extract the attachments
send_email_to_self_using_client( $gapi )
A simple email send example. Creates an encoded RFC
TODO: * refactor to use email address from config file
NAME
gmail_example.pl - gmail service examples
VERSION
version 0.04
SYNOPSIS
gmail_example.pl [gapi.json]
Assumptions
* scope within gapi.json authorises read access to Gmail APIs
AUTHOR
Peter Scott <peter@pscott.com.au>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by Peter Scott.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.