Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`api_client.FormsApi.update()` failing for forms created via `new-editor` web UI.

Abierto
#431 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
api

Línea de trabajo

Comienza reproduciendo la actualización con el script de Python proporcionado y solicitudes curl equivalentes para formularios legacy y new-editor. Compara los endpoints v3 y v4 y registra si la respuesta de allowlist se produce independientemente del SDK. Se considera terminado cuando se identifica la restricción del lado de la API y se restauran las actualizaciones compatibles o se documentan el acceso y el endpoint necesarios.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Please note that this is an issue with the API in general, not specifically the Python SDK, as I get the same response when I run curl PUT or PATCH commands against the API.

To reproduce:

  1. Create a form via the web UI using the legacy editor
  2. Create a form via the web UI using the new editor
  3. Run the following script (replace placeholders)
import hubspot
from hubspot.marketing.forms import ApiException

client = hubspot.Client.create(access_token="PAT_TOKEN")

LEGACY_FORM_ID = "LEGACY_FORM_ID_HERE"
NEW_FORM_ID = "NEW_FORM_ID_HERE"

def main():
    # works as expected
    legacy_form_def = get_form_by_id(LEGACY_FORM_ID)
    legacy_form_def.name = "UPDATED_LEGACY_FORM_NAME"
    update_legacy_form_response = update_form(LEGACY_FORM_ID, legacy_form_def)

    # fails
    new_form_def = get_form_by_id(NEW_FORM_ID)
    new_form_def.name = "UPDATED_NEW_FORM_NAME"
    update_new_form_response = update_form(NEW_FORM_ID, new_form_def)

def update_form(form_id, form_data):
    try:
        api_response = client.marketing.forms.forms_api.update(form_id=form_id, hub_spot_form_definition_patch_request=form_data)
        return api_response
    except ApiException as e:
        print("Exception when calling forms_api->update: %s\n" % e)
        return None

def get_form_by_id(form_id):
    try:
        api_response = client.marketing.forms.forms_api.get_by_id(form_id=form_id)
        return api_response
    except ApiException as e:
        print("Exception when calling forms_api->get_by_id: %s\n" % e)
        return None

if __name__ == "__main__":
    main()

Response when trying to update the form created via the new editor:

HTTP response body: {"status":"error","message":"The client is not allowlisted to perform an operation to v4 forms","correlationId":"4821afe0-8303-4adc-a358-55cd48a70bfb","category":"BANNED"}

What I've tried so far:

  • Updated the URL from https://api.hubapi.com/marketing/v3/forms/{form_id} to https://api.hubapi.com/marketing/v4/forms/{form_id}
  • Finding v4 marketing->form docs online (can't find them)
Lenguaje dominante
Python
Estrellas
434
Forks
126
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de HubSpot/hubspot-api-python

Todos los issues de HubSpot/hubspot-api-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.