Skip to content

How to use TrafficEstimatorService? #2

@mz3

Description

@mz3

I love that someone is working on a proper adwords api library for node. I can't get TrafficEstimatorService to work though. Could you add an example or some documentation?

var selector = new AdWords.Selector.model({
  fields: {
    campaignEstimateRequests: [
      {
        adGroupEstimateRequests: [
          {
            keywordEstimateRequests: [
              {
                keyword: {
                  'cm:text': 'homes',
                  'cm:matchType': 'PHRASE'
                },
                maxCpc: {'cm:microAmount': 10000000}
              }
            ]
          }
        ]
      }
    ]
  },
  ordering: [{field: 'Name', sortOrder: 'ASCENDING'}],
  paging: {startIndex: 0, numberResults: 100}
});

service.get(clientCustomerId, selector, function(err, results) {
  //if (err) console.log(err);
  console.log(JSON.stringify(results, null, 2));
});

Gives

SOAP ERROR:
 <soap:Envelope 
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'fields'. One of '{"https://adwords.google.com/api/adwords/o/v201509":campaignEstimateRequests}' is expected. </faultstring>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions