Unable to create a call extension with the Python client

48 views
Skip to first unread message

Phil Tysoe

unread,
Nov 25, 2016, 6:59:59 AM11/25/16
to AdWords API Forum
I am trying to create a call extension using the Python API client.  My code is as follows:

       
operations = [
           
{
               
'operator': 'ADD',
               
'operand': {
                   
'campaignId': 12345,
                   
'extensionType': 'CALL',
                   
'extensionSetting': {
                       
'extensions': [
                           
{
                               
'ExtensionFeedItem.Type': u'CallFeedItem',
                               
'status': 'ENABLED',
                               
'feedType': u'CALL',
                               
'callPhoneNumber': '07777555666',
                               
'callCountryCode': 'GB',
                               
'callTracking': False,
                               
'disableCallConversionTracking': True,
                               
'feedId': 123456,
                               
'feedItemId': 1234567,
                           
}
                       
]
                   
}
               
},
           
}
       
]
       
return self.services['CampaignExtensionSettingService'].mutate(operations)

I've tried removing the feedId and feedItemId fields, but I am still getting:

suds.TypeNotFound: Type not found: 'callPhoneNumber'

I have used service.get() to view the returned data structure and can't see any obvious difference.  Could someone point out what I'm doing wrong here?

Joyce Lava

unread,
Nov 27, 2016, 10:15:03 PM11/27/16
to AdWords API Forum
Hi Phil,

I've tried this against my test account using the Java client library and here's the sample SOAP request and response that succeeds. You may want to match this with your logs and see if this helps:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201609" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>YOUR_CLIENT_CUSTOMERID</ns1:clientCustomerId>
            <ns1:developerToken>YOUR_DEVELOPER_TOKEN</ns1:developerToken>
            <ns1:userAgent>YOUR_USER_AGENT</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201609">
            <operations>
                <operator>ADD</operator>
                <operand>
                    <campaignId>YOUR_CAMPAIGN_ID</campaignId>
                    <extensionType>CALL</extensionType>
                    <extensionSetting>
                        <extensions xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201609" xsi:type="ns2:CallFeedItem">
                            <ns2:status>ENABLED</ns2:status>
                            <ns2:feedType>CALL</ns2:feedType>
                            <ns2:callPhoneNumber>YOUR_PHONE_NUMBER</ns2:callPhoneNumber>
                            <ns2:callCountryCode>YOUR_COUNTRY_CODE</ns2:callCountryCode>
                            <ns2:callTracking>true</ns2:callTracking>
                            <ns2:disableCallConversionTracking>false</ns2:disableCallConversionTracking>
                        </extensions>
                    </extensionSetting>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>
 
[main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201609">
            <requestId>xxxxxxxxxxxxxxxx</requestId>
            <serviceName>CampaignExtensionSettingService</serviceName>
            <methodName>mutate</methodName>
            <operations>2</operations>
            <responseTime>332</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201609">
            <rval>
                <ListReturnValue.Type>CampaignExtensionSettingReturnValue</ListReturnValue.Type>
                <value>
                    <campaignId>YOUR_CAMPAIGN_ID</campaignId>
                    <extensionType>CALL</extensionType>
                    <extensionSetting>
                        <extensions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CallFeedItem">
                            <feedId>FEED_ID_RETURNED</feedId>
                            <feedItemId>FEED_ITEM_ID_RETURNED</feedItemId>
                            <status>ENABLED</status>
                            <feedType>CALL</feedType>
                            <ExtensionFeedItem.Type>CallFeedItem</ExtensionFeedItem.Type>
                            <callPhoneNumber>YOUR_PHONE_NUMBER</callPhoneNumber>
                            <callCountryCode>YOUR_COUNTRY_CODE</callCountryCode>
                            <callTracking>true</callTracking>
                            <disableCallConversionTracking>false</disableCallConversionTracking>
                        </extensions>
                        <platformRestrictions>NONE</platformRestrictions>
                    </extensionSetting>
                </value>
            </rval>
        </mutateResponse>
    </soap:Body>
</soap:Envelope>
 
If the issue persists, please send me (reply privately to author) the complete SOAP request and response including the clientCustomerId to better check the issue.

Regards,
Joyce, AdWords API Team 
Reply all
Reply to author
Forward
0 new messages