### Install Mailchimp3 Python Client Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Instructions to install the `mailchimp3` Python client from PyPi using the pip package manager. ```Python pip install mailchimp3 ``` -------------------------------- ### Common MailChimp API Operations Examples Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst A collection of common API calls demonstrating how to interact with MailChimp lists, members, and campaigns, including retrieving all items, getting a specific item, and creating new members with merge fields. ```python # returns all the lists (only name and id) client.lists.all(get_all=True, fields="lists.name,lists.id") # returns all members inside list '123456' client.lists.members.all('123456', get_all=True) # return the first 100 member's email addresses for the list with id 123456 client.lists.members.all('123456', count=100, offset=0, fields="members.email_address") # returns the list matching id '123456' client.lists.get('123456') # add John Doe with email john.doe@example.com to list matching id '123456' client.lists.members.create('123456', { 'email_address': 'john.doe@example.com', 'status': 'subscribed', 'merge_fields': { 'FNAME': 'John', 'LNAME': 'Doe' } }) # returns all the campaigns client.campaigns.all(get_all=True) ``` -------------------------------- ### Install MailChimp Python Client via pip Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Instructions for installing the `mailchimp3` Python client library using pip, the Python package installer. ```bash pip install mailchimp3 ``` -------------------------------- ### Initialize MailChimp API Client Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Example of initializing the MailChimp client with an API key and an optional username. This requires importing the `MailChimp` class from the `mailchimp3` library. ```Python from mailchimp3 import MailChimp client = MailChimp(mc_api='YOUR_API_KEY', mc_user='YOUR_USERNAME') ``` -------------------------------- ### Mailchimp API GET Request and Response Log Example Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Illustrates a direct HTTP GET request to the Mailchimp API v3.0 '/lists' endpoint, filtering results to include only the 'date_created' field. Shows the successful 200 OK response with a truncated list of created dates, as it would appear in a log file. ```APIDOC GET Request: https://us15.api.mailchimp.com/3.0/lists?fields=lists.date_created GET Response: 200 {"lists":[{"date_created":"2017-05-10T13:53:05+00:00"},{"date_created":"2017-08-22T20:27:56+00:00"},{"date_created":"2017-05-12T21:22:15+00:00"},{"date_created":"2017-04-27T17:42:04+00:00"},{"date_created":"2017-05-10T14:14:49+00:00"},{"date_created":"2017-05-10T13:52:37+00:00"},{"date_created":"2017-05-10T13:51:40+00:00"}]} ``` -------------------------------- ### Retrieve a Single MailChimp List by ID Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Example of fetching a single MailChimp list by its unique identifier. This uses the `client.lists.get` method to retrieve detailed information for a specific list. ```python client.lists.get('123456') ``` -------------------------------- ### Automation Actions API Endpoint Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Documents the actions available for MailChimp automations, specifically pausing or starting a workflow using its ID. These methods control the active state of an automation. ```APIDOC client.automations.actions.pause(workflow_id='') client.automations.actions.start(workflow_id='') ``` -------------------------------- ### Authorized Apps API Endpoint Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Details the methods available for interacting with authorized applications via the MailChimp API. This includes creating new authorized apps, retrieving all existing apps, or getting a specific app by its ID. ```APIDOC client.authorized_apps.create(data={}) client.authorized_apps.all(get_all=False) client.authorized_apps.get(app_id='') ``` -------------------------------- ### Automation Email Actions API Endpoint Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Documents the actions available for individual emails within MailChimp automations, allowing pausing or starting a specific email by its workflow and email IDs. These actions control the delivery of automation emails. ```APIDOC client.automations.emails.actions.pause(workflow_id='', email_id='') client.automations.emails.actions.start(workflow_id='', email_id='') ``` -------------------------------- ### Manage Mailchimp Store Product Variants Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods allow for comprehensive management of product variants within a Mailchimp store. You can retrieve all variants, get a specific variant, update existing ones, create new ones, or delete them. ```APIDOC client.stores.products.variants.all(store_id='', product_id='', get_all=False) client.stores.products.variants.get(store_id='', product_id='', variant_id='') client.stores.products.variants.update(store_id='', product_id='', variant_id='', data={}) client.stores.products.variants.create_or_update(store_id='', product_id='', variant_id='', data={}) client.stores.products.variants.delete(store_id='', product_id='', variant_id='') ``` -------------------------------- ### Retrieve Mailchimp List Growth History Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods provide access to the growth history of a Mailchimp list. You can retrieve all growth history records or get a specific record by month. ```APIDOC client.lists.growth_history.all(list_id='', get_all=False) client.lists.growth_history.get(list_id='', month='') ``` -------------------------------- ### Manage Mailchimp Files Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods provide functionality to interact with files stored in Mailchimp. You can create new files, retrieve all files, get a specific file by ID, update its properties, or delete it. ```APIDOC client.files.create(data={}) client.files.all(get_all=False) client.files.get(file_id='') client.files.update(file_id='', data={}) client.files.delete(file_id='') ``` -------------------------------- ### Manage Mailchimp List Member Notes Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods enable the management of notes for a specific member in a Mailchimp list. You can create, retrieve all, get a specific note, update, or delete notes. ```APIDOC client.lists.members.notes.create(list_id='', subscriber_hash='', data={}) client.lists.members.notes.all(list_id='', subscriber_hash='', get_all=False) client.lists.members.notes.get(list_id='', subscriber_hash='', note_id='') client.lists.members.notes.update(list_id='', subscriber_hash='', note_id='', data={}) client.lists.members.notes.delete(list_id='', subscriber_hash='', note_id='') ``` -------------------------------- ### Manage Mailchimp Folders Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods enable management of folders within Mailchimp's file manager. You can create new folders, retrieve all folders, get a specific folder by ID, update its details, or delete it. ```APIDOC client.folders.create(data={}) client.folders.all(get_all=False) client.folders.get(folder_id='') client.folders.update(folder_id='', data={}) client.folders.delete(folder_id='') ``` -------------------------------- ### Initialize MailChimp API Client with API Key Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Demonstrates how to initialize the `MailChimp` client using an API key and an optional username for basic authentication. The API key can be obtained from your MailChimp account settings. ```python from mailchimp3 import MailChimp client = MailChimp(mc_api='YOUR_API_KEY', mc_user='YOUR_USERNAME') ``` -------------------------------- ### Mailchimp Store Products API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing products within a Mailchimp store, including creation, retrieval, updates, and deletion. ```APIDOC client.stores.products.create(store_id='', data={}) client.stores.products.all(store_id='', get_all=False) client.stores.products.get(store_id='', product_id='') client.stores.products.update(store_id='', product_id='') client.stores.products.delete(store_id='', product_id='') ``` -------------------------------- ### Retrieve Mailchimp List Activity Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods provide access to activity data for a Mailchimp list. You can retrieve all activity for a list or get a feed of activity for a specific subscriber. ```APIDOC client.lists.activity.all(list_id='', subscriber_hash='') client.lists.activity.feed(list_id='', subscriber_hash='') ``` -------------------------------- ### Initialize MailChimp Python Client Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst This snippet demonstrates how to initialize the MailChimp Python client. It requires a user agent header and your MailChimp API secret key for authentication. The `MailChimp` class is instantiated with these parameters, creating a client object ready for API calls. ```python headers['User-Agent'] = 'Example (example@example.com)' client = MailChimp('YOUR SECRET KEY', request_headers=headers) ``` -------------------------------- ### Manage Mailchimp List Signup Forms Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Allows creation and retrieval of signup forms associated with Mailchimp lists. This helps in managing how new subscribers join your lists. ```APIDOC client.lists.signup_forms.create(list_id='', data={}) client.lists.signup_forms.all(list_id='') ``` -------------------------------- ### Mailchimp Landing Pages API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing Mailchimp landing pages, including creation, retrieval (with optional fields), updates, and deletion. ```APIDOC client.landing_pages.create(data={}) client.landing_pages.all() client.landing_pages.all(fields='') client.landing_pages.get(page_id='') client.landing_pages.update(page_id='', data={}) client.landing_pages.delete(page_id='') ``` -------------------------------- ### Retrieve Mailchimp List Abuse Reports Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods allow you to access abuse reports associated with a specific Mailchimp list. You can retrieve all reports for a list or get a specific report by its ID. ```APIDOC client.lists.abuse_reports.all(list_id='', get_all=False) client.lists.abuse_reports.get(list_id='', report_id='') ``` -------------------------------- ### Manage Mailchimp List Signup Forms Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Methods to create and retrieve signup forms associated with a Mailchimp list. ```APIDOC client.lists.signup_forms.create(list_id='', data={}) client.lists.signup_forms.all(list_id='') ``` -------------------------------- ### Mailchimp E-commerce Store Products API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Methods for managing product data within Mailchimp e-commerce stores, including creation, retrieval, update, and deletion. ```python client.stores.products.create(store_id='', data={}) client.stores.products.all(store_id='', get_all=False) client.stores.products.get(store_id='', product_id='') client.stores.products.update(store_id='', product_id='') client.stores.products.delete(store_id='', product_id='') ``` -------------------------------- ### Mailchimp Store Product Images API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing images associated with products in a Mailchimp store, allowing for creation, retrieval, updates, and deletion of product images. ```APIDOC client.stores.products.images.create(store_id='', product_id='', data={}) client.stores.products.images.all(store_id='', product_id='', get_all=False) client.stores.products.images.get(store_id='', product_id='', image_id='') client.stores.products.images.update(store_id='', product_id='', image_id='', data={}) client.stores.products.images.delete(store_id='', product_id='', image_id='') ``` -------------------------------- ### Manage Mailchimp List Interest Categories Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods enable the management of interest categories within a Mailchimp list. You can create new categories, retrieve all categories, get a specific category, update its details, or delete it. ```APIDOC client.lists.interest_categories.create(list_id='', data={}) client.lists.interest_categories.all(list_id='', get_all=False) client.lists.interest_categories.get(list_id='', category_id='') client.lists.interest_categories.update(list_id='', category_id='', data={}) client.lists.interest_categories.delete(list_id='', category_id='') ``` -------------------------------- ### Mailchimp Store Product Variants API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing product variants within a Mailchimp store, including creation, retrieval, updates, and deletion, with an additional create-or-update option. ```APIDOC client.stores.products.variants.create(store_id='', product_id='', data={}) client.stores.products.variants.all(store_id='', product_id='', get_all=False) client.stores.products.variants.get(store_id='', product_id='', variant_id='') client.stores.products.variants.update(store_id='', product_id='', variant_id='', data={}) client.stores.products.variants.create_or_update(store_id='', product_id='', variant_id='', data={}) client.stores.products.variants.delete(store_id='', product_id='', variant_id='') ``` -------------------------------- ### Manage Mailchimp E-Commerce Stores Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides comprehensive methods for managing e-commerce stores integrated with Mailchimp. This includes creating, listing, retrieving, updating, and deleting store information. ```APIDOC client.stores.create(data={}) ``` ```APIDOC client.stores.all(get_all=False) ``` ```APIDOC client.stores.get(store_id='') ``` ```APIDOC client.stores.update(store_id='', data={}) ``` ```APIDOC client.stores.delete(store_id='') ``` -------------------------------- ### Configure Mailchimp Client Request/Response Logging Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Demonstrates how to set up logging for the Mailchimp client to capture request and response details to a file. This helps in debugging API interactions. ```python import logging fh = logging.FileHandler('/path/to/some/log.log') logger = logging.getLogger('mailchimp3.client') logger.addHandler(fh) # use the client normally client.lists.all(**{'fields': 'lists.date_created'}) ``` -------------------------------- ### Manage Mailchimp List Members Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods provide comprehensive control over Mailchimp list members. You can create new members, retrieve all members, get a specific member by hash, update their details, create or update them, or permanently delete them. ```APIDOC client.lists.members.create(list_id='', data={}) client.lists.members.all(list_id='', get_all=False) client.lists.members.get(list_id='', subscriber_hash='') client.lists.members.update(list_id='', subscriber_hash='', data={}) client.lists.members.create_or_update(list_id='', subscriber_hash='', data={}) client.lists.members.delete(list_id='', subscriber_hash='') client.lists.members.delete_permanent(list_id='', subscriber_hash='') ``` -------------------------------- ### Retrieve Mailchimp Campaign Advice Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Fetches all advice entries for a specified Mailchimp campaign. This can provide recommendations for improving campaign effectiveness. ```APIDOC client.reports.advice.all(campaign_id='') ``` -------------------------------- ### Manage Mailchimp Lists Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods provide core functionalities for managing Mailchimp audience lists. You can create new lists, update members within a list, retrieve all lists, get a specific list, update its properties, or delete it. ```APIDOC client.lists.create(data={}) client.lists.update_members(list_id='', data={}) client.lists.all(get_all=False) client.lists.get(list_id='') client.lists.update(list_id='', data={}) client.lists.delete(list_id='') ``` -------------------------------- ### Root API Endpoint Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Documents the available methods for the MailChimp Root API endpoint. This endpoint typically provides basic information about the API connection and available resources. ```APIDOC client.root.get() ``` -------------------------------- ### Manage Mailchimp Campaigns Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides comprehensive methods for managing email campaigns, including creation, listing, retrieval, updating, and deletion. This covers the lifecycle of a campaign from draft to completion. ```APIDOC client.campaigns.create(data={}) ``` ```APIDOC client.campaigns.all(get_all=False) ``` ```APIDOC client.campaigns.get(campaign_id='') ``` ```APIDOC client.campaigns.update(campaign_id='') ``` ```APIDOC client.campaigns.delete(campaign_id='') ``` -------------------------------- ### Manage Mailchimp Template Folders Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Provides methods for creating, retrieving, updating, and deleting template folders. ```APIDOC client.template_folders.create(data={}) client.template_folders.all(get_all=False) client.template_folders.get(folder_id='') client.template_folders.update(folder_id='', data={}) client.template_folders.delete(folder_id='') ``` -------------------------------- ### Retrieve All MailChimp Campaigns Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Shows how to retrieve all campaigns from MailChimp. The `get_all=True` parameter ensures that all available campaigns are fetched. ```python client.campaigns.all(get_all=True) ``` -------------------------------- ### Manage Mailchimp List Interest Category Interests Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods allow for the management of individual interests within a specific interest category of a Mailchimp list. You can create new interests, retrieve all interests, get a specific interest, update its details, or delete it. ```APIDOC client.lists.interest_categories.interests.create(list_id='', category_id='', data={}) client.lists.interest_categories.interests.all(list_id='', category_id='', get_all=False) client.lists.interest_categories.interests.get(list_id='', category_id='', interest_id='') client.lists.interest_categories.interests.update(list_id='', category_id='', interest_id='', data={}) client.lists.interest_categories.interests.delete(list_id='', category_id='', interest_id='') ``` -------------------------------- ### Manage Automation Email Queues Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for creating, retrieving, and managing email queues within Mailchimp automations. This includes adding new emails to a queue, listing all emails in a queue, and fetching details for a specific email. ```APIDOC client.automations.emails.queues.create(workflow_id='', email_id='', data={}) ``` ```APIDOC client.automations.emails.queues.all(workflow_id='', email_id='') ``` ```APIDOC client.automations.emails.queues.get(workflow_id='', email_id='', subscriber_hash='') ``` -------------------------------- ### Mailchimp Landing Pages Actions API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for performing actions on Mailchimp landing pages, specifically publishing and unpublishing them. ```APIDOC client.landing_pages.actions.publish(page_id='') client.landing_pages.actions.unpublish(page_id='') ``` -------------------------------- ### Mailchimp E-commerce Store Product Variants API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Method to create product variants within Mailchimp e-commerce stores. ```python client.stores.products.variants.create(store_id='', product_id='', data={}) ``` -------------------------------- ### Configure Mailchimp Client Logging in Python Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Demonstrates how to configure logging for the Mailchimp client, directing request/response details to a file handler. This snippet helps in debugging and monitoring API interactions. ```python import logging fh = logging.FileHandler('/path/to/some/log.log') logger = logging.getLogger('mailchimp3.client') logger.addHandler(fh) ``` -------------------------------- ### Prepare Custom Request Headers for MailChimp API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Illustrates how to prepare custom request headers, such as a User-Agent, for MailChimp API calls using `requests.utils.default_headers()`. These headers can then be passed to the client. ```python headers = requests.utils.default_headers() ``` -------------------------------- ### Manage Mailchimp Campaign Folders Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Allows for the organization and management of campaigns using folders. This includes creating new folders, listing existing ones, retrieving specific folder details, updating folder information, and deleting folders. ```APIDOC client.campaign_folders.create(data={}) ``` ```APIDOC client.campaign_folders.all(get_all=False) ``` ```APIDOC client.campaign_folders.get(folder_id='') ``` ```APIDOC client.campaign_folders.update(folder_id='', data={}) ``` ```APIDOC client.campaign_folders.delete(folder_id='') ``` -------------------------------- ### Manage Mailchimp Templates Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Provides methods for creating, retrieving, updating, and deleting Mailchimp templates. ```APIDOC client.templates.create(data={}) client.templates.all(get_all=False) client.templates.get(template_id='') client.templates.update(template_id='', data={}) client.templates.delete(template_id='') ``` -------------------------------- ### Initialize MailChimp Client with Custom User-Agent Header Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Shows how to configure a custom User-Agent header for MailChimp API requests during client initialization. This is achieved by passing a dictionary of headers via the `request_headers` parameter. ```python headers = requests.utils.default_headers() headers['User-Agent'] = 'Example (example@example.com)' client = MailChimp('YOUR SECRET KEY', request_headers=headers) ``` -------------------------------- ### Retrieve All MailChimp Lists Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Demonstrates how to fetch all MailChimp lists, optionally filtering by specific fields like name and ID. This uses the `client.lists.all` method with `get_all=True` for comprehensive retrieval. ```python client.lists.all(get_all=True, fields="lists.name,lists.id") ``` -------------------------------- ### Mailchimp File Manager Folders API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing folders within the Mailchimp file manager, including creation, retrieval, updates, and deletion of folders. ```APIDOC client.folders.create(data={}) client.folders.all(get_all=False) client.folders.get(folder_id='') client.folders.update(folder_id='', data={}) client.folders.delete(folder_id='') ``` -------------------------------- ### Mailchimp E-commerce Store Product Images API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Methods for managing images associated with products in Mailchimp e-commerce stores, including creation, retrieval, update, and deletion. ```python client.stores.products.images.create(store_id='', product_id='', data={}) client.stores.products.images.all(store_id='', product_id='', get_all=False) client.stores.products.images.get(store_id='', product_id='', image_id='') client.stores.products.images.update(store_id='', product_id='', image_id='', data={}) client.stores.products.images.delete(store_id='', product_id='', image_id='') ``` -------------------------------- ### Manage Mailchimp E-Commerce Store Customers Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Allows for the management of customer data within Mailchimp e-commerce stores. This includes creating, listing, retrieving, updating, creating or updating, and deleting customer records. ```APIDOC client.stores.customers.create(store_id='', data={}) ``` ```APIDOC client.stores.customers.all(store_id='', get_all=False) ``` ```APIDOC client.stores.customers.get(store_id='', customer_id='') ``` ```APIDOC client.stores.customers.update(store_id='', customer_id='', data={}) ``` ```APIDOC client.stores.customers.create_or_update(store_id='', customer_id='', data={}) ``` ```APIDOC client.stores.customers.delete(store_id='', customer_id='') ``` -------------------------------- ### Initialize MailChimp Client with Runtime Disable Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Illustrates how to initialize the MailChimp client and disable API calls at runtime using the `enabled=False` parameter. When disabled, all subsequent API calls made through this client instance will return `None`. ```python client = MailChimp('YOUR SECRET KEY', enabled=False) ``` -------------------------------- ### Mailchimp E-commerce Store Customers API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Methods for managing customer data within Mailchimp e-commerce stores, including creation, retrieval, update, creation/update, and deletion. ```python client.stores.customers.create(store_id='', data={}) client.stores.customers.all(store_id='', get_all=False) client.stores.customers.get(store_id='', customer_id='') client.stores.customers.update(store_id='', customer_id='', data={}) client.stores.customers.create_or_update(store_id='', customer_id='', data={}) client.stores.customers.delete(store_id='', customer_id='') ``` -------------------------------- ### MailChimp API Endpoint Methods Reference Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst This section details the available methods for each MailChimp API endpoint, assuming the client is initialized as `client`. It specifies the method names and their required or optional parameters, such as IDs or data payloads. Parameters like `app_id`, `workflow_id`, `email_id`, `batch_id`, `batch_webhook_id`, `folder_id`, and `subscriber_hash` are used to identify specific resources. ```APIDOC Root: get() Authorized Apps: create(data: dict) all(get_all: bool = False) get(app_id: str) Automations: all(get_all: bool = False) get(workflow_id: str) Automation Actions: pause(workflow_id: str) start(workflow_id: str) Automation Emails: all(workflow_id: str) get(workflow_id: str, email_id: str) Automation Email Actions: pause(workflow_id: str, email_id: str) start(workflow_id: str, email_id: str) Automation Email Queues: create(workflow_id: str, email_id: str, data: dict) all(workflow_id: str, email_id: str) get(workflow_id: str, email_id: str, subscriber_hash: str) Automation Removed Subscribers: create(workflow_id: str, data: dict) all(workflow_id: str) Batch Operations: create(data: dict) all(get_all: bool = False) get(batch_id: str) delete(batch_id: str) Batch Webhooks: create(data: dict) all(get_all: bool = False) get(batch_webhook_id: str) update(batch_webhook_id: str, data: dict) delete(batch_webhook_id: str) Campaign Folders: create(data: dict) all(get_all: bool = False) get(folder_id: str) update(folder_id: str, data: dict) delete(folder_id: str) ``` -------------------------------- ### Manage Mailchimp E-Commerce Store Orders Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing order data within Mailchimp e-commerce stores. This includes creating, listing, retrieving, updating, and deleting order records. ```APIDOC client.stores.orders.create(store_id='', data={}) ``` ```APIDOC client.stores.orders.all(store_id='', get_all=False) ``` ```APIDOC client.stores.orders.get(store_id='', order_id='') ``` ```APIDOC client.stores.orders.update(store_id='', order_id='', data={}) ``` ```APIDOC client.stores.orders.delete(store_id='', order_id='') ``` -------------------------------- ### Add a New Member to a MailChimp List Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Demonstrates how to add a new subscriber to a MailChimp list, including their email address, subscription status, and merge fields like first and last name. This uses the `client.lists.members.create` method. ```python client.lists.members.create('123456', { 'email_address': 'john.doe@example.com', 'status': 'subscribed', 'merge_fields': { 'FNAME': 'John', 'LNAME': 'Doe' } }) ``` -------------------------------- ### Perform Actions on Mailchimp Campaigns Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Offers various actions that can be performed on Mailchimp campaigns, such as canceling, pausing, replicating, resuming, scheduling, sending, resending, testing, and unscheduling campaigns. ```APIDOC client.campaigns.actions.cancel(campaign_id='') ``` ```APIDOC client.campaigns.actions.pause(campaign_id='') ``` ```APIDOC client.campaigns.actions.replicate(campaign_id='') ``` ```APIDOC client.campaigns.actions.resume(campaign_id='') ``` ```APIDOC client.campaigns.actions.schedule(campaign_id='', data={}) ``` ```APIDOC client.campaigns.actions.send(campaign_id='') ``` ```APIDOC client.campaigns.actions.resend(campaign_id='') ``` ```APIDOC client.campaigns.actions.test(campaign_id='', data={}) ``` ```APIDOC client.campaigns.actions.unschedule(campaign_id='') ``` -------------------------------- ### Manage Mailchimp List Member Events Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods to create and retrieve events associated with a Mailchimp list member. Use `create` to add new events and `all` to fetch existing ones. ```APIDOC client.lists.members.events.create(list_id='', subscriber_hash='', data={}) client.lists.members.events.all(list_id='', subscriber_hash='', get_all=False) ``` -------------------------------- ### Manage Mailchimp Landing Pages Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst These methods facilitate the creation, retrieval, update, and deletion of Mailchimp landing pages. You can fetch all pages, filter by fields, or interact with a specific page using its ID. ```APIDOC client.landing_pages.create(data={}) client.landing_pages.all() client.landing_pages.all(fields='') client.landing_pages.get(page_id='') client.landing_pages.update(page_id='', data={}) client.landing_pages.delete(page_id='') ``` -------------------------------- ### Paginate MailChimp API Results Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Shows how to use `count` and `offset` parameters for paginating results from MailChimp API endpoints. The `get_all` boolean argument can be used to fetch all records by looping through the API responses automatically. ```python client.lists.members.all('123456', count=100, offset=0) ``` -------------------------------- ### Mailchimp File Manager Files API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for managing files within the Mailchimp file manager, allowing for creation, retrieval, updates, and deletion of individual files. ```APIDOC client.files.create(data={}) client.files.all(get_all=False) client.files.get(file_id='') client.files.update(file_id='', data={}) client.files.delete(file_id='') ``` -------------------------------- ### Manage Mailchimp Campaign Feedback Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Enables the management of feedback associated with Mailchimp campaigns. This includes creating, listing, retrieving, updating, and deleting feedback entries for a given campaign. ```APIDOC client.campaigns.feedback.create(campaign_id='', data={}) ``` ```APIDOC client.campaigns.feedback.all(campaign_id='', get_all=False) ``` ```APIDOC client.campaigns.feedback.get(campaign_id='', feedback_id='') ``` ```APIDOC client.campaigns.feedback.update(campaign_id='', feedback_id='', data={}) ``` ```APIDOC client.campaigns.feedback.delete(campaign_id='', feedback_id='') ``` -------------------------------- ### Mailchimp List Growth History API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for retrieving the growth history of a Mailchimp list, either all history or specific monthly data. ```APIDOC client.lists.growth_history.all(list_id='', get_all=False) client.lists.growth_history.get(list_id='', month='') ``` -------------------------------- ### Mailchimp E-commerce Stores API Operations Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Provides methods for managing Mailchimp e-commerce stores, including creation, retrieval, update, and deletion. ```python client.stores.create(data={}) client.stores.all(get_all=False) client.stores.get(store_id='') client.stores.update(store_id='', data={}) client.stores.delete(store_id='') ``` -------------------------------- ### Manage Mailchimp Template Folders Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides full CRUD operations for Mailchimp template folders, including creation, retrieval, update, and deletion. This helps organize your email templates. ```APIDOC client.template_folders.create(data={}) client.template_folders.all(get_all=False) client.template_folders.get(folder_id='') client.template_folders.update(folder_id='', data={}) client.template_folders.delete(folder_id='') ``` -------------------------------- ### MailChimp API Resource Hierarchy Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst This section outlines the hierarchical structure of the MailChimp API v3, detailing the main resources and their nested sub-resources. It provides a high-level overview of the available API endpoints and their relationships, mirroring the official MailChimp documentation. ```APIDOC MailChimp +- Root +- Authorized Apps +- Automations | +- Actions | +- Emails | | +- Actions | | +- Queues | +- Removed Subscribers +- Batch Operations +- Batch Webhooks +- Campaign Folders +- Campaigns | +- Actions | +- Content | +- Feedback | +- Send Checklist +- Conversations | +- Messages +- Customer Journeys +- Stores | +- Carts | | +- Lines | +- Customers | +- Orders | | +- Lines | +- Products | +- Images | +- Variants | +- Promo Rules | +- Promo Codes +- File Manager Files +- File Manager Folders +- Landing Pages | +- Actions | +- Content +- Lists | +- Abuse Reports | +- Activity | +- Clients | +- Growth History | +- Interest Categories | | +- Interests | +- Members | | +- Activity | | +- Events | | +- Goals | | +- Notes | | +- Tags | +- Merge Fields | +- Segments | | +- Segment Members | +- Signup Forms | +- Twitter Lead Generation Carts | +- Webhooks +- Ping +- Reports | +- Campaign Abuse | +- Campaign Advice | +- Campaign Open reports | +- Click Reports | | +- Members | +- Domain Performance | +- EepURL Reports | +- Email Activity | +- Google Analytics | +- Location | +- Sent To | +- Sub-Reports | +- Unsubscribes +- Search Campaigns +- Search Members +- Template Folders +- Templates +- Default Content ``` -------------------------------- ### Mailchimp List Activity API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for retrieving activity data for a Mailchimp list, including all activity or a specific activity feed for a subscriber. ```APIDOC client.lists.activity.all(list_id='', subscriber_hash='') client.lists.activity.feed(list_id='', subscriber_hash='') ``` -------------------------------- ### Mailchimp Campaign Actions API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Methods to perform various actions on Mailchimp campaigns, such as canceling, pausing, replicating, resuming, scheduling, sending, resending, testing, and unscheduling. ```python client.campaigns.actions.cancel(campaign_id='') client.campaigns.actions.pause(campaign_id='') client.campaigns.actions.replicate(campaign_id='') client.campaigns.actions.resume(campaign_id='') client.campaigns.actions.schedule(campaign_id='', data={}) client.campaigns.actions.send(campaign_id='') client.campaigns.actions.resend(campaign_id='') client.campaigns.actions.test(campaign_id='', data={}) client.campaigns.actions.unschedule(campaign_id='') ``` -------------------------------- ### Automations API Endpoint Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Describes the methods for managing automations in MailChimp. It allows retrieving all automations or a specific automation by its workflow ID. ```APIDOC client.automations.all(get_all=False) client.automations.get(workflow_id='') ``` -------------------------------- ### Mailchimp Campaign Feedback API Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Methods for managing feedback on Mailchimp campaigns, including creation, retrieval, update, and deletion of feedback entries. ```python client.campaigns.feedback.create(campaign_id='', data={}) client.campaigns.feedback.all(campaign_id='', get_all=False) client.campaigns.feedback.get(campaign_id='', feedback_id='') client.campaigns.feedback.update(campaign_id='', feedback_id='', data={}) client.campaigns.feedback.delete(campaign_id='', feedback_id='') ``` -------------------------------- ### Mailchimp Landing Pages Content API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides a method for retrieving the content of a specific Mailchimp landing page. ```APIDOC client.landing_pages.content.get(page_id='') ``` -------------------------------- ### Manage Mailchimp Batch Webhooks Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for creating, listing, retrieving, updating, and deleting webhooks specifically for batch operations. These webhooks can notify external systems about the status of batch processes. ```APIDOC client.batch_webhooks.create(data={}) ``` ```APIDOC client.batch_webhooks.all(get_all=False) ``` ```APIDOC client.batch_webhooks.get(batch_webhook_id='') ``` ```APIDOC client.batch_webhooks.update(batch_webhook_id='', data={}) ``` ```APIDOC client.batch_webhooks.delete(batch_webhook_id='') ``` -------------------------------- ### MailChimp API Resource Hierarchy Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Outlines the hierarchical structure of the MailChimp API resources, showing how different endpoints are nested under the main MailChimp object. This provides a comprehensive overview of available API paths and their relationships. ```APIDOC MailChimp +- Root +- Authorized Apps +- Automations | +- Actions | +- Emails | | +- Actions | | +- Queues | +- Removed Subscribers +- Batch Operations +- Batch Webhooks +- Campaign Folders +- Campaigns | +- Actions | +- Content | +- Feedback | +- Send Checklist +- Conversations | +- Messages +- Customer Journeys +- Stores | +- Carts | | +- Lines | +- Customers | +- Orders | | +- Lines | +- Products | +- Images | +- Variants | +- Promo Rules | +- Promo Codes +- File Manager Files +- File Manager Folders +- Landing Pages | +- Actions | +- Content +- Lists | +- Abuse Reports | +- Activity | +- Clients | +- Growth History | +- Interest Categories | | +- Interests | +- Members | | +- Activity | | +- Events | | +- Goals | | +- Notes | | +- Tags | +- Merge Fields | +- Segments | | +- Segment Members | +- Signup Forms | +- Twitter Lead Generation Carts | +- Webhooks +- Ping +- Reports | +- Campaign Abuse | +- Campaign Advice | +- Campaign Open reports | +- Click Reports | | +- Members | +- Domain Performance | +- EepURL Reports | +- Email Activity | +- Google Analytics | +- Location | +- Sent To | +- Sub-Reports | +- Unsubscribes +- Search Campaigns +- Search Members +- Template Folders +- Templates +- Default Content ``` -------------------------------- ### Retrieve Mailchimp Campaign Advice Reports Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Method to retrieve all advice reports for a specific campaign. ```APIDOC client.reports.advice.all(campaign_id='') ``` -------------------------------- ### Manage Mailchimp List Webhooks Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Provides comprehensive methods for creating, retrieving, updating, and deleting webhooks for a Mailchimp list. ```APIDOC client.lists.webhooks.create(list_id='', data={}) client.lists.webhooks.all(list_id='') client.lists.webhooks.get(list_id='', webhook_id='') client.lists.webhooks.update(list_id='', webhook_id='', data={}) client.lists.webhooks.delete(list_id='', webhook_id='') ``` -------------------------------- ### Retrieve Mailchimp Lists with Specific Fields (Python) Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Demonstrates how to use the Mailchimp client to fetch all lists, specifying that only the 'date_created' field should be returned for each list. This uses keyword arguments to pass the fields parameter to the API call. ```python client.lists.all(**{'fields': 'lists.date_created'}) ``` -------------------------------- ### Mailchimp Campaigns API Operations Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.rst Provides methods for managing Mailchimp campaigns, including creation, retrieval, update, and deletion. ```python client.campaigns.create(data={}) client.campaigns.all(get_all=False) client.campaigns.get(campaign_id='') client.campaigns.update(campaign_id='') client.campaigns.delete(campaign_id='') ``` -------------------------------- ### Mailchimp Store Order Lines API Methods Source: https://github.com/vingtcinq/python-mailchimp/blob/master/README.md Provides methods for creating, retrieving, updating, and deleting order lines associated with a specific store and order in Mailchimp. ```APIDOC client.stores.orders.lines.create(store_id='', order_id='', data={}) client.stores.orders.lines.all(store_id='', order_id='', get_all=False) client.stores.orders.lines.get(store_id='', order_id='', line_id='') client.stores.orders.lines.update(store_id='', order_id='', line_id='', data={}) client.stores.orders.lines.delete(store_id='', order_id='', line_id='') ```