Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#431 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện bản cập nhật với script Python được cung cấp và các yêu cầu curl tương đương cho các biểu mẫu legacy và new-editor. So sánh các endpoint v3 và v4, đồng thời ghi lại liệu phản hồi allowlist có xảy ra độc lập với SDK hay không. Hoàn tất có nghĩa là xác định được hạn chế ở phía API và либо khôi phục các bản cập nhật được hỗ trợ hoặc ghi lại quyền truy cập và endpoint cần thiết.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
Python
Star
434
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của HubSpot/hubspot-api-python

Tất cả issue của HubSpot/hubspot-api-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.