Created
November 19, 2012 13:58
-
-
Save nferrari/4110781 to your computer and use it in GitHub Desktop.
PATCH a mailbox through alwaysdata API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
API_URL = 'https://api.alwaysdata.com/v1/' | |
API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
ACCOUNT_NAME = 'account_name' | |
# Updating a mailbox | |
mailbox_id = 12345 | |
mailbox_url = '%smailbox/%d/' % (API_URL, mailbox_id) | |
data = {'sieve_filter': 'my new sieve filter',} | |
response = requests.patch(mailbox_url, auth=('/%s' % ACCOUNT_NAME, API_KEY), data=json.dumps(data)) | |
print response.status_code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good output (status code) should be 2xx.