googleapis / google-api-nodejs-client

Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.
https://googleapis.dev/nodejs/googleapis/latest/
Apache License 2.0
11.42k stars 1.92k forks source link

Adwords support #479

Closed gergelyke closed 8 years ago

gergelyke commented 9 years ago

Hey,

any plans on adding adwords support for this library? Also, for the time being how can we use the adwords API from Node.js?

Thanks a lot!

jmdobry commented 8 years ago

No plans that I know of. google-api-nodejs-client currently only supports APIs that are available in the Google APIs Discovery Service, and adwords isn't available, because it's an older SOAP-based service.

Googleads has client libraries for Java, PHP, Python, .NET, Perl, and Ruby.

Perhaps @vtsao can comment on whether googleads has any plans regarding this.

vtsao commented 8 years ago

Correct, we don't provide a Node.js client library for AdWords or DFP and there aren't really any plans to at the moment.

msiebuhr commented 8 years ago

Just for reference - I'm currently using this library to get some simple requests through to AdWords;

Body:

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201603" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
      <ns1:clientCustomerId>xxx-xxx-xxxx</ns1:clientCustomerId>
      <ns1:developerToken>xxxxxx</ns1:developerToken>
      <ns1:userAgent>xxxxx</ns1:userAgent>
      <ns1:validateOnly>false</ns1:validateOnly>
      <ns1:partialFailure>false</ns1:partialFailure>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
    <query xmlns="https://adwords.google.com/api/adwords/cm/v201603">
      <query> SELECT Id, Name, Status, CampaignId, CampaignName, Settings ORDER BY Name </query>
    </query>
  </soapenv:Body>
</soapenv:Envelope>

Request:

var google = require('googleapis');

var oauth2client = google.auth.OAuth2(client_id, client_secret, redirect_url);
oauth2client.setCredentials({refresh_token: refresh_token});
oauth2client.request({
    uri: 'https://adwords.google.com/api/adwords/cm/v201603/CampaignService',
    method: 'POST',
    headers: {
       'Content-Type': 'application/xml',
    },
    body: body
}, function (err, res, body) {
    console.log('err', err);
    console.log('res.statusCode', res.statusCode);
    console.log('body.body', body.body);
    return callback(err, body);
});
ChrisAlvares commented 8 years ago

If anyone is interested in this, I created a feature complete node adwords sdk here: https://github.com/ChrisAlvares/node-adwords that follows the php sdk pretty closely, but with nodeisms.

vincent714 commented 7 years ago

@ChrisAlvares is it possible to use node-adwords without giving client customer id?

ChrisAlvares commented 7 years ago

@vincent714 yes

karthiksankaran-c1x commented 6 years ago

Dear @ChrisAlvares

We are trying to retrieve the list of client customer IDs for a given manager account using the following code (trying through npmrunkit tool).

let user = new AdwordsUser({ client_id: 'CLIENT_ID',     //this is the api console client_id client_secret: 'CLIENT_SECRET', refresh_token: 'REFRESH_TOKEN' }); let customerService = user.getService('CustomerService', 'v201802')

We are always getting the result as 'undefined'.

Can you please advise on why we are seeing this error?

issacg commented 5 years ago

Hi! Now that there's a new non-SOAP Ads API, are there any thoughts or roadmap plans to adding official support here?

nwkeeley commented 4 years ago

I'd also be interested in having adwords support.

Vinay-V9 commented 4 years ago

I'd also be interested in having adwords support.

AlonMiz commented 3 years ago

I've found this repo if anyone stumbles on this old thread https://github.com/opteo/google-ads-api

bambootv commented 2 years ago

@AlonMiz Thanks for suggest, but this repo is unofficial, can we believe it ? https://github.com/opteo/google-ads-api

AlonMiz commented 2 years ago

it was working for me, and it'd seem reasonable in the maintenance, code and popularity

bambootv commented 2 years ago

@AlonMiz Yes, thanks for your experience.