1.0.1 • Published 5 years ago

rubiconproject-api-node v1.0.1

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

rubiconproject-api-node

Rubicon api node

Simple rubicon api module.

Initialization

npm install --save rubiconproject-api-node;

let  rbc  =  new (require('rubiconproject-api-node'))(
    { 
	    auth: {
		    endpoint:  'api.rubiconproject.com',
		    key:  'YOUR API KEY',
		    secret:  'YOUR API SECRET',
		    accountId:  YOUR ACCOUNT ID
		}
	}
);

Inventory

Sites

List sites
rbc.inventory.getSites((err, response) => {
	console.dir(err);
	console.dir(response);
});
Get site details
rbc.inventory.getSite(SITE_ID, (err, response) => {
	console.dir(err);
	console.dir(response);
});
Update site
rbc.inventory.updateSite(SITE, (err, response) => {
	console.dir(err);
	console.dir(response);
});
Create site
rbc.inventory.createSite(SITE, (err, response) => {
	console.dir(err);
	console.dir(response);
});

Zones

List zones

rbc.inventory.getZones((err, response) => {
	console.dir(err);
	console.dir(response);
});
Get zone details
rbc.inventory.getZone(ZONE_ID, (err, response) => {
	console.dir(err);
	console.dir(response);
});
Update zone
rbc.inventory.updateZone(ZONE, (err, response) => {
	console.dir(err);
	console.dir(response);
});
Create zone
rbc.inventory.createZone(ZONE, (err, response) => {
	console.dir(err);
	console.dir(response);
});

Objects

Site

{ 
	siteId: Number,
	name: String,
	displayName: String,
	domain: String,
	inventoryTypeId: Number,
	contentCategoryIds: Array<String>,
	sizeIds: Array<Number>,
	groups: Array<String>
}

Site Object

FieldRequiredTypeDetailsExample
siteIdPut, GetIntegerThe unique identifier of the site.1234
namePost, PutStringThe name of the site or inventory sourceFishing News
domainPost, PutStringthe primary domain of the site or inventory source (or reverse domain for mobile applications)http://www.fishingnews.com
displayNamePost, PutStringThe name of the inventory as it should be presented in UIs and 3rd partiesFishing News
invetoryTypeIdNoIntegerThe inventory type:\
108721 = Standard Web, 108723 = Mobile Optimized Web, 108725 = Mobile Application108721
contentCategoryIdsNoArray of StringsA list of the IAB content categories for the site (see: IAB Content Categories)"IAB1"
sizeIdsNoArray of IntegersA list of the IDs of the sizes that the inventory source will support (Supported Ad Formats)2,9,12

Zone

{
	zoneId: Number,
	name: String,
	siteId: Number,
	contentCategoryIds: Array<String>,
	sizeIds: Array<Number>,
	inheritSiteSizes: Boolean
}

Zone Object

FieldRequiredTypeDetailsExample
zoneIdPut, GetIntegerThe unique identifier of the zone.4567
siteIdPost, PutIntegerThe unique identifier of the site with which the zone is associated.1234
namePost, PutStringThe name of the zoneATF
contentCategoryIdsNoArray of StringsA list of the IAB content categories for the zone (see: IAB Content Categories)"IAB3"
inheritSiteSizesNoBooleanTrue or false value indicated whether or not to inherit the sizeIds configured on the site.false
sizeIdsNoArray of IntegersA list of the IDs of the sizes that the zone will support (Supported Ad Formats)2,9,15

#WIP...