CPA auto bid API - facebook

i heard somthing about an option to upload CPA campaigns with auto bid. couldnt find this option in the API support.
did anyone hear anything about it?

This is a property on adset level. Set the property is_autobid to true when creating the adset. According to:
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign

Related

Google Calendar REST API does not return title and other event fields

Google calendar REST API GET method (https://developers.google.com/calendar/v3/reference/events/get) should return this structure (https://developers.google.com/calendar/v3/reference/events#resource), unless I'm missing something.
I need to get event title and description to use in my application. I 'm getting below response instead.
I've tried to change event visibility (public/private) and availability (free/busy). Actually, API does not show events with Free availability, for which I don't have solution either.
Here is event edit screen screenshot:
https://www.screencast.com/t/X8bRS8kJDT
{
"kind":"calendar#event",
"etag":"\"3145149995624000\"",
"id":"5fnlvcl2msab46p8roqbahhb6g",
"status":"confirmed",
"htmlLink":"https://www.google.com/calendar/event?eid=NWZubHZjbDJtc2FiNDZwOHJvcWJhaGhiNmcgZWQtYWRtaW4uY29tXzMwOHNycjdzdjdiM28xazRpdjZ2cm9mb3Y0QGc",
"updated":"2019-11-01T02:23:17.812Z",
"start":{
"dateTime":"2019-11-11T09:30:00+11:00"
},
"end":{
"dateTime":"2019-11-11T10:00:00+11:00"
},
"visibility":"private",
"iCalUID":"5fnlvcl2msab46p8roqbahhb6g#google.com"
}
Are there other methods to get calendar events details with REST API, including ones with free availability?
Thanks.
04/02/2020:
I actually made it work for "ordinary" Google account - add project, add API, add service account and allocate service account email to the calendar. But I still not sure how to change access level for G Suite account. It allows only to see Free/Busy status.
I've changed default access in Admin Console as this article suggests, but it does not help:
https://www.macworld.com/article/2980005/the-mystery-of-the-unsharable-google-apps-calendar.html
You could try specifying the fields you want to retrieve like the image below:
Or you could put a " * " as the image below to retrieve all values:
fields is a standard Query parameter, which specifies what values you want to include in your response. To learn more about it, you can check Here.

How to create a Facebook ad based on a post?

After many tries, I'm not getting how we can use the Facebook API to create a simple Ad based on a Post (and it's creative) like it is possible in the Business Manager.
For example, my last attempt failed due to a problem with Instagram:
Facebook API: Instagram Account Is Missing
If there is anybody that has been able to create a basic Ad (within a given or new AdSet) based on a Post, please help me. I've seen many questons like this (especially regarding the Instagram problem) and now I'd like to have a working solution.
What exact requests have to be done or isn't it possible at all?
THe Instagram placement is added by default in the targeting, so if you want to skip it you need to specify in the targeting field when creating the adSet in the publisher field:
{
"geo_locations":{"countries":["US"]},
publisher_platforms: ['facebook'],
facebook_positions: ['feed', 'right_hand_column'],
device_platforms: ['mobile', 'desktop']
}
If you want to publish on Instagram also you should also provide an instagram actor ID: The AdsCreative should contain an extra field named instagram_actor_id also remember to add Instagram in the related targeting:
{
"geo_locations":{"countries":["US"]},
publisher_platforms: ['facebook','instagram'],
facebook_positions: ['feed', 'right_hand_column'],
instagram_positions: ['stream', 'story'],
device_platforms: ['mobile', 'desktop']
}
Reference:
https://developers.facebook.com/docs/marketing-api/guides/instagramads
https://developers.facebook.com/docs/marketing-api/guides/instagramads/ads_management/
https://developers.facebook.com/docs/marketing-api/targeting-specs/#placement
Let me know if you need more info or an answer or your other question about Instragam

"call_to_action_type field in creative is required in this ad" returned while creating ads using marketing api

When I use adcreatives endpoint with object_story_spec parameter to create ads or using object_story_id parameter following instructions in this link :
I got this error message:
{"error":{"message":"Invalid
parameter","type":"FacebookApiException","code":100,"error_subcode":1487664,"is_transient":false,"error_user_title":"Missing
Call To Action Type","error_user_msg":"call_to_action_type field in
creative is required in this ad"}}
Anyone knows how to solve this problem?
Are you not setting the call_to_action field? While it's not explicitly stated in the docs (as far as I can see) the field is mentioned for all ads for mobile app install or engagement campaigns so I suggest setting it.
https://developers.facebook.com/docs/marketing-api/mobile-app-ads/v2.2#cta_definitions

How can I use automatic bid pricing on the Facebook Ads API?

I'm using the Facebook Ads API to create Page Post Engagement ads. The API is in general a breeze to use but I can't seem to find a way to set automatic bid pricing or, in other words, achieve this:
rather than this, which is what I'm getting:
My ad set is being created with bid_type: "ABSOLUTE_OCPM" and bid_info: "{'ACTIONS':500}". bid_info is a required parameter so I can't leave it out. Setting it to 0 doesn't work either.
Any ideas?
bid_info is required only if you set is_autobid to false, which you need to set to true when you create your set.
With bid_type: "ABSOLUTE_OCPM" and bid_info: "{'ACTIONS':500}" you are saying that you'd like to bid 500 units of account's currency on action, which are expressed in cents. And as you are requesting Optimized CPM, you say how much the fulfillment of a particular goal is worth to you, therefore the $5.00 USD always show up there. As per FB Optimized CPM documentation these values are not bids.
There is no official way to set automatic bid via API. Moreover, usually you can just use oCPM and bid the same amount used by Facebook when you create a campaign using the automatic bid. Then PowerEditor will show you that you're using automatic bid.
=== NEW FROM v2.3 ===
From version 2.3 there is the is_autobid field. By setting it to true Facebook will set the bid value automatically. You can read more here: https://developers.facebook.com/docs/marketing-api/adset/v2.3#create

Does HWIOAuthBundle support retrieving friends list, gender, country

I have just implemented the HWIOAuthBundle in my symfony project. Actually, it is configured with facebook and I am wondering if it supports retrieving friends list, gender and country?
If yes, could you please provide me an example of code for the function public function loadUserByOAuthUserResponse(UserResponseInterface $response)?
It would be really helpful.
Thanks.
I found the solution by my self!!!
HWIOAuthBundle supports retrieving any thing you want. All what you have to do is to specify it in the facebook api then through the method getResponse() you will have access to them.
$attr=$response->getResponse();
// then get your field like this
$user->setGender($attr['gender']);
I guess now it is easy.