This allows users to notify meetings/appointments via email. The form with required fields should be filled about the meeting/appointment and an email will be sent to the invitees of the meeting/appoinment along with the details. The relevant fields that are to be filled is prompted in the command line when you invoke the service through client.bal
| Version | |
|---|---|
| Ballerina Language | 0.990.3 |
| Gmail API | v1 |
Obtaining Tokens to Run the program
- Visit Google API Console, click Create Project, and follow the wizard to create a new project.
- Go to Credentials -> OAuth consent screen, enter a product name to be shown to users, and click Save.
- On the Credentials tab, click Create credentials and select OAuth client ID.
- Select an application type, enter a name for the application, and specify a redirect URI (enter https://developers.google.com/oauthplayground if you want to use OAuth 2.0 playground to receive the authorization code and obtain the access token and refresh token).
- Click Create. Your client ID and client secret appear.
- In a separate browser window or tab, visit OAuth 2.0 playground. Click on the
OAuth 2.0 configurationicon in the top right corner and click onUse your own OAuth credentialsand provide yourOAuth Client IDandOAuth Client secret. - Select the required Gmail API scopes from the list of API's, and then click Authorize APIs.
- When you receive your authorization code, click Exchange authorization code for tokens to obtain the refresh token and access token.
You can now enter the credentials in main.bal file
string accessToken = "<Your Access Token >";
string clientId = "<Your Client ID>";
string clientSecret = "<Your Client Secret>";
string refreshToken = "<Your Refresh Token>";The module structure is as follows:
Ballerina-meeting
├── client.bal
└── meeting-notifier
└── main.bal
└── service.bal
- Start the meeting notifier service
$ ballerina run meeting-notifier
- Run the client that request the service
$ ballerina run client.bal
- Fill out the required fields accordingly