-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-generated nodejs SDK code update
Summary: ignore-conflict-markers Reviewed By: liliarizona Differential Revision: D65913580 fbshipit-source-id: eed1a6f27e3bf300151b9dc5c81614ec7ed9aa6b
- Loading branch information
1 parent
0ded148
commit ef6338d
Showing
140 changed files
with
6,327 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
'name', | ||
]; | ||
params = { | ||
}; | ||
const adcreativess = (new AdAccount(id)).getAdCreatives( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreativess api call complete.', adcreativess); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'name' : 'Sample Promoted Post', | ||
'object_story_id' : '<pageID>_<postID>', | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
43 changes: 43 additions & 0 deletions
43
examples/ad_account_ad_creatives_post_create_ad_creative.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'object_story_id' : '<pageID>_<postID>', | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
44 changes: 44 additions & 0 deletions
44
examples/ad_account_ad_creatives_post_create_ad_creative_canvas.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'image_hash' : '<imageHash>', | ||
'object_story_spec' : {'page_id':'<pageID>','link_data':{'image_hash':'<imageHash>','link':'<canvasURI>','name':'Creative message','call_to_action':{'type':'LEARN_MORE'}}}, | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
44 changes: 44 additions & 0 deletions
44
examples/ad_account_ad_creatives_post_create_ad_creative_customization_canvas_d_v.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'object_story_spec' : {'page_id':'<pageID>','template_data':{'format_option':'collection_video','link':'<canvasURI>','name':'English Creative title','message':'English Creative message','call_to_action':{'type':'LEARN_MORE'},'retailer_item_ids':[0,0,0,0],'customization_rules_spec':[{'customization_spec':{'language':'en_XX'}},{'customization_spec':{'language':'fr_XX'},'link':'<canvasURIFR>','name':'French Creative title','message':'French Creative message'}]}}, | ||
'product_set_id' : '<productSetID>', | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
44 changes: 44 additions & 0 deletions
44
examples/ad_account_ad_creatives_post_create_ad_creative_customization_canvas_image.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'object_story_spec' : {'page_id':'<pageID>','link_data':{'picture':'<imageURL>','link':'<canvasURI>','name':'English Creative title','message':'English Creative message','call_to_action':{'type':'LEARN_MORE'},'retailer_item_ids':[0,0,0,0],'customization_rules_spec':[{'customization_spec':{'language':'en_XX'}},{'customization_spec':{'language':'fr_XX'},'picture':'<imageURLFR>','link':'<canvasURIFR>','name':'French Creative title','message':'French Creative message'}]}}, | ||
'product_set_id' : '<productSetID>', | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
44 changes: 44 additions & 0 deletions
44
examples/ad_account_ad_creatives_post_create_ad_creative_customization_canvas_video.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'object_story_spec' : {'page_id':'<pageID>','video_data':{'video_id':'<videoID>','image_url':'<imageURL>','title':'English Creative title','message':'English Creative message','call_to_action':{'type':'LEARN_MORE','value':{'link':'<canvasURI>'}},'retailer_item_ids':[0,0,0,0],'customization_rules_spec':[{'customization_spec':{'language':'en_XX'}},{'customization_spec':{'language':'fr_XX'},'video_id':'<videoIDFR>','picture':'<imageURLFR>','link':'<canvasURIFR>','name':'French Creative title','message':'French Creative message'}]}}, | ||
'product_set_id' : '<productSetID>', | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdCreative = bizSdk.AdCreative; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'name' : 'Sample Promoted', | ||
'object_story_spec' : {'page_id':'<pageID>','link_data':{'image_hash':'<imageHash>','link':'<imageURL>','message':'try it out'}}, | ||
'degrees_of_freedom_spec' : {'creative_features_spec':'{\'standard_enhancements\':\'{\\\'enroll_status\\\':\\\'OPT_IN\\\'}\'}'}, | ||
'special_ad_categories' : [], | ||
}; | ||
const adcreatives = (new AdAccount(id)).createAdCreative( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adcreatives api call complete.', adcreatives); |
Oops, something went wrong.