label_service.get() returns None in Python

16 views
Skip to first unread message
Message has been deleted

Margaret

unread,
Oct 24, 2017, 3:18:51 PM10/24/17
to AdWords API Forum
I have code that tries to "get" a label with certain text, and if it doesn't find it, creates a new label with the text. I expect if the label doesn't exist I would still get a LabelPage back with totalNumEntries = 0, but recently I've been getting None back from time to time. When this happens, the code then tries to create the label, only to get a duplicate name error (meaning the "get" should have returned a label, not nothing). This test account I'm using has a lot of labels - is this just a slow response issue? Is there a way to tell the code to "wait until the response comes back" before moving on?

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Oct 24, 2017, 5:03:21 PM10/24/17
to AdWords API Forum
Hi Margaret, 

You are right, if there are no labels matching the text, the API should give a response with zero "totalNumEntries". Could you enable logging and share the SOAP request and response along with your client customer Id for an instance when you get none? Could you also share your code snippet that gets the label followed by creation of new labels? I would like to take a look at how you are currently performing this. You can reply privately to author while sharing the details. 

Thanks,
Sreelakshmi, AdWords API Team
Reply all
Reply to author
Forward
0 new messages