ben
ben

Reputation: 6180

a Ruby script to use gmail RESTful API

you may help me here. I want to write a script using Ruby, which sends emails on behalf of a user who gives permission to send emails to his contacts using gmail restful api (link to view). So I found Gmail API Client Library for Ruby, and I am getting stuck while trying to use it.

Now my question is which would is the best way to make a script using the gmail API, which will ask the user permission to send email on his behalf and save the access token, then fetch all his contact email addresses and any other permitted info in json preferably and finally setup the system to save a given email content file on his behalf to a selected friend/friends.How will I authenticate the users accounts from the terminal? will it be Simple API access (API keys) or Authorized API access (OAuth 2.0)?? whats the difference by the way?

Please advise the best tools, and other resources.

Upvotes: 0

Views: 434

Answers (1)

Eric D
Eric D

Reputation: 7159

Use Oauth2 as it says in the API docs: https://developers.google.com/gmail/api/auth/about-auth

If you have more specific questions, please write them. As it is now your question seems a bit general.

See: https://developers.google.com/accounts/docs/OAuth2#installed for examples on how to do Oauth2 authentication from different environments.

Upvotes: 1

Related Questions