Skip to content

Built an API in NodeJS using express to send emails using the Gmail REST API without using client libraries.

Notifications You must be signed in to change notification settings

rpriyanshu9/gmail-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API documentation

Notes to use the API

Please use this live endpoint to test this API, as the authorized redirect endpoint used in Oauth 2.0 settings contains this live url only. The application won't run properly on localhost.

live endpoint : https://rpriy-gmail-oauth2.herokuapp.com

Get client credentials using OAuth 2.0

Endpoint : GET method

NOTE : Use this endpoint from a browser for best experience, as this endpoint will redirect you to the Oauth consent screen.

/oauth20/getClientCredentials

Send Email

Endpoint : POST method

/mail/sendmail

JSON body required

{
    "sendTo": "[email protected]",
    "subject": "Dummy subject",
    "messageToSend": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio modi sed tempora ipsa error minus veritatis eos est in saepe."
}

Logout

Endpoint : POST method

/mail/logout

About

Built an API in NodeJS using express to send emails using the Gmail REST API without using client libraries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published