Zum Hauptinhalt springen
PATCH
/
marketing
/
v3
/
forms
/
{formId}
Mettre à jour partiellement une définition de formulaire
curl --request PATCH \
  --url https://api.hubapi.com/marketing/v3/forms/{formId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "fieldGroups": [
    {
      "groupType": "default_group",
      "richTextType": "text",
      "richText": "<string>",
      "fields": [
        {
          "objectTypeId": "<string>",
          "hidden": true,
          "defaultValue": "<string>",
          "name": "<string>",
          "description": "<string>",
          "dependentFields": [
            {
              "dependentCondition": {
                "rangeStart": "<string>",
                "values": [
                  "<string>"
                ],
                "value": "<string>",
                "operator": "eq",
                "rangeEnd": "<string>"
              },
              "dependentField": {}
            }
          ],
          "label": "<string>",
          "placeholder": "<string>",
          "fieldType": "email",
          "required": true,
          "validation": {
            "useDefaultBlockList": true,
            "blockedEmailDomains": [
              "<string>"
            ]
          }
        }
      ]
    }
  ],
  "archived": true,
  "configuration": {
    "createNewContactForNewEmail": true,
    "editable": true,
    "allowLinkToResetKnownValues": true,
    "lifecycleStages": [
      {
        "objectTypeId": "<string>",
        "value": "<string>"
      }
    ],
    "postSubmitAction": {
      "type": "thank_you",
      "value": "<string>"
    },
    "language": "af",
    "prePopulateKnownValues": true,
    "cloneable": true,
    "notifyContactOwner": true,
    "recaptchaEnabled": true,
    "archivable": true,
    "notifyRecipients": [
      "<string>"
    ]
  },
  "name": "<string>",
  "legalConsentOptions": {
    "type": "none"
  },
  "displayOptions": {
    "renderRawHtml": true,
    "cssClass": "<string>",
    "theme": "default_style",
    "submitButtonText": "<string>",
    "style": {
      "labelTextSize": "<string>",
      "legalConsentTextColor": "<string>",
      "fontFamily": "<string>",
      "legalConsentTextSize": "<string>",
      "backgroundWidth": "<string>",
      "helpTextSize": "<string>",
      "submitFontColor": "<string>",
      "labelTextColor": "<string>",
      "submitAlignment": "left",
      "submitSize": "<string>",
      "helpTextColor": "<string>",
      "submitColor": "<string>"
    }
  }
}'
{
  "id": "6eae0163-5362-4c0e-809c-b99a18678adc",
  "name": "Register for event updates",
  "createdAt": "2020-09-22T05:12:27.505Z",
  "updatedAt": "2020-09-22T07:35:48.172Z",
  "archived": false,
  "fieldGroups": [
    {
      "groupType": "default_group",
      "richTextType": "text",
      "fields": [
        {
          "objectTypeId": "0-1",
          "name": "firstname",
          "label": "First name",
          "required": false,
          "hidden": false,
          "fieldType": "single_line_text"
        },
        {
          "objectTypeId": "0-1",
          "name": "email",
          "label": "Email",
          "required": true,
          "hidden": false,
          "fieldType": "email",
          "validation": {
            "blockedEmailDomains": [],
            "useDefaultBlockList": false
          }
        }
      ]
    },
    {
      "groupType": "progressive",
      "richTextType": "text",
      "fields": [
        {
          "objectTypeId": "0-1",
          "name": "age_group",
          "label": "Age group",
          "required": false,
          "hidden": false,
          "options": [
            {
              "label": "Under 18",
              "value": "Under 18",
              "description": "",
              "displayOrder": 0
            },
            {
              "label": "18-60",
              "value": "18-60",
              "description": "",
              "displayOrder": 1
            },
            {
              "label": "60+",
              "value": "60+",
              "description": "",
              "displayOrder": 2
            }
          ],
          "fieldType": "dropdown"
        }
      ]
    }
  ],
  "configuration": {
    "language": "en",
    "cloneable": true,
    "postSubmitAction": {
      "type": "thank_you",
      "value": "Thanks for signing up for our updates"
    },
    "editable": true,
    "archivable": true,
    "recaptchaEnabled": false,
    "notifyContactOwner": false,
    "notifyRecipients": [
      "2886602"
    ],
    "createNewContactForNewEmail": false,
    "prePopulateKnownValues": true,
    "allowLinkToResetKnownValues": false,
    "lifecycleStages": [
      {
        "objectTypeId": "0-1",
        "value": "subscriber"
      },
      {
        "objectTypeId": "0-2",
        "value": "subscriber"
      }
    ]
  },
  "displayOptions": {
    "renderRawHtml": false,
    "theme": "default_style",
    "submitButtonText": "Submit",
    "style": {
      "fontFamily": "arial, helvetica, sans-serif",
      "backgroundWidth": "100%",
      "labelTextColor": "#33475b",
      "labelTextSize": "13px",
      "helpTextColor": "#7C98B6",
      "helpTextSize": "11px",
      "legalConsentTextColor": "#33475b",
      "legalConsentTextSize": "14px",
      "submitColor": "#ff7a59",
      "submitAlignment": "left",
      "submitFontColor": "#ffffff",
      "submitSize": "12px"
    },
    "cssClass": "hs-form stacked"
  },
  "legalConsentOptions": {
    "type": "explicit_consent_to_process",
    "communicationConsentText": "<p>Fancy Forms, LLC is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please tick below to say how you would like us to contact you:</p>",
    "communicationsCheckboxes": [
      {
        "required": false,
        "subscriptionTypeId": 3883363,
        "label": "<p>I agree to receive other communications from Fancy Forms, LLC.</p>"
      }
    ],
    "consentToProcessText": "<p>In order to provide you the content requested, we need to store and process your personal data. If you consent to us storing your personal data for this purpose, please tick the checkbox below.</p>",
    "consentToProcessCheckboxLabel": "<p>I agree to allow Fancy Forms, LLC to store and process my personal data.</p>",
    "privacyText": "<p>You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy.</p>"
  },
  "formType": "hubspot"
}
Produits pris en charge
Exige l'un des produits suivants ou un produit supérieur.
Marketing HubMarketing HubGratuit
Sales HubSales HubGratuit
Service HubService HubGratuit
Content HubContent HubStarter

Portées requises

Cette API requiert l’une des portées suivantes :
  • forms

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

formId
string
required

L'ID du formulaire à mettre à jour.

Body

application/json
fieldGroups
object[]

Les champs du formulaire, regroupés en lignes.

archived
boolean

Si ce formulaire est archivé.

configuration
object
name
string

Le nom du formulaire. Doit être unique pour un hub.

  • none
  • legitimate_interest
displayOptions
object

Options for styling the form.

Response

successful operation

formType
enum<string>
default:hubspot
required
Available options:
hubspot
id
string
required
name
string
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
archived
boolean
required
fieldGroups
object[]
required
configuration
object
required
displayOptions
object
required

Options for styling the form.

  • none
  • legitimate_interest
archivedAt
string<date-time>
I