Hi Sarah,

You can retrieve the UserList Ids by using the UserListService.GetUserList
<https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v1.services#userlistservice>
and get UserList.id
<https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v1.resources#google.ads.googleads.v1.resources.UserList>.
My apologies as there are no sample codes available right now that I can
provide. However, you may refer to the GetCampaigns.cs
<https://github.com/googleads/google-ads-dotnet/blob/master/examples/BasicOperations/GetCampaigns.cs>
guide on how to use the get operation.

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 03/19/19 23:40:51 [email protected] wrote:

Hi

    public long LookAudienceIdUsingName(string name)
    {
      AdwordsUserListService userListService =
        (AdwordsUserListService)_user.GetService(
          AdWordsService.v201809.AdwordsUserListService);

      string query = $"SELECT Id, Name, Status, AccountUserListStatus Where
Name = '{name}' ORDER BY Id Desc";
      int offset = 0;
      int pageSize = 1;
      UserListPage page = new UserListPage();

      string queryWithPaging = $"{query} LIMIT {offset}, {pageSize}";
      page = userListService.query(queryWithPaging);

      foreach (UserList userList in page.entries)
        return page.entries[0].id;

      return 0;
    }

The above is my C# code to get an audience Id calling AdWords API - this
works fine no problem.

I'm now migrating our integration to Google Ads API. Can you please provide
a sample code that do the same as the above ? I couldn't find one.

Thanks.
Sarah

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
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/a4dcfac3-42dc-4a42-9fc5-86b744b44390%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/a4dcfac3-42dc-4a42-9fc5-86b744b44390%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
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/ijlio0tsr00000000il4r00003sjecx60mj4c9n6so30c1g68qjec1j%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • How to ... IntegrationDeveloper
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to