Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an API to get a list of gmail filters and update them? [closed]

Google Apps has an "Google Apps Email Settings API" which allows to create a new mail filter via an API call.

Is there any (perhaps undocumented) way to get the list of current filters and update them?

like image 822
Udi Avatar asked Mar 07 '13 18:03

Udi


People also ask

Is there a way to search Gmail filters?

Manage search filters in GmailFrom Gmail home, click Settings in the upper-right corner (represented by a gear icon). Select See all settings. Move to the Filters and Blocked Addresses tab. Check all the created filters in action.

Is there an API for Gmail?

The Gmail API is a RESTful API that can be used to access Gmail mailboxes and send mail. For most web applications the Gmail API is the best choice for authorized access to a user's Gmail data and is suitable for various applications, such as: Read-only mail extraction, indexing, and backup.

How do I automate Gmail API?

Setup the Gmail API The MFA service check will access the Gmail account to get the MFA code requested from the web page. First, we have to enable the API and authenticate to Gmail. This can be done by following their Quickstart guide. Click the “ENABLE THE GMAIL API” form button to generate the credentials.


1 Answers

A Filter object was added to the API that allows for filter processing, including retrieval, creation and deletion.

https://developers.google.com/gmail/api/guides/filter_settings

Specifically:

Listing Filters

GET https://www.googleapis.com/gmail/v1/users/userId/settings/filters

Returns a JSON list of Filter objects

Retrieving a specific Filter

GET https://www.googleapis.com/gmail/v1/users/userId/settings/filters/id

Returns a single JSON Filter object

Deleting a specific Filter

DELETE https://www.googleapis.com/gmail/v1/users/userId/settings/filters/id

Creating a Filter

POST https://www.googleapis.com/gmail/v1/users/userId/settings/filters

With a JSON encoded Filter in the request body.

While the REST URLs have v1 in the address, they are linked from the current documentation. Also note, GMail API migration is currently in progress, and the deprecated API will cease to function as of July 2016. Keep this in mind, as the API may change.

like image 142
GCon Avatar answered Oct 13 '22 10:10

GCon