Hi,

I have not implemented node.js auth yet, currently i'm using python auth 
sample to get token from my dev ad account and paste to my HTTP auth header 
for using REST API.

On Tuesday, 26 February 2019 03:50:11 UTC+8, Afonso Praça wrote:
>
> Hello 
> 謝子皓
> How did you manage to authenticate using just REST? I'm using Node.js too 
> and I am finding issues to do that.
>
> Best,
>
> On Monday, February 25, 2019 at 1:28:28 PM UTC-3, 謝子皓 wrote:
>>
>> Since I use Node.js and there is no Google Ads API client library in 
>> Node.js so I choose to use REST API.
>>
>> Following this Call Structure document 
>> <https://developers.google.com/google-ads/api/docs/concepts/call-structure>, 
>> I can create userList via REST API via HTTP POST to 
>> *https://googleads.googleapis.com/v0/customers/31259999xx/userLists:mutate 
>> <https://googleads.googleapis.com/v0/customers/31259999xx/userLists:mutate> 
>> *with auth info on headers and below body data
>>
>> {
>>   "operations": [
>>     {
>>       "create": {
>>         "readOnly": false,
>>         "name": "jason-test-audience-name-3",
>>         "description": "test",
>>         "membershipStatus": "OPEN",
>>         "membershipLifeSpan": "540",
>>         "sizeForDisplay": "0",
>>         "sizeRangeForDisplay": "LESS_THAN_FIVE_HUNDRED",
>>         "sizeForSearch": "0",
>>         "sizeRangeForSearch": "LESS_THAN_FIVE_HUNDRED",
>>         "type": "CRM_BASED",
>>         "accessReason": "OWNED",
>>         "accountUserListStatus": "ENABLED",
>>         "eligibleForSearch": false,
>>         "eligibleForDisplay": true,
>>         "crmBasedUserList": {
>>           "appId": "com.garena.game.kgvn",
>>           "uploadKeyType": "MOBILE_ADVERTISING_ID",
>>           "dataSourceType": "FIRST_PARTY"
>>         }
>>       }
>>     }
>>   ]
>> }
>>
>> Enter code here...
>>
>> I can received correct response as below
>> {
>>     "results": [
>>         {
>>             "resourceName": "customers/3125820670/userLists/769964xxx"
>>         }
>>     ]
>> }
>>
>> But I cannot find any fields according to this 
>> <https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v0.resources#google.ads.googleads.v0.resources.UserList>
>>  in 
>> the request body to upload my *.csv files or array of ids so I ended up 
>> create a audience list without csv file.
>>
>>
>> By tracing back to AdWords API python client library's example code : 
>>
>>
>> googleads-python-lib/examples/adwords/v201809/remarketing/add_crm_based_user_list.py
>>  
>> <https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201809/remarketing/add_crm_based_user_list.py>
>>
>> I realized it might need to call different API.
>>
>> one for creating user list  
>> <https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201809/remarketing/add_crm_based_user_list.py#L54>
>>
>> result = user_list_service.mutate(operations)
>>
>> one for updating members in the user list 
>> <https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201809/remarketing/add_crm_based_user_list.py#L81>
>>
>> response = user_list_service.mutateMembers([mutate_members_operation])
>>
>>
>> How can I do the equivalent of add_crm_based_user_list.py 
>> <https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201809/remarketing/add_crm_based_user_list.py>
>>  example 
>> do in the Google Ads API v0 via REST API?
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/d5cac45a-a27d-4236-998b-e7241d67adf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Re: Equ... Afonso Praça
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... Jason Hsieh
    • Re... Jason Hsieh
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to