Facebook API find corresponding Page by Ad id - facebook

I'm trying to retrieve all the ad spent values for my facebook posts through the Facebook Graph API. I went from Business => Owned Ad Accounts => Ad Account => Campaign => Ad set => Ad, but now I can't find the page id or the ad spent value anywhere.
Read through this link and tried https://graph.facebook.com/v15.0/{AD_ID}

Related

Get Facebook ad videos under a specific campaign

My requirement is to get total_video_views_unique, total_video_complete_views_paid_unique, total_video_10s_views_unique of ad videos under a specific campaign.
Is there a way to get all the ad videos under a campaign? There is a service that returns all the ad videos under the ad account.

How to get metrics data for only Instagram Ad Campaigns from Facebook Ad Account using Graph API

How do I fetch only Instagram Ad Campaigns instead of all Ad Campaigns from Facebook Graph API.
Here is what I have tried till now.
var url = https://graph.facebook.com/v3.3/"+ad_account_id+"/insights?fields=spend,
clicks,impressions,account_currency,actions&breakdowns=publisher_platform
When I make a request to the above URL, I'm getting all Campaigns data. How do I create the URL to request only Instagram Ad Campaigns?
I have the same problem and found a solution like the one below. you can check it now using Facebook API v14
<your act account>/insights?fields=inline_link_clicks,impressions,reach,frequency,ctr,cost_per_inline_link_click,spend&breakdowns= publisher_platform,platform_position&level=account

Is there any API for Facebook to get all the published ads?

I want to get all the published ads in the facebook searched by keywords or URL's, I know that you can get your own ads by giving campaign ID but Is there any API that will get all the ads not for current user but all user's ads?

How to add or invite user for facebook group using graph API?

I have created one group manually from my Facebook account(App administrator account).
Now i want to add/invite users using graph API for that Group
`$this->fb->post( '/725465137614144/members',array ('member' => '102335487019551'), $accessToken);`
`725465137614144 => Group ID
102335487019551 => invited User id
$accessToken => admin user access token`
So how to add user in group using group id.
So how to add user in group using group id.
Not possible, there is no API for that.
(Yes, https://developers.facebook.com/docs/graph-api/reference/v2.9/group/members#publish still mentions it is possible for groups created by the app; but this feature called "App and Games Groups" has been removed a while ago already.)

Not getting expected campaign IDs when using Facebook Ad Report Stats API

I created an access token with my personal account with additional ad_management permissions. I used curl to exchange this short-lived token for a permanent access token.
The roles page for my ads account says "You can manage campaigns, view reports, and view billing information."
I use this access_token with curl to get the offsite_conversions count from yesterday. The results contain data for a few campaigns. However these campaigns are nowhere to be found in the campaigns list in the ads manager. If I click a campaign and replace the ID in the url with one of the campaign ids int he response I get a "This content is currently unavailable" error page.
Additionally there are at least three campaigns shown in the ads manager's campaign list which do have a few offsite conversions recorded which are not showing up in the response of the Ad Report Stats API call.
How can I get more information to solve this problem?
I was confused by the relatively recent change in the ad campaign terminologies. The reporting api is still using the old terms where a campaign corresponds to what is now an ad set.
If you want to match the campaigns in the ads manager with the campaigns you can fetch with the marketing api I would recommend you add ?fields=name. If you don't recognise the names, then there is probably something wrong :-)