Re: Adwords API Python retrieve user list id of existing audience

2020-06-13 Thread Akashdeep Singh
Hey there,

It took bit of time to understand how to set it up, but in future it will 
be helpful for others who try doing it. Note the name Id needs to have 
uppercase I and same with Name it needs to have uppercase N, which is 
pretty strange because you do not need when adding it.

Read : 
https://developers.google.com/adwords/api/docs/reference/v201809/AdwordsUserListService.Selector
 <- 
Under fields, all the possible fields available. 

user_list_selector = client.GetService('AdwordsUserListService', 'v201809')

CustomerServiceSelector = {
'fields': ['Id'],
"predicates": [{
"field": 'Name',
"operator": "EQUALS",
"values": ["Your_custom_audience_name"]
}],
}

result = user_list_selector.get(CustomerServiceSelector)
entries = result['entries']
id_of_audience = entries[0]['id']
print(id_of_audience)

Best Regards,
Akash

On Saturday, April 6, 2019 at 6:02:29 AM UTC+11, fco wrote:
>
> Hello,
>
> I'm having trouble finding the information I need to retrieve a listid 
> from AdwordsUserList Service. I see how to create a new list and retrieve 
> the id as shown, below:
>
> user_list = {
> 'xsi_type': 'CrmBasedUserList',
> 'name': audience_name + ' ' + str(uuid.uuid4()),
> 'description': 'A list of customers that originated from email addresses',
> 'membershipLifeSpan': 1,
> 'uploadKeyType': 'CONTACT_INFO'
> }
>
> # Create an operation to add the user list.
> operations = [{
> 'operator': 'ADD',
> 'operand': user_list
> }]
>
> result = self.user_list_service.mutate(operations)
> user_list_id = result['value'][0]['id']
>
>
>
> But if I already have a list and only want to retrieve the user_list_id of 
> an existing list, how do I do that?
>
> Thanks
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/cd634c57-e330-487e-bde2-180d5621b70bo%40googlegroups.com.


RE: Adwords API Python retrieve user list id of existing audience

2019-04-05 Thread googleadsapi-forumadvisor via AdWords API and Google Ads API Forum


Hello Francisco,

You may use the AdWordsUserListService.get()
  
operation

to pull the User list Id. If you're using the Google Ads API, you can use
the User List
  
resource

to pull the Id. Let me know if you have any other questions.

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
https://ads-developers.googleblog.com/search/label/google_ads_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 "AdWords API and Google Ads API Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ijlio2sf3801gnc2a80004lokcz6smj4dhk60o30c1g68qjcc9j%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Adwords API Python retrieve user list id of existing audience

2019-04-05 Thread francisco via AdWords API and Google Ads API Forum
Hello,

I'm having trouble finding the information I need to retrieve a listid from 
AdwordsUserList Service. I see how to create a new list and retrieve the id 
as shown, below:

user_list = {
'xsi_type': 'CrmBasedUserList',
'name': audience_name + ' ' + str(uuid.uuid4()),
'description': 'A list of customers that originated from email addresses',
'membershipLifeSpan': 1,
'uploadKeyType': 'CONTACT_INFO'
}

# Create an operation to add the user list.
operations = [{
'operator': 'ADD',
'operand': user_list
}]

result = self.user_list_service.mutate(operations)
user_list_id = result['value'][0]['id']



But if I already have a list and only want to retrieve the user_list_id of 
an existing list, how do I do that?

Thanks

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/af9fe4d9-2b62-46d3-92e9-2da0db2ebf24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.