The next step is to select a quickstart guide according to the technology your app is built with. Download a JSON file with your credentials – you’ll need it later. Also, enter JavaScript origins and redirect domains for use with requests from a browser or a web server, respectively. Fill in other fields if you want.Ĭlick save and then pick the type of your app (web app, Android, Chrome App, iOS, or other). You can just enter the name of your app and specify authorized domains. It will bring you to a page with many fields. You’ll see the Configure consent screen button. So, click the Credential tab on the left, and then pick OAuth client ID from the drop-down list of the Create Credentials button. We advise you to go another way since we already know what it is: OAuth client ID. If you click Create credentials, you’ll have to pass through a set of questions to find out what kind of credentials you need. Once the API is enabled, you’ll be taken to a nice dashboard that says, “ To use this API, you may need credentials”. Step 3: Credentials and authentication with OAuth 2.0 Note that you’ll have to enable it separately for each new project you work on. Now, you need to enable the API for your project. Enter “ Gmail API” in the search bar and click on it once found. Once that’s done, you can press the Library tab on the left and find yourself in the API Library page. Name your new project and press Create at the bottom. Then click Select a project and create a new one. Those who visit this page for the first time ever will have to agree with the Terms of Service and pick their Country of residence. If you want to have access to your Gmail from your mobile or web app, you should start with Google Developers Console. How to make your app send emails with Gmail API Step 1: Create a project at Google API Console updateVacation (updating vacation responder settings).getVacation (vacation responder settings).updateLanguage (updating language settings). updateAutoForwarding (updating the auto-forwarding setting).getAutoForwarding (auto-forwarding setting).list (listing the history of all changes to the mailbox).patch (patching the specified label) – this method supports patch semanticsĪ collection of changes made to the mailbox.untrash (transferring the specified thread from the trash)Ī resource to organize messages and threads (for example, inbox, spam, trash, etc.).trash (transferring the specified thread to the trash).modify (modifying labels in the thread).untrash (transferring the specified message from the trash)Ī collection of messages within a single conversation.trash (transferring the specified message to the trash).send (sending the specified message according to the To, Cc, and Bcc headers).modify (modifying labels on the specified message).insert (inserting the message into the mailbox (similar to IMAP).import (importing the message into the mailbox (similar to receiving via SMTP)).delete (removing the specified message).batchModify (modifying labels on the specified messages).batchDelete (removing messages by message ID).update (updating the specified draft’s content)Īn immutable resource that you cannot modify.send (sending the specified draft according to the To, Cc, and Bcc headers).With Gmail API, you can deal with several resource types and manage them using the following methods: Resource typeĪn unsent message that you can modify once created Mail migration from other email services.Also, you can use this option for versatile cases like: CRUD (create, read, update, and delete) operations with messages, drafts, threads, and labelsĭevelopers love Gmail API because it’s easy to implement.Send and receive emails with attachments.The API provides you with a RESTful access to the features you usually have with Gmail: Gmail API – why you should consider using it That’s why we decided to flesh out how to send emails with Gmail API. It is safe and credible, which is crucial to preventing your emails from going into the spam folder. Gmail is one of the most popular email services, and you very well may want to use it as a mailbox for your web or mobile app.
0 Comments
Leave a Reply. |