0% found this document useful (0 votes)
70 views15 pages

A Survey Paper On: Gmail API Services and Importing PDF'S.: Authors

The document discusses Gmail API services and converting PDFs to Excel. It provides an overview of the Gmail API and how third-party applications can access user data from Gmail with user permission. It also describes a code to convert PDF transaction notes to a datatable that can then be inserted into an Excel file for further analysis and updating.

Uploaded by

keerthana r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views15 pages

A Survey Paper On: Gmail API Services and Importing PDF'S.: Authors

The document discusses Gmail API services and converting PDFs to Excel. It provides an overview of the Gmail API and how third-party applications can access user data from Gmail with user permission. It also describes a code to convert PDF transaction notes to a datatable that can then be inserted into an Excel file for further analysis and updating.

Uploaded by

keerthana r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

A Survey Paper on : Gmail API Services and Importing

pdf’s.

Authors :
Keerthana.R M Parameshwar Reddy
Computer science engineering Computer science engineering
Presidency University Presidency University

Abstract :
Dealing with all sorts of Mobile Applications and Web Applications has become
a part of day to day life, and on this note many applications use our data which
in turn would be granted by us for our benefits. In this report we will be talking
about one such implementation of accessing the users data by the third party
applications. For the readers knowledge there are many third party
applications looking into your data which can be even your gmail inbox.
Moreover this is done for the benefit of both the application and the user , but
only with the permission of the user.

In this report we will continue to talk about how can a third party application
get access to the users data implementing the Google services with few
important steps mentioned and explained ,and other services provided by
google for the applications to easily integrate it in the applications developed
by them. Along side the importance of converting a pdf into excel.

Converting a pdf into excel is implemented with the help of a c# code, thus
providing an assurance that the contents of the pdf would not be changed and
future analysis and updating these excel contents can be more productive.
Introduction :
Many would be wondering how does Google give Access to such data
requested by the application. Google always reminds the user that the one
click of our Allow button can give access to third party applications to access
data. Moreover it is mandatory for the application to prove that the developer
of the application is an authorized Google user. The Gmail Api provides such
service where the developers of the application can send an HTTPRequest
requesting these google services, and they obtain back what they have
requested for if the user consent is allowed.

In a PDF document, contents are often formed by text. If the management


think that contents are useful for them or can be takes as template, they may
need to extract text from PDF and save as other format document. If they get
many transaction notes PDF and they can’t enter the details everytime into
their database. Because, PDF contains huge amount of data and many decimal
values .Each PDF contains so many transactions and there will be a mistake if
anyone tries to type it into a excel file. We need to do a task that program will
read text from the PDF and convert that text into datatable and after that
inserting those datatables into excel file.

Why Gmail API was introduced:

Back in the midst of distant past there was email, many email systems were
closed meaning that we had to use a specific application to manage mails, this
made it hard for people who had multiple clients/ accounts to manage emails.

So IMAP was born, IMAP is a protocol designed for email client to connect to
email services. IMAP was designed to allow full flegged email client to connect
to an email service. Gmail initially introduced IMAP support in 2007 specifically
with a goal of making it easy to use mobile device email apps to access your
gmail account. Then things got interesting, Once Gmail opened up to IMAP ,
the developers community realized that there is now a way to enable users to
add features that used the Gmail data. These developers went way beyond
building simple email client , like adding a record of messages, useful utilities
to manage email subscriptions or allow you to send mail at a later date.
Developers even wrote custom chrome extensions which talk to IMAP and
extend the Gmail UI. All of these were good, but IMAP was designed to handle
kind of mail box people used to have. It was intended to scale to hundered of
thousands of messages in inbox, In 2004 Gmail revolutionized inbox by giving
you 1 GB storage giving you the ability to stop wasting time sorting folders and
instead use powerful queries to search labels. Despite the decade since IMAP
was launched it still does not have standards to support the revolutionary way
the gmail interacted with users. So, the new gmail api was introduced. The
new Gmail api provides very simply, with Restful access to threads messages,
and Labels including drafts ,in contrast to IMAP which requires access to all the
users Messages for all Operations, the new Api gives fine grained control to
users mail box. To keep in sync, the Api allows you to query the inbox change
history. Most importantly the Api was designed to make it easy and efficient to
do specific queries such as get the messages exchanged with so and so person.
Api offers full serach capabilities, since the gmail api is the standard Google api,
you get simple HTTPS access services using Restful calls.

Thus with the introduction of the Gmail api the developers can have the
Restfull access to the required user’s data. This has revolutionized the way
applications access the users data.
The Gmail API gives you flexible, RESTful access to the user's inbox, with a
natural interface to Threads, Messages, Labels, Drafts, History, and. Settings.
From the modern language of your choice, your app can use the API to add
Gmail features like:

 Read messages from Gmail

 Send email messages

 Modify the labels applied to messages and threads

 Search for specific messages and threads

 Create filters to automatically label, forward, or archive messages

All you need to use the Gmail API is the client library for your choice of
language and an app that can authenticate as a Gmail user.

The Gmail API can be used in a variety of different applications, including,


typically:

 Read-only mail extraction, indexing, and backup

 Label management (add/remove labels)

 Automated or programmatic message sending

 Migrating email accounts from other providers

 Set standardized email signatures for users in a domain


Auth and the Gmail API

Like other Google REST APIs, the Gmail API uses OAuth 2.0 to handle
authentication and authorization. Your app will specify one or more scopes:
strings which identify resources that it needs to access. These scopes are used
together with a set of tokens to secure a user's access to resources. A scope
represents a particular form of access to a single resource or to a group of
resources, for example:

 Read a message from Gmail


(https://www.googleapis.com/auth/gmail.readonly)

 Change labels applied to a thread or message


(https://www.googleapis.com/auth/gmail.modify)

 Send a message on behalf of a user


(https://www.googleapis.com/auth/gmail.compose)

Although you can code the web service authorization calls explicitly, you
normally should simplify your app by using the Google API client libraries
available for many programming languages.

Scopes

The Gmail API supports a number of fine-grained authorization scopes to allow


only the level of access required. By requesting the minimum level of access
required, users feel more confident granting access to their mailbox.
Example use case

Consider the following use case: printing out a page of threads for the
currently authenticated user (for example, in a recent messages panel). To
achieve this, your app would perform the following steps:

1. Authenticate as the user, using


the https://www.googleapis.com/auth/gmail.readonly scope.

2. Call the API method. GET


https://www.googleapis.com/gmail/v1/users/<userId>/threads

3. Process the returned list of threads in your app.

Thus the gmail api provides an end to end service from getting the
authorization done till obtaining the required users data.

Here are few statements given on third part access to users data by google by
renowned Individuals :

 Developers may share data with third parties so long as they are
transparent with the users about how they are using the data," said the
report, quoting from a Google letter sent to the US Senators .
 Google also makes "the privacy policy easily accessible to users to review
before deciding whether to grant access", said Susan Molinari, Vice
President of Public Policy and Government Affairs for the Americans at
Google, in the letter.
 According to Google, it gives both enterprise admins and individual
consumers transparency and control over how their data is used.
"We make it possible for applications from other developers to integrate
with Gmail -- like email clients, trip planners and customer relationship
management (CRM) systems -- so that you have options around how you
access and use your email," said Suzanne Frey, Director, Security, Trust
and Privacy, Google Cloud.
 Before a published, non-Google app can access your Gmail messages, it
goes through a multi-step review process at the company, it said.
"It includes automated and manual review of the developer, assessment
of the app's privacy policy and homepage to ensure it is a legitimate app,
and in-app testing to ensure the app works as it says it does," Frey
noted.

Analysis on Gmail api service :

There is much content on the internet that tells us what is Gmail APi and
the services that gmail Api provides. There are many guides available on
the internet which Explains how to use the these gmail Api services and
include them in the applications that we are going to develop. But we
couldnot find the mention of the names where and who is making use of
this services. Because Gmail api services such as Google Authentication
has become a part of every application that we use today. Every
application such as Facebook or Instagram accounts can be created only
with your Google credentials.

Google credentials have become so much mandatory for us to use any


application.

As mentioned earlier if the developers cant get access to the mails of its
users it becomes tough for them to manage their mails, thus gmail
access is crucial for few application that deal with these data of users,
But as mentioned earlier the transparency of data between the users
and the application is important as well as the assurance that the data is
secured by the developed application.

Here we will talk about the Application we developed that makes use of
the users data abstractly to just brief the reader how this flow happens.

The application developed makes use of the (inbox)data of its users for
continuously monitoring the users with the important information that
they have to give heed on. Initially this service has to be implemented in
the application with the Gmail Api services. Then the permission or the
consent from the user is obtained that the user will allow this
application to access the data it had required for. If the user consent is
provided then the Gmail Api will provide the application access to the
data it is requesting for.

And if the user no longer wants this application to access the inbox data
then the user can login to gmail and stop the application from using the
data further.
Advantages :

 Implemeting Gmail APi services reduces the burden on the developer of


the application.

Example : integrating the Google authentication into the web application


reduces the burden on the developers.

 It reduces the length of the code


 By direct http request the data can be obtained.
 If the access token is obtained then there can be a offline access to the
users data.
 Easy queries that help us the developer to get the data required in less
amount of time.
 Highly reliable service.
 This improves the business performance of the developers.
 This even helps the users to handle all their data.

Comparitive analysis on using manual typing and programmatic


conversion of Pdf into excel:

1.Reading
Manual Reading:
 When we are typing data, sometimes there will be typing mistakes.
 Sometimes there will be lot of decimal numbers, they may be go wrong
if we are typing fastly.
 If we compare the two photos which are below, there is typo mistake in
the highlighted area.
Automatic Reading:

 Through iTextSharp nuget package we can easily read the total pdf
without any mistakes.
 By using regular expressions we can divide data.
 To avoid above mistakes our program is very useful.
 If we compare the two photos now, there is no any mistake in actual pdf
and excel file.
2.Time

Manual Typing:

The minimum time required for manual typing is half hour.

Automatic Typing:

Time taken for automatic typing is 1 millisecond.


3.Calculation:

Manual Calculation:

If we want to calculate any details in calculator, it will take more time.

Automatic Calculation:

To reduce time and calculation mistakes our program is very useful.

4.Work

Manual:

 When you are doing manully sometimes you may not present because of
personal reasons.
 At that point of time, work will be delayed.
Automatic:

 To avoid above problem our program is very useful.


 Whenever you get a new pdf into a specific folder, it will automatically
send the whole data into our database.

Improvement:

 Our program reduce the time and give benefits to office workers.
 There will be no delay in time.

Conclusion on Gmail APi services :

Gmail api services have a wide range of services which are beneficial to the
developers. Implementing the gmail api services into an application not only
makes the work go easier but also reduces the burden on both the developer
and the user. And noting that the security on the users data is most crucial the
application is verified before granting the access, and the access is granted inly
after the users consent. It is even important from the users view that they
make sure that they trust the developer of the application before granting the
access.

Conclusion on importing PDF’s :

àDesigning of a PDF code to get the Contract Note Details.

àTo insert all datatables into a database.


àEach and every class should be in private, so that there should be no third
party intervention.
àITextSharp should read the information from PDF file.
àUsing C# we need to get the information sequentially through regex.
REFERENCES :

[1]. https://www.outlookindia.com/website/story/google-still-permits-third-
party-apps-to-read-your-gmail/316897.

[2]. https://developers.google.com/gmail/api/guides.

[3]. [Author]Jhon Re Grant, Google Project Manager: Introducing Gmail Api.

[4]. https://www.toolsqa.com/selenium-webdriver/c-sharp/data-driven-
testing/
[5]. https://www.dotnetperls.com/datatable
[6].https://docs.microsoft.com/enus/dotnet/api/system.data.datatable?
view=netcore-3.1

You might also like