FormSubmissionClient (hubspot3/forms.py)

hubspot3 · hubspot3/forms.py · python · MIT
crm, CRM / Leads

HubSpot forms API client for submitting forms and retrieving form data.

# Source: https://github.com/jpetrucciani/hubspot3 | License: MIT | Copyright 2023 Jacobi Petrucciani
# Provided via justclaw.it.com; keep this notice with the code.
"""
hubspot forms api
"""

import json
from urllib.parse import urlencode
from http.client import HTTPResponse
from typing import Dict, Optional
from hubspot3.base import BaseClient
from hubspot3.error import HubspotNotFound, HubspotServerError


FORMS_API_VERSION = 2


class FormSubmissionClient(BaseClient):
    """allows acccess to submit forms via the hubspot api"""

    class ResponseCode:
        """form submission response codes enum"""

        SUCCESS = 204
        SUCCESS_AND_REDIRECT = 302
        NOT_FOUND = 404
        ERROR = 500

    def __init__(self, *args, **kwargs) -> None:
        """form submission client c

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key