ChrisAlvares / node-adwords

Adwords SDK for NodeJS
MIT License
151 stars 92 forks source link

ManagedCustomerService always returns RequiredError.REQUIRED @ serviceSelector #105

Open imgnx opened 4 years ago

imgnx commented 4 years ago

I've tried to create the serviceSelector, but every time I make a call to get Managed Customers from the API, I always get this error:

soap:Server: [RequiredError.REQUIRED @ serviceSelector]: [object Object]

Is it possible to get a list of accounts that are managed from an MCC account?

Jared-Dahlke commented 4 years ago

@ChrisAlvares ` I believe I am having this same issuesoap:ClientUnmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"https://adwords.google.com/api/adwords/cm/v201809":query}'. One of '{"https://adwords.google.com/api/adwords/cm/v201809":serviceSelector}' is expected. </soap:Fault></soap:Body></soap:Envelope> }, body:soap:ClientUnmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"https://adwords.google.com/api/adwords/cm/v201809":query}'. One of '{"https://adwords.google.com/api/adwords/cm/v201809":serviceSelector}' is expected. </soap:Fault></soap:Body></soap:Envelope>` }


`
schaeferCode commented 4 years ago

@ChrisAlvares I'm bumping this issue. I'm also running into the same error. Looks like serviceSelector is referring to the parameter that ought to be passed in with the get() method, https://developers.google.com/adwords/api/docs/reference/v201809/ManagedCustomerService#parameters. I've tried passing many different selector fields but nothing seems to make this error any different.

schaeferCode commented 4 years ago

Okay, I literally just saw something in the documentation that I somehow missed before. The answer is that you must pass an object with the key as serviceSelector and the value your selector object as the first parameter of the get() method in managedCustomerService. It's in this repo's FIRST example code in the readme. No idea how I missed that before.

Based on this, I think this issue can be closed. If anyone needs it, I can post a code example (although my code is trashy right now since I'm still in spike mode).