Learn more about our current job openings and benefits of working at FSL.
Detailed reviews and feedback from past and current clients.
Get to know the Management Team behind FullStack Labs.
Our step-by-step process for designing and developing new applications.
Writings from our team on technology, design, and business.
Get answers to the questions most frequently asked by new clients.
Learn about our company culture and defining principles.
A high level overview of FullStack Labs, who we are, and what we do.
A JavaScript framework that allows rapid development of native Android and IOS apps.
A JavaScript framework maintained by Facebook that's ideal for building complex, modern user interfaces within single page web apps.
A server side programming language known for its ease of use and speed of development.
A lightweight and efficient backend javascript framework for web apps.
An interpreted high-level programming language great for general purpose programming.
A JavaScript framework maintained by Google that addresses many of the challenges encountered when building single-page apps.
A JavaScript framework that allows developers to build large, complex, scalable single-page web applications.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
View a sampling of our work implemented using a variety of our favorite technologies.
View examples of the process we use to build custom software solutions for our clients.
View projects implemented using this javascript framework ideal for building complex, modern user interfaces within single page web apps.
View projects implemented using this framework that allows rapid development of native Android and IOS apps.
View projects implemented using this backend javascript framework for web apps.
View projects implemented using this high-level programming language great for general purpose programming.
View projects implemented using this server side programming language known for its ease of use and speed of development.
We have vast experience crafting healthcare software development solutions, including UI/UX Design, Application Development, Legacy Healthcare Systems, and Team Augmentation. Our development services help the healthcare industry by enhancing accessibility, productivity, portability, and scalability.
We offer a range of custom software development solutions for education companies of all sizes. We're experts in Education Software Development and specialists in enhancing the learning experience across web, mobile, and conversational UI.
We're experts in developing Custom Software Solutions for the Logistics Industry. Our work offered a whole new and more efficient way for Logistics companies to manage their crucial operations.
We partner with various construction industry organizations to build custom software development solutions. Our Construction Software Development Services allow construction companies to manage projects, resources, and documentation.
We have vast experience crafting healthcare software development solutions, including UI/UX Design, Application Development, Legacy Healthcare Systems, and Team Augmentation. Our development services help the healthcare industry by enhancing accessibility, productivity, portability, and scalability.
We offer a range of custom software development solutions for education companies of all sizes. We're experts in Education Software Development and specialists in enhancing the learning experience across web, mobile, and conversational UI.
We're experts in developing Custom Software Solutions for the Logistics Industry. Our work offered a whole new and more efficient way for Logistics companies to manage their crucial operations.
We partner with various construction industry organizations to build custom software development solutions. Our Construction Software Development Services allow construction companies to manage projects, resources, and documentation.
Learn more about our current job openings and benefits of working at FSL.
Detailed reviews and feedback from past and current clients.
Get to know the Management Team behind FullStack Labs.
Our step-by-step process for designing and developing new applications.
Writings from our team on technology, design, and business.
Get answers to the questions most frequently asked by new clients.
Learn about our company culture and defining principles.
A high level overview of FullStack Labs, who we are, and what we do.
A JavaScript framework that allows rapid development of native Android and IOS apps.
A JavaScript framework maintained by Facebook that's ideal for building complex, modern user interfaces within single page web apps.
A server side programming language known for its ease of use and speed of development.
A lightweight and efficient backend javascript framework for web apps.
An interpreted high-level programming language great for general purpose programming.
A JavaScript framework maintained by Google that addresses many of the challenges encountered when building single-page apps.
A JavaScript framework that allows developers to build large, complex, scalable single-page web applications.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A dynamic programming language used in all sorts of web and mobile applications.
A cross-platform programming language designed to run robust applications on any device.
A UI toolkit used to build natively compiled applications from a single codebase.
A functional programming language that’s ideal for scalability, maintainability, and reliability.
A Customer Relationship Management (CRM) platform that seamlessly integrates with your business operations.
A high-performance programming language that makes it easy to build simple, reliable, and efficient software.
View a sampling of our work implemented using a variety of our favorite technologies.
View examples of the process we use to build custom software solutions for our clients.
View projects implemented using this javascript framework ideal for building complex, modern user interfaces within single page web apps.
View projects implemented using this framework that allows rapid development of native Android and IOS apps.
View projects implemented using this backend javascript framework for web apps.
View projects implemented using this high-level programming language great for general purpose programming.
View projects implemented using this server side programming language known for its ease of use and speed of development.
The Gmail API grants secure access to messages, threads, and labels and allows developers to create a variety of different applications for mail indexing, label management, and message sending.
In this tutorial, you will learn how to create a simple app that can grant access to a Gmail account, filter the list of messages, and assign them a specific label. The code shown here is written in Node.js but you can easily adapt it to your preferred language.
First, create a project in the Google Developers Console. Visit https://console.developers.google.com/ and log in, then click on Select a project > NEW PROJECT.
Navigate to the Library, search for the Gmail API and enable it.
Before creating the credentials, configure the OAuth consent screen by clicking on the button CONFIGURE CONSENT SCREEN.
Select the User Type depending on the users who will be able to use the application.
Type the application name and click Save.
In the left menu, click on Credentials > CREATE CREDENTIALS, and select OAuth client ID.
Select the application type and enter a name for the credentials.
You should be able to see the new credentials under the OAuth 2.0 Client IDs section. Click on the download icon to download the credentials file. Then rename it to credentials.json.
Navigate to the Node.js Quickstart page, copy the quickstart example provided by Google, and save it in a file named index.js.
In the Terminal window, go to the Working Directory where you created the file index.js, and run the command yarn add googleapis@39 to install the Gmail API library.
Then run the command node . to execute the sample code. The first time you will be asked to authorize the application by visiting a URL like the example below. Open that URL in a browser and follow the steps. At the end, you will get a code that you have to paste in the terminal window right where it says “Enter the code from that page here.”
-- CODE language-javascript keep-markup --
Authorize this app by visiting this url: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly&response_type=code&client_id=479559853488-050lms0ffusprdhh938s954q0s36kg4i.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob
Enter the code from that page here:
After the app is successfully authorized, a list of the current labels from the user’s mailbox is shown.
-- CODE language-javascript keep-markup --
Labels:- CATEGORY_PERSONAL
- CATEGORY_SOCIAL
- CATEGORY_UPDATES
- CATEGORY_FORUMS
- CATEGORY_PROMOTIONS
- CHAT
- SENT
- INBOX
- TRASH
- DRAFT
- SPAM
- STARRED
- UNREAD
The authorize function in the quickstart example is in charge of validating the credentials and generating the token. You have to send the constant oAuth2Client as a parameter for the functions listed in the next sections.
-- CODE language-javascript keep-markup --
functionauthorize(credentials, callback) {
...
const oAuth2Client = new google.auth.OAuth2(
client_id, client_secret, redirect_uris[0]);
...
}
Now, in order to be able to manage the labels of the messages, you need to change the initial scope from gmail.readonly to gmail.modify.
-- CODE language-javascript keep-markup --
const SCOPES = ['https://www.googleapis.com/auth/gmail.modify'];
Also, delete the token.json file from your working directory.
Then, go to the listLabels function and add the label id in the console log.
-- CODE language-javascript keep-markup --
functionlistLabels(auth) {
...
labels.forEach((label) => {
console.log(`- ${label.name} : ${label.id}`);
});
...
}
Finally, run the application by using the command node . to authorize the app again and update the access permissions. You should be able to see the label list but now each label with its corresponding id.
-- CODE language-javascript keep-markup --
Labels:
- CATEGORY_PERSONAL : CATEGORY_PERSONAL
- CATEGORY_SOCIAL : CATEGORY_SOCIAL
- CATEGORY_UPDATES : CATEGORY_UPDATES
- CATEGORY_FORUMS : CATEGORY_FORUMS
- CATEGORY_PROMOTIONS : CATEGORY_PROMOTIONS
- CHAT : CHAT
- PENDING : Label_11
- SENT : SENT
- INBOX : INBOX
- TRASH : TRASH
- DRAFT : DRAFT
- SPAM : SPAM
- STARRED : STARRED
- UNREAD : UNREAD
The list messages function uses the gmail.users.messages.list to list the messages that meet the criteria given by the query param.
-- CODE language-javascript keep-markup --
functionlistMessages(auth, query) {
return new Promise((resolve, reject) => {
const gmail = google.gmail({version: 'v1', auth});
gmail.users.messages.list(
{
userId: 'me',
q: query,
},
(err, res) => {
if (err) {
reject(err);
return;
}
if (!res.data.messages) {
resolve([]);
return;
}
resolve(res.data.messages);
}
);
})
;}
You can call this function as follows:
-- CODE language-javascript keep-markup --
const messages = await listMessages(oAuth2Client, 'label:inbox subject:reminder');
This will retrieve all messages from the inbox with a subject that includes the word “reminder.”
You can modify the label of any message by using this function.
-- CODE language-javascript keep-markup --
functionmodifyLabels(auth, messageId, addLabelIds, removeLabelIds) {
returnnew Promise((resolve, reject) => {
const gmail = google.gmail({version: 'v1', auth});
gmail.users.messages.modify(
{
id: messageId,
userId: 'me',
resource: {
addLabelIds,
removeLabelIds,
},
},
(err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
return;
}
);
});
}
Loop through the previous messages. Call the modifyLabels functions with the right parameters.
This call will remove the INBOX label and will add the PENDING label to all the messages. Label_11 is the id of the label PENDING that we created using the Gmail site.
-- CODE language-javascript keep-markup --
messages.forEach(msg => {
modifyLabels(oAuth2Client, msg.id, [Label_11], ['INBOX']);
})
For sake of simplicity, we created and retrieved the id of the PENDING label manually. However, the Gmail API provides the methods that will let you do that programmatically. We encourage you to check the API Reference by visiting Gmail API Documentation.
Let us know how you did!
Using techniques like what is listed above, we have had the opportunity to address our clients’ concerns and they love it! If you are interested in joining our team, please visit our Careers page.
---
At FullStack Labs, we are consistently asked for ways to speed up time-to-market and improve project maintainability. We pride ourselves on our ability to push the capabilities of these cutting-edge libraries. Interested in learning more about speeding up development time on your next form project, or improving an existing codebase with forms? Contact us.
We’d love to learn more about your project.
Engagements start at $75,000.