All Projects → rubicon-project → Node Google Dfp

rubicon-project / Node Google Dfp

Licence: isc
A service for integrating with Google DFP over NodeJS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Google Dfp

Googleplay Api
Google Play Unofficial Python API
Stars: ✭ 278 (+230.95%)
Mutual labels:  api, google
Java Speech Api
The J.A.R.V.I.S. Speech API is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.
Stars: ✭ 490 (+483.33%)
Mutual labels:  api, google
Google Chart
Google Charts API web components
Stars: ✭ 284 (+238.1%)
Mutual labels:  api, google
Googleanalyticsr
Use the Google Analytics API from R
Stars: ✭ 213 (+153.57%)
Mutual labels:  api, google
Yunmai Data Extract
Extract your data from the Yunmai weighing scales cloud API so you can use it elsewhere
Stars: ✭ 21 (-75%)
Mutual labels:  api, google
Realtime object detection
Plug and Play Real-Time Object Detection App with Tensorflow and OpenCV. No Bugs No Worries. Enjoy!
Stars: ✭ 260 (+209.52%)
Mutual labels:  api, google
Figma To Google Slides
Convert Figma frames into a Google Slides presentation 🍭
Stars: ✭ 385 (+358.33%)
Mutual labels:  api, google
Googleauthr
Google API Client Library for R. Easy authentication and help to build Google API R libraries with OAuth2. Shiny compatible.
Stars: ✭ 150 (+78.57%)
Mutual labels:  api, google
Geocoder
🌎 GoLang package that provides an easy way to use the Google Geocoding API
Stars: ✭ 23 (-72.62%)
Mutual labels:  api, google
Mtrans
Multi-source Translation
Stars: ✭ 711 (+746.43%)
Mutual labels:  api, google
Php Google Translate Free
PHP class to use the Google Translator API for free.
Stars: ✭ 182 (+116.67%)
Mutual labels:  api, google
Google Analytics Api Symfony
Google Analytics API Symfony Bundle
Stars: ✭ 43 (-48.81%)
Mutual labels:  api, google
Youtubeshop
Youtube autolike and autosubs script
Stars: ✭ 177 (+110.71%)
Mutual labels:  api, google
Flutter Ui Nice
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.
Stars: ✭ 3,092 (+3580.95%)
Mutual labels:  api, google
Google Translate
🈯 A Node.JS library to consume Google Translate API for free.
Stars: ✭ 152 (+80.95%)
Mutual labels:  api, google
Google Translate
翻译工具 支持网页翻译和文本翻译
Stars: ✭ 356 (+323.81%)
Mutual labels:  api, google
Dialogflow Web
Web App for Dialogflow
Stars: ✭ 135 (+60.71%)
Mutual labels:  api, google
Google Translate Api
A free and unlimited API for Google Translate 💵🚫
Stars: ✭ 1,996 (+2276.19%)
Mutual labels:  api, google
Googledictionaryapi
Google does not provide Google Dictionary API so I created one.
Stars: ✭ 528 (+528.57%)
Mutual labels:  api, google
Drive
☁️ A distributed cloud based lazy drive to files integrated with Dropbox, Google Drive.
Stars: ✭ 36 (-57.14%)
Mutual labels:  api, google

Code Climate Test Coverage Build Status

Google DFP API Client for NodeJS

Basics

Initialize the DFP Instance.

var Dfp = require('node-google-dfp'),
    dfpUser = new Dfp.User(NETWORK_CODE, APP_NAME, VERSION);

Next, setup your client settings and your user's OAUTH token information.

dfpUser.setSettings({
  client_id : "YOUR CLIENT ID",
  client_secret : "YOUR CLIENT SECRET",
  refresh_token : "A REFRESH TOKEN",
  redirect_url : "YOUR OAUTH REDIRECT URL"
});

You can instance any of DFP's API Services; https://developers.google.com/doubleclick-publishers/docs/start

dfpUser.getService('LineItemService', function (err, lineItemService) {
  if (err) {
    return console.error(err);
  }

  var statement = new DfpClass.Statement('WHERE id = 103207340');

  lineItemService.getLineItemsByStatement(statement, function (err, results) {
    console.log(results);
  });

});

Service accounts example

If you would like to use a Google Service Account to access DFP, you can do so by creating an instance of the JWT auth client.

var {JWT} = require('google-auth-library')

var jwtClient = new JWT(
  SERVICE_ACCOUNT_EMAIL,
  'path/to/key.pem',
  null,
  ['https://www.googleapis.com/auth/dfp']);

dfpUser.setClient(jwtClient)

=======

oAuth setup

This application requires a working oAuth refresh token to make requests. If you don't include a refresh token you will get an "No refresh token is set" error. If you include a bad token, you'll get an "illegal access" error. Service accounts are not supported.

To setup a refresh token manually, follow Google's instructions for using cURL. The main steps are included below.

  • Setup a oAuth "installed application" in the Google Developer Console.

  • Create a verification request using this installed application's client ID. (If you miss this step you'll get an authorization_pending error from Google on the next step.) Note that any slashes in a device_code will need to be escaped.

curl -d "client_id={YOUR_OAUTH_CLIENT_ID}&scope=https://www.googleapis.com/auth/dfp" https://accounts.google.com/o/oauth2/device/code

{
  "device_code" : "ABCD-EFGH4/MEiMYvOO1THXLV_fHGGN8obAgb5XFs1Uctj-QsyYsQk",
  "user_code" : "ABCD-EFGH",
  "verification_url" : "https://www.google.com/device",
  "expires_in" : 1800,
  "interval" : 5
}
  • Visit the verification_url contained in the verification request response (e.g. https://www.google.com/device) in a browser and type in the user_code provided in the verification response. A verification code will be given as a response.

  • Use the provided code and your client ID and secret from the Google oAuth application to create a refresh token.

curl -d "client_id={YOUR_OAUTH_CLIENT_ID}&client_secret={YOUR_OAUTH_CLIENT_SECRET}&code={YOUR_VERIFICATION_CODE}&grant_type=http://oauth.net/grant_type/device/1.0" https://accounts.google.com/o/oauth2/token

{
  "access_token" : "ya29.JAHynQpVpjBFhvg-7VKdQ7nmD0DkmCYoWTWo535TP8QsKa6j2rFOI1i0pdclFepv_GZo9A2SrN41dA",
  "token_type" : "Bearer",
  "expires_in" : 3600,
  "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjdjZmM3YTJhMDkwYWJjOGYxMDU5MjJmMzFiN2FjZGUzYzA2NmU1NTYifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiaWQiOiIxMTU2MjQxNzA0MjQ3NzA5NDYzNzgiLCJzdWIiOiIxMTU2MjQxNzA0MjQ3NzA5NDYzNzgiLCJhenAiOiI4MzQ3MDQ2OTI1ODItMzlwY3I2M2RmNjBlZjByY2E5ZTc1cDRicTlzbjhxOWUuYXBwcy5nb29nbyV1c2VyY29udGVudC5jb20iLCJlbWFpbCI6InRheWxvci5idWxleUBtY25hdWdodG9uLm1lZGlhIiwiYXRfaGFzaCI6Ikp2Sl9JUDlxUk9zX1JUNDBoY0FSWVEiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXVkIjoiODM0NzA0HjkyNTgyLTM5cGNyNjNkZjYwZWYwcmNhOWU3NXA0YnE5c244cTllLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiaGQiOiJtY25hdWdodG9uLm1lZGlhIiwidG9rZW5faGFzaCI6Ikp2Sl9JSDlxUk9zX1JUNDBoY0FSWVEiLCJ2ZXJpZmllZF9lbWFpbCI6dHJ1ZSwiY2lkIjoiODM0NzA0NjkyNTgyLTM5cGNyNjNkZjYwZWYwcmNhOWU3NXA0YnE5c244cTllLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiaWF0IjoxNDI0ODAwNDcwLCJleHAiOjE0MjQ4MDQzNzB9.T9mTcSl5bJLKrFhldXOd1L1CnGFfZHNF1eQOmJYyp7wR3vKbz8ATTNAfyo8_2hSGt9kGrHDBcdgaq_18RYS72Tt0MclNy020romjl6rYRjs6GH93S3ZMiwra3UI3kmDXym9kyntedMS5gIPgJWfcoh0J0CTDNPBisLNrZntJv7Y",
  "refresh_token" : "1/CGpCHgTgJ28PMnh84PgQBOgHHHaLCDbDQ_0ZiINmO_g"
}

You can use urn:ietf:wg:oauth:2.0:oob for the redirect URL of non-public apps.

Known Issues

  1. OAuth Support for more than just Refresh Token
  2. No unit tests

How to contribute

Follow Github's recommended workflow for contributing to this project.

  1. Fork it
  2. Create your feature branch (git checkout -b your-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin your-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].