I want to display a list of data from firebase realtime database in the dialogflow web bot
eg: user - i need top 3 selling books
Bot - below are details of top selling books
- Anna Karenina by Leo Tolstoy
- The Great Gatsby by F. Scott Fitzgerald
- Hamlet by William Shakespeare
where the database has following data in firebase realtime database
https://i.stack.imgur.com/x4cwV.png
Note: I want to display this bulleted list in default web bot (not google assistant or FB or slack integration)
Have tried below functions, but didn't work
try 1:
return admin.database().ref('books').once("child_added").then((data) => {
agent.add(`${data.val().title} => ${data.val().author}`);
}); // this displays only 1st row of DB
try 2:
return admin.database().ref('books').once("value").then((snapshot) => {
let books_list = snapshot.val();
agent.add(`${holiday_list}`);
}); // this displays the output in json format including the key which is not required
try 3:
var bookRef = firebase.database().ref("books/");
playersRef.orderByChild("title").on("child_added", function(data) {
console.log(`${data.val().title} by ${data.val().author}`);
agent.add(`${data.val().title} by ${data.val().author}`);
});// this prints the required result, but in google cloud console and not in chat-bot
any help is appreciated
Related
I'm sorry if this is a silly question, it's my first time trying to integrate the PayPal payment button into my Django website
I was following a tutorial and everything works fine when I used the HTML script from the PayPal developer website: https://developer.paypal.com/demo/checkout/#/pattern/client
I tested the payments and they went through successfully.
this is the working script
<!-- Set up a container element for the button -->
<div id="paypal-button-container"></div>
<!-- Include the PayPal JavaScript SDK -->
<script src="https://www.paypal.com/sdk/js?client-id=test¤cy=USD"></script>
<script>
// Render the PayPal button into #paypal-button-container
paypal.Buttons({
// Set up the transaction
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '88.44'
}
}]
});
},
// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {
// Successful capture! For demo purposes:
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
var transaction = orderData.purchase_units[0].payments.captures[0];
alert('Transaction '+ transaction.status + ': ' + transaction.id + '\n\nSee console for all available details');
// Replace the above to show a success message within this page, e.g.
// const element = document.getElementById('paypal-button-container');
// element.innerHTML = '';
// element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: actions.redirect('thank_you.html');
});
}
}).render('#paypal-button-container');
</script>
on the final step i should add the id where the payments go, i added the client id from my sandbox app as i followed on the tutorial.
then the payment process failed with a bunch of warnings and errors on the console log.
those are the warnings, i'm not sure if they are relevant
rest_api_v2_checkout_orders_capture_error
capture_order_call_rest_api_error
smart_api_order_capture_status_500_error
and the error
Error: Api: /smart/api/order/2CE30645TN292790N/capture returned status code: 500 (Corr ID: 6059f74d7d86c)
{"ack":"error","message":"Unhandled api error","meta":{"calc":"6059f74d7d86c","rlog":"rZJvnqaaQhLn%2FnmWT8cSUueWscmrtUHe5Y1Bd%2FeqyvyOTq66rSXAciiXRg7dClMl1o2iporwJbYz7mI0k8X%2B5vvp6t7dnU%2B%2B_17b646b9bfe"},"server":"BW5u5z-ag5VIFXCeo-FvfHOppMovQjbfurKdnROZjue_puvEq8w7pr9g-JTUa_N93X-G1W0ItCQpDtpWzP0fjVwpK7fYmKtRr_M6AiZCc9I8jT1o-HkaNIQVCchIVE2wBsEFPkUDKrguIXjpL9HKQHXFhio_DKQgF46f__hfehX6OcSyf8EqFzCq0v_aKUbo2cn6qm-ns-fO2ozMUq0o7RWyqIHd0mDJoV8auE6OUquFw6fW65nkyx9HcNmBdsVrYFstFxkpY2W"}
at https://www.sandbox.paypal.com/smart/buttons?style.label=pay&style.layout=vertical&style.color=blue&style.shape=pill&style.tagline=false&style.height=40&components.0=buttons&locale.country=US&locale.lang=en&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVZIT2J5VTZ3VFpncG81bndtNDc2ZU9uZ3dsYjBCWmVmazhxRFpIUFpBU0J0dVNjbk5RMUVXWHF6LV9rV0tySEdPM1JHTWZLaF9ydzl0ZWcmY3VycmVuY3k9VVNEIiwiYXR0cnMiOnsiZGF0YS11aWQiOiJ1aWRfcmhyZnFrcmRqcnJibnJ5aXNlamxqZnJkY2NscHpmIn19&clientID=AVHObyU6wTZgpo5nw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bGVwYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwic2VwYSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJpZGVhbCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJiYW5jb250YWN0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sImdpcm9wYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwiZXBzIjp7ImVsaWdpYmxlIjpmYWxzZX0sInNvZm9ydCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJteWJhbmsiOnsiZWxpZ2libGUiOmZhbHNlfSwicDI0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sInppbXBsZXIiOnsiZWxpZ2libGUiOmZhbHNlfSwid2VjaGF0cGF5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sInBheXUiOnsiZWxpZ2libGUiOmZhbHNlfSwiYmxpayI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJ0cnVzdGx5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sIm94eG8iOnsiZWxpZ2libGUiOmZhbHNlfSwibWF4aW1hIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJvbGV0byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJtZXJjYWRvcGFnbyI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ&platform=desktop&experiment.enableVenmo=true&flow=purchase¤cy=USD&intent=capture&commit=true&vault=false&renderedButtons.0=paypal&renderedButtons.1=card&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=false:1317:84630
at e.n.dispatch (https://www.sandbox.paypal.com/smart/buttons?style.label=pay&style.layout=vertical&style.color=blue&style.shape=pill&style.tagline=false&style.height=40&components.0=buttons&locale.country=US&locale.lang=en&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVZIT2J5VTZ3VFpncG81bndtNDc2ZU9uZ3dsYjBCWmVmazhxRFpIUFpBU0J0dVNjbk5RMUVXWHF6LV9rV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2UsInZhdWx0YWJsZSI6dHJ1ZX19fSwidmVubW8iOnsiZWxpZ2libGUiOmZhbHNlfSwiaXRhdSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJjcmVkaXQiOnsiZWxpZ2libGUiOmZhbHNlfSwiYXBwbGVwYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwic2VwYSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJpZGVhbCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJiYW5jb250YWN0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sImdpcm9wYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwiZXBzIjp7ImVsaWdpYmxlIjpmYWxzZX0sInNvZm9ydCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJteWJhbmsiOnsiZWxpZ2libGUiOmZhbHNlfSwicDI0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sInppbXBsZXIiOnsiZWxpZ2libGUiOmZhbHNlfSwid2VjaGF0cGF5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sInBheXUiOnsiZWxpZ2libGUiOmZhbHNlfSwiYmxpayI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJ0cnVzdGx5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sIm94eG8iOnsiZWxpZ2libGUiOmZhbHNlfSwibWF4aW1hIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJvbGV0byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJtZXJjYWRvcGFnbyI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ&platform=desktop&experiment.enableVenmo=true&flow=purchase¤cy=USD&intent=capture&commit=true&vault=false&renderedButtons.0=paypal&renderedButtons.1=card&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=false:1317:19688)
at e.n.resolve (https://www.sandbox.paypal.com/smart/buttons?style.label=pay&style.layout=vertical&style.color=blue&style.shape=pill&style.tagline=false&style.height=40&components.0=buttons&locale.country=US&locale.lang=en&sdkMeta=e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GVyIjp7ImVsaWdpYmxlIjpmYWxzZSwidmF1bHRhYmxlIjpmYWxzZX0sImVsbyI6eyJlbGlnaWJsZSI6ZmFsc2UsInZhdWx0YWJsZSI6dHJ1ZX0sImpjYiI6eyJlbGlnaWJsZSI6ZmFsc2UsInZhdWx0YWJsZSI6dHJ1ZX19fSwidmVubW8iOnsiZWxpZ2libGUiOmZhbHNlfSwiaXRhdSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJjcmVkaXQiOnsiZWxpZ2libGUiOmZhbHNlfSwiYXBwbGVwYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwic2VwYSI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJpZGVhbCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJiYW5jb250YWN0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sImdpcm9wYXkiOnsiZWxpZ2libGUiOmZhbHNlfSwiZXBzIjp7ImVsaWdpYmxlIjpmYWxzZX0sInNvZm9ydCI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJteWJhbmsiOnsiZWxpZ2libGUiOmZhbHNlfSwicDI0Ijp7ImVsaWdpYmxlIjpmYWxzZX0sInppbXBsZXIiOnsiZWxpZ2libGUiOmZhbHNlfSwid2VjaGF0cGF5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sInBheXUiOnsiZWxpZ2libGUiOmZhbHNlfSwiYmxpayI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJ0cnVzdGx5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sIm94eG8iOnsiZWxpZ2libGUiOmZhbHNlfSwibWF4aW1hIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJvbGV0byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJtZXJjYWRvcGFnbyI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ&platform=desktop&experiment.enableVenmo=true&flow=purchase¤cy=USD&intent=capture&commit=true&vault=false&renderedButtons.0=paypal&renderedButtons.1=card&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=false:1317:18745)
at https://www.sandbox.paypal.com/smart/buttons?style.label=pay&style.layout=vertical&style.color=blue&style.shape=pill&style.tagline=false&style.height=40&components.0=buttons&locale.country=US&locale.lang=en&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVZIT2J5VTZ3VFpncG81bndtNDc2ZU9uZ3dsYjBCWmVmazhxRFpIUFpBU0J0dVNjbk5RMUVXWHF6LV9rV0tySEdPM1JHTWZLaF9ydzl0ZWcmY3VycmVuY3k9VVNEIiwiYXR0cnMiOnsiZGF0YS11aWQiOiJ1aWRfcmhyZnFrcmRqcnJibnJ5aXNlamxqZnJkY2NscHpmIn19&clientID=AVHObyU6wTZgpo5nwm476eOngwlb0BZefk8qDZHPZASBtuScnNQ1EWXqz-_kWKrHGO3RGMfKh_rw9teg&sdkCorrelationID=af48b1f23061a&storageID=uid_59c1216f0c_mtm6mzc6mjq&sessionID=uid_ff296ed2ff_mty6mzm6ntg&buttonSessionID=uid_2b0be9f5d9_mty6mzu6ntu&env=sandbox&fundingEligibility=eyJwYXlwYWwiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sInBheWxhdGVyIjp7ImVsaWdpYmxlIjpmYWxzZSwicHJvZHVjdHMiOnsicGF5SW40Ijp7ImVsaWdpYmxlIjpmYWxzZSwidmFyaWFudCI6bnVsbH0sInBheWxhdGVyIjp7ImVsaWdpYmxlIjpmYWxzZSwidmFyaWFudCI6bnVsbH19fSwiY2FyZCI6eyJlbGlnaWJsZSI6dHJ1ZSwiYnJhbmRlZCI6dHJ1ZSwiaW5zdGFsbG1lbnRzIjpmYWxzZSwidmVuZG9ycyI6eyJ2aXNhIjp7ImVsaWdpYmxlIjp0cnVlLCJ2YXVsdGFibGUiOnRydWV9LCJtYXN0ZXJjYXJkIjp7ImVsaWdpYmxlIjp0cnVlLCJ2YXVsdGFibGUiO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CJtZXJjYWRvcGFnbyI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ&platform=desktop&experiment.enableVenmo=true&flow=purchase¤cy=USD&intent=capture&commit=true&vault=false&renderedButtons.0=paypal&renderedButtons.1=card&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=false:1317:18389
at XMLHttpRequest.<anonymous> (https://www.sandbox.paypal.com/smart/buttons?style.label=pay&style.layout=vertical&style.color=blue&style.shape=pill&style.tagline=false&style.height=40&components.0=buttons&locale.country=US&locale.lang=en&sdkMeta=eyJ1cmwiOiJodHRwczovL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVZIT2J5VTZ3VFpncG81bndtNDc2ZU9uZ3dsYjBCWmVmazhxRFpIUFpBU0J0dVNjbk5RMUVXWHF6LV9rV0tySEdPM1JHTWZLaF9ydzl0ZWcmY3VycmVuY3k9VVNEIiwiYXR0cnMiOnsiZGF0YS11aWQiOiJ1aWRfcmhyZnFrcmRqcnJibnJ5aXNlamxqZnJkY2NscHpmIn19&clientID=AVHObyU6wTZgpo5nwm476eOngwlb0BZefk8qDZHPZASBtuScnNQ1EWXqz-_kWKrHGO3RGMfKh_rw9teg&sdkCorrelationID=af48b1f23061a&storageID=uid_59c1216f0c_mtm6mzc6mjq&sessionID=uid_ff296ed2ff_mty6mzm6ntg&buttonSessionID=uid_2b0be9f5d9_mty6mzu6ntu&env=sandbox&fundingEligibility=eyJwYXlwYWwiOnsiZWxpZ2libGUiOnRydWUsInZhdWx0YWJsZSI6dHJ1ZX0sInBheWxhdGVyIjp7ImVsaWdpYmxlIjpmYWxzZSwicHJvZHVjdHMiOnsicGF5SW40Ijp7ImVsaWdpYmxlIjpmYWxzZSwidmFyaWFudCI6bnVsbH0sInBheWxhdGVyIjp7ImVsaWdpYmxlIjpmYWxzZSwidmFyaWFudCI6bnVsbH19fSwiY2FyZCI6eyJlbGlnaWJsZSI6dHJ1ZSwiYnJhbmRlZCI6dHJ1ZSwiaW5zd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9LCJ0cnVzdGx5Ijp7ImVsaWdpYmxlIjpmYWxzZX0sIm94eG8iOnsiZWxpZ2libGUiOmZhbHNlfSwibWF4aW1hIjp7ImVsaWdpYmxlIjpmYWxzZX0sImJvbGV0byI6eyJlbGlnaWJsZSI6ZmFsc2V9LCJtZXJjYWRvcGFnbyI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ&platform=desktop&experiment.enableVenmo=true&flow=purchase¤cy=USD&intent=capture&commit=true&vault=false&renderedButtons.0=paypal&renderedButtons.1=card&debug=false&applePaySupport=false&supportsPopups=true&supportedNativeBrowser=false:1317:38897)
is there an additional step or any solutions to make this work, thank you
For testing in sandbox, create a new Sandbox business account for a new sandbox country, such as US, and then make a new sandbox REST app for that business account with a new client ID.
For later going live, if the receiving business account is in one of the countries listed here, ensure there is a bank or visa card on the account that is capable of withdrawing funds automatically, in order for that account to be able to receive payments. This seems to be a special regulatory requirement in those countries, but have the account owner contact PayPal's general business or customer support if they need more information
I am newbie in the chatbot domain. I need to develop a dialogflow chatbot which can store the data collected from user to Google Cloud Datastore Entities(not Firebase real time database) and retrieve it back when the user want to search.
I can able to write the data collected from user to datastore. But I am struggling in retrieving the data. I am writing the function in the dialogflow inline editor.
Write function :
function order_pizza(agent) {
var pizza_size = agent.parameters.size;
var pizza_topping = agent.parameters.pizza_topping;
var date_time = agent.parameters.size;
const taskKey = datastore.key('order_item');
const entity = {
key: taskKey,
data: {
item_name: 'pizza',
topping: pizza_topping,
date_time: date_time,
order_time: new Date().toLocaleString(),
size: pizza_size }
};
return datastore.save(entity).then(() => {
console.log(`Saved ${entity.key.name}: ${entity.data.item_name}`);
agent.add(`Your order for ${pizza_topping} pizza has been placed!`);
});
}
where "order_item" is the kind(table in datastore) the data is being stored. It is storing the data successfully.
Read data:(the function not working)
function search_pizza(agent){
const taskKey = datastore.key('order_item');
var orderid = agent.parameters.id;
const query = datastore.createQuery('taskKey').filter('ID','=', orderid);
return datastore.runQuery(query).then((result) =>{
agent.add(result[0]);
});
}
This is what i tried so far! Whereever i search I can find the result for firebase realtime database. But can't find solution for google datastore!
Followed many tutorial. But can't quite get it right! Kindly help!
I am working on a Flutter app and need to include the Facebook and Google login options in our app login page. I am not using Firebase and working on the MySQL database for storing and retrieving user's data.
I am looking for Adding the FB and Google authentication in my flutter app without the Firebase. I was not able to find any article for this. Everywhere it is always using the Firebase.
After following a tutorial, I have registered my app in FB Developer console, but I am not sure what will be put in the 'OAuth redirect URL' field there.
Currently, I am using xampp server and nodeJS for server side handling. Below is the code which I am calling on my button click. I am using plugin for Facebook authentication(Please let me know if this plugin is specifically for Firebase).
void initiateFacebookLogin() async {
var facebookLogin = FacebookLogin();
facebookLogin.loginBehavior = FacebookLoginBehavior.webViewOnly;
print("Inside fb login");
var facebookLoginResult = await facebookLogin
.logInWithReadPermissions(['email', 'public_profile']);
switch (facebookLoginResult.status) {
case FacebookLoginStatus.error:
print("Error");
onLoginStatusChanged(false);
break;
case FacebookLoginStatus.cancelledByUser:
print("CancelledByUser");
onLoginStatusChanged(false);
break;
case FacebookLoginStatus.loggedIn:
print("LoggedIn");
var graphResponse = await http.get(
'https://graph.facebook.com/v2.12/me?fields=name,first_name,last_name,email,picture.height(200)&access_token=${facebookLoginResult.accessToken.token}');
var profile = json.decode(graphResponse.body);
print(profile.toString());
onLoginStatusChanged(true, profileData: profile);
break;
}
}
As mentioned in the comments, both Facebook and Google Sign in can work without Firebase. There's a sample code for Flutter google_sign_in package that you can try here.
I am trying to implement a 1:m relationship between Contacts & Service Contracts in VTiger 6. We will use the relationship to track Users of our system. Each Contact should only be allowed to be link to 1 Service Contract at a time (1:m).
I was able to get the ServiceContract side of this working by using the following code:
require_once 'vtlib/Vtiger/Module.php';
$scmodule=Vtiger_Module::getInstance('ServiceContracts');
$scmodule->setRelatedList(Vtiger_Module::getInstance('Contacts'), 'Users',Array('SELECT'),'get_related_list');
This added a tab on the right side of Service Contracts titled "Users" with a SELECT button and allows us to ADD/REMOVE Contacts from the list.
However, what we would also like is to have a field on the Contacts page that shows which Service Contract they are linked to.
UPDATE:
I used the following code to add a single Service Contract field to Contacts:
`
include_once('vtlib/Vtiger/Module.php');
$module = Vtiger_Module::getInstance('Contacts');
$blockInstance = Vtiger_Block::getInstance('LBL_CONTACT_INFORMATION', $module);
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'SelectYourAccount';
$fieldInstance->label = 'Account';
$fieldInstance->uitype = 10;
$fieldInstance->typeofdata = 'V~O';
$blockInstance->addField($fieldInstance);
$fieldInstance->setRelatedModules(Array('ServiceContracts'));`
The above code worked fine and I have an Account field in contact details that I can link to a single Service Contract; however, when I select a Service Contract for a Contact and then go to the Users list on the Service Contract, the Contact isn't listed.
Any help would be greatly appreciated!
What i understand from your Question is that Contact is your "1" module and Service Contract is "M(Multi Record)" module. Which means 1 Contact will have multiple Service Contract. So in vtiger Service Contract Related List is already given under Contact Module.Please check this image below.
Next in Service Contract you will have Option to select Contact so that Contract will be liked with "1" Contact. See Screenshot here.
I Hope you will get clear picture after reading this of Relation in Vtiger.
I'm new to the Facebook Ads Python SDK and am trying to create an ad that will display on mobile and desktop news feeds. Reviewing the web flow to create an ad, to show up in a feed, the ad needs to be related to a Facebook page. I manage a Facebook page, but am not sure where I need to input the FB page info.
I've reviewed the documentation and getting started examples, however the getting started is about a page post ad, so not relevant to me. I assumed "Placements" would be relevant but nothing I find there is helpful either. I also looked at Connection objects but that also seemed a dead end.
The code I've got runs and creates ads that are right column ads. I've tried adding "page_types: ['feed']" to AdSet targeting but that returns an error saying that placement is ineligible for this ad.
Could someone point me in the right direction on how to create an ad that will show up in the desktop news feed? Meat of the code is below.
`
# create campaign
campaign = AdCampaign(parent_id=config['act_account_id'])
campaign[AdCampaign.Field.name] = 'Test Campaign'
campaign[AdCampaign.Field.status] = AdCampaign.Status.paused
campaign[AdCampaign.Field.objective] = AdCampaign.Objective.website_clicks
campaign.remote_create()
# create adset
targeting = {
#'page_types': ['feed'],
'geo_locations': {
'cities': [{'key': '2532348', 'radius': 25, 'distance_unit': 'mile'}]
}
}
data = {
AdSet.Field.name: 'My Python SDK AdSet',
AdSet.Field.bid_type: AdSet.BidType.cpc,
AdSet.Field.is_autobid: True,
AdSet.Field.status: AdSet.Status.active,
AdSet.Field.lifetime_budget: 500,
AdSet.Field.end_time: '2015-06-4 23:59:59 PDT',
AdSet.Field.campaign_group_id: config['campaign_id'],
AdSet.Field.targeting: targeting,
}
adset = AdSet(parent_id=config['act_account_id'])
adset.remote_create(params=data)
# Set up creative for ad
image = AdImage(parent_id=config['act_account_id'])
image[AdImage.Field.filename] = image_filename
image.remote_create()
creative = AdCreative(parent_id=config['act_account_id'])
creative[AdCreative.Field.name] = 'sample creative'
creative[AdCreative.Field.title] = 'ad headline'
creative[AdCreative.Field.body] = 'ad text'
creative[AdCreative.Field.object_url] = 'www.http://www.misc-url.com'
creative[AdCreative.Field.image_hash] = image[AdImage.Field.hash]
creative.remote_create()
# Create your ad by referencing the ad creative.
adgroup = AdGroup(parent_id=config['act_account_id'])
adgroup[AdGroup.Field.name] = 'Testing SDK Ad'
adgroup[AdGroup.Field.campaign_id] = config['adset_id']
adgroup[AdGroup.Field.creative] = {'creative_id': str(creative_id)}
adgroup[AdGroup.Field.status] = AdGroup.Status.paused
adgroup.remote_create()
`
There is an api call to create a page post at the time of ad creation:
https://developers.facebook.com/docs/marketing-api/adcreative/v2.3#object_story_spec
See the blog post for more detailed info:
https://developers.facebook.com/ads/blog/post/2014/08/28/creative-page-post-api