How can I use the ADword API to delete certain audiences?(Attach a screenshot)

134 views
Skip to first unread message

jia zheng

unread,
Nov 16, 2018, 3:01:10 AM11/16/18
to AdWords API and Google Ads API Forum
When I send the following request,
<v:operations>
<v1:operator>REMOVE</v1:operator>
<v:operand xsi:type="LogicalUserList">
<v:id>736723026</v:id>
</v:operand>
</v:operations>
</v:mutate></x:Body></x:Envelope>

 return

[{"faultcode":["soap:Client"],"faultstring":["[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0]]"],"detail":[{"ApiExceptionFault":[{"$":{"xmlns":"https://adwords.google.com/api/adwords/cm/v201802","xmlns:ns2":"https://adwords.google.com/api/adwords/rm/v201802"},"message":["[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0]]"],"ApplicationException.Type":["ApiException"],"errors":[{"$":{"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:type":"OperatorError"},"fieldPath":["operations[0]"],"fieldPathElements":[{"field":["operations"],"index":["0"]}],"trigger":[""],"errorString":["OperatorError.OPERATOR_NOT_SUPPORTED"],"ApiError.Type":["OperatorError"],"reason":["OPERATOR_NOT_SUPPORTED"]}]}]}]}]


When I send the following request,
<v:mutateMembers>
<v:operations>
<v:operator>REMOVE</v:operator>
<v:userListId>736723029</v:userListId>
</v:operand>
</v:operations>
</v:mutateMembers></x:Body></x:Envelope>

return

[{"faultcode":["soap:Client"],"faultstring":["[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator]"],
"message":["[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator]"],"ApplicationException.Type":["ApiException"],
"errors":[{"$":{"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:type":"OperatorError"},"fieldPath":["operations[0]"],"fieldPathElements":[{"field":["operations"],
"index":["0"]}],"trigger":[""],"errorString":["OperatorError.OPERATOR_NOT_SUPPORTED"],"ApiError.Type":["OperatorError"],"reason":["OPERATOR_NOT_SUPPORTED"]},
{"$":{"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:type":"RequiredError"},"fieldPath":["operations[0].operator"],
"fieldPathElements":[{"field":["operations"],"index":["0"]},{"field":["operator"]}],"trigger":[""],"errorString":["RequiredError.REQUIRED"],"ApiError.Type":["RequiredError"],"reason":["REQUIRED"]}]}]}]}]

How do I delete an audience? Can you give an example of XML?
How to remove Userlist.bmp

Peter Oliquino (AdWords API Team)

unread,
Nov 16, 2018, 3:22:58 AM11/16/18
to AdWords API and Google Ads API Forum
Hi Jia,

My apologies as we currently do not have a sample code or XML for what you wish to achieve. However, in your request, it appears that you also need to include the removeAll field in your request in order to remove your members from your userlist.

Best regards,
Peter
AdWords API Team

jia zheng

unread,
Nov 16, 2018, 5:01:27 AM11/16/18
to AdWords API and Google Ads API Forum
I only delete one, not all, what should I do?userListId 、

membersList  What data is being filled in ?

Peter Oliquino (AdWords API Team)

unread,
Nov 16, 2018, 5:51:14 AM11/16/18
to AdWords API and Google Ads API Forum
Hi Jia,

My apologies if I misunderstood your concern. Are you trying to delete a userlist or a member? If you are trying to delete a userlist, you will need to use the AdwordsUserListService.mutate() method. You may take note, however, that the REMOVE operator is not supported. You will need to use the SET operator instead and change the Status to CLOSED.

As for the membersList, this normally contains all of your members along with their (hashed) email addresses or other user related information you wish to target.

Thanks and regards,
Peter
AdWords API Team

jia zheng

unread,
Nov 18, 2018, 10:37:28 PM11/18/18
to AdWords API and Google Ads API Forum

Yes, I would like to delete the UserLIST instead of CLOSE. I found that it can be removed with AD UI, but why doesn't the API support REMOVE

Peter Oliquino (AdWords API Team)

unread,
Nov 18, 2018, 11:30:01 PM11/18/18
to AdWords API and Google Ads API Forum
Hi Jia,

My apologies as I cannot comment further as to why the AdwordsUserListService.mutate() does not support the REMOVE operator. If you wish to delete the userlist object, you may do so via the AdWords UI.

Best regards,
Peter
AdWords API Team

Reply all
Reply to author
Forward
0 new messages