Errorr Resposne  I am getting:
WARNING:root:⚠️ Error in qualifying question '{'question': 'VEHICLE_TYPE', 
'answer': ['SUV', 'Sedan']}': Specified type 'LeadFormQuestionFieldInfo' 
does not exist in Google Ads API v20
WARNING:root:⚠️ Error in qualifying question '{'question': 'What kind of 
car do you currently drive?', 'answer': ['Toyota', 'Honda', 'Other']}': 
'LeadFormCustomQuestionField' object is not callable

payload:
"qualifying_questions": [
{
"question": "VEHICLE_TYPE",
"answer": [
"SUV",
"Sedan"
]
},
{
"question": "What kind of car do you currently drive?",
"answer": [
"Toyota",
"Honda",
"Other"
]
}
], my current code 
standard_qualifying_question_enum = 
client.enums.LeadFormFieldUserInputTypeEnum
standard_question_values = {q["value"] for q in QUALIFYING_QUESTION_ENUMS}

for q in form_config.get("qualifying_questions", []):
try:
if q["question"] in standard_question_values:
# Predefined question
question_field = client.get_type("LeadFormQuestionFieldInfo")()
question_field.question_field = standard_qualifying_question_enum[q[
"question"]]

if isinstance(q["answer"], list):
question_field.answer_choice.extend(q["answer"])
else:
question_field.answer_choice.append(q["answer"])

lead_form.qualifying_question_fields.append(question_field)
else:
# Custom question
custom_question = client.get_type("LeadFormCustomQuestionField")()
custom_question.custom_question_text = q["question"]

if isinstance(q["answer"], list) and len(q["answer"]) >= 2:
choice_answers = client.get_type("LeadFormSingleChoiceAnswers")()
choice_answers.answers.extend(q["answer"])
custom_question.single_choice_answers = choice_answers

lead_form.custom_question_fields.append(custom_question)
except Exception as e:
logging.warning(f"⚠️ Error in qualifying question '{q}': {e}") 
On Thursday, July 17, 2025 at 1:28:20 PM UTC+5:30 Google Ads API Forum 
Advisor wrote:

> Hi Rajat, 
>
> Based on the provided information, I understand that you are encountering 
> an error while adding custom questions to create a lead form asset using 
> the Google Ads API. Could you please confirm whether you have followed the 
> earlier suggested documents on adding a *custom_question_text* 
> <https://developers.google.com/google-ads/api/reference/rpc/v20/LeadFormCustomQuestionField#:~:text=Fields-,custom_question_text,-string>
>  field 
> to a *LeadFormCustomQuestionField* 
> <https://developers.google.com/google-ads/api/reference/rpc/v20/LeadFormCustomQuestionField>
>  through 
> the *assets.mutate* 
> <https://developers.google.com/google-ads/api/rest/reference/rest/v20/customers.assets/mutate?apix=true>?
>  
> Also, kindly go through the sample example 
> <https://developers.google.com/google-ads/api/samples/add-lead-form-asset> on 
> adding a lead form asset via the API. Please be informed that I have tried 
> to create a lead form asset at my end and I'm able to do it successfully 
> without any errors. I would suggest you kindly follow the below given 
> sample request and response logs for your reference.
>
> *Request*:
>
> {
>   "operations": [
>     {
>       "create": {
>         "leadFormAsset": {
>           "businessName": "Interplanetary Cruise",
>           "callToActionType": "BOOK_NOW",
>           "callToActionDescription": "Latest trip to Jupiter!",
>           "headline": "Trip to Jupiter",
>           "description": "Our latest trip to Jupiter is now open for 
> booking.",
>           "privacyPolicyUrl": "http://example.com/privacy";,
>           "fields": [
>             {
>               "inputType": "FULL_NAME"
>             },
>             {
>               "inputType": "EMAIL"
>             },
>             {
>               "inputType": "PHONE_NUMBER"
>             }
>           ],
>           "customQuestionFields": [
>             {
>               "singleChoiceAnswers": {
>                 "answers": [
>                   "Before 9AM",
>                   "Anytime",
>                   "After sometime"
>                 ]
>               }
>             }
>           ]
>         }
>       }
>     }
>   ]
> }
>
> *Response*:
>
> customers/customer_Id/assets/asset_Id
>
> If you still encounter any errors even after following the given 
> suggestions, I request you kindly share the updated complete API logs (
> *request* 
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
>  and* response* 
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response>
>  with *request-id* 
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>
>  and* request header* 
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>)
>  
> generated at your end while adding custom questions to lead form asset or 
> at least share the *request-id* 
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>
>  that 
> is generated while making the API calls. 
>
> You can send the details via *Reply privately to the author option*, or 
> *direct 
> private reply* to this email.
>
> Thanks,
>   
> [image: Google Logo] Google Ads API Team 
> Feedback
> How was our support today? 
>
> [image: rating1] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating2] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating3] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating4] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=4&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating5] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=5&entry.295079254=500Ht00001svNXaIAM>
>
> [2025-07-17 07:57:39Z GMT] This message is in relation to case 
> "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/eefb9a3d-a884-4712-ba37-b0c6d4a78236n%40googlegroups.com.
  • Le... Rajat Singh
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Rajat Singh
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
            • ... Rajat Singh
              • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Rajat Singh
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Rajat Singh
                • ... Rajat Singh
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Rajat Singh

Reply via email to