I want to pull ad data (campaigns, ad sets, & metrics like clicks/impressions/ctr) from Facebook using their API and put it into a database. Facebook's documentation says I need to create an app on their site in order to access the API, but that doesn't seem right. I'm not trying to create an app for my fb page, just want to extract data.
My first choice was to use an ODBC driver from
CData
, which does allowed me to successfully pull data from AdAccounts but threw an error when trying to get AdSets or AdStatistics:
OAuthException Code 10: You do not have sufficient permissions to perform this action.
I made sure to add in a target='act_{myAdAccountId}' parameter to the query, as per their documentation, but it didn't help. I figured this meant I didn't configure the driver properly, so maybe I'd have better luck just coding up a solution in python or php.
Next, I tried to run similar API calls using the Graph API Explorer and got the same error message. I created an access token that had all the extended permissions and then made a request to
GET /v2.4/act_{myAdAccountId}/adcampaigns.
This gave me the exact same OAuthException Code 10 error that I was getting through the ODBC Driver.
Can someone confirm whether it's possible to pull data from the API without building an app? If so, what permissions do I need to enable for my account? I'm already an Ad Account Admin in the "Ads Manager", and couldn't find anywhere else to set permissions.
Thanks!
Apps have no direct relation to Pages. You need to create an App for any API access. I did not use the Ads API yet, but i assume you need to use the ads_management permission with your App.
How to create Apps and authorize with the required permissions is explained in the docs: https://developers.facebook.com/docs
Since you asked about Login Review, all the information you need about that can be found in the docs too: https://developers.facebook.com/docs/facebook-login/review
I understand this is an old post, but in case if anyone was looking at a similar situation, I was able to call the Facebook Marketing API without building an app.
I posted a similar answer on another more recent question (Do I need a publicly accessible webserver in order to user Facebook's marketing API?), and was curious if this situation puzzled anyone else, which led me to here.
I wrote my API calls using Python 2.7 on Juypter notebook, and I just followed Facebook's Marketing API documentation and examples, modifying with my access tokens and account information.
Related
I have a question about connecting my app, made with Flutter, with the Instagram API.
I want the user to register with their account, store the access token and then send a post to the API to publish a comment or add a like.
Can I do this with Flutter or do I need to use a different language like Python?
I checked the API documentation that Instagram provides and it seems that you can only do read-only requests (liking a post might not be possible).
The API you mentioned in your tags will not work with personal accounts, as Instagram states:
The API cannot access Instagram consumer accounts (i.e., non-Business or non-Creator Instagram accounts). If you are building an app for consumer users, use the Instagram Basic Display API instead.
You can try to use the mentioned Basic Display API instead, but mind you won't be able to author any posts or do actions in behalf of the user. To circumvent this, you might have to reverse-engineer the frontend facing portion of Instagram but I won't go into that.
To come back to your question, Flutter is well able to send network requests as mentioned here, but you still have a long way until you have functioning access to Instagram (check the Getting Started).
I wonder if it is possible to use a new Instagram Graph API only for hobby purpose(small java application). The main aim is to process only user's data that is currently log in on instagram(not other's user data). Generally I'm a beginner on this field and I try to determine my chances for writing this kind of application, because I've read that sometimes it is hard to get permission to API from facebook, so maybe somebody know how it works in practice?
From what I can tell on the docs site, the Graph API is only used if you're making something for Business Accounts. The docs say that if making something for non-business users, to use the old API.
Reference here: https://developers.facebook.com/docs/instagram-api
I personaly suggest you to use new graph API, because older API support may be disabled in future and might be deprecated in future.
Moreover, Facebook does not give permission easily but you give proper & exact content if allows you and provide great support.
I want to create a facebook business page programatically via their API.
I looked at each of the technologies listed on developer.facebook.com but there is nothing that i can use to create a new page.
After alot of googling i found out that it seems to be impossible to create a page programatically. And i almost gave up, but then i found
https://www.pagemodo.com
Testing their service i see that they can actually create a new one and looking trought their javascript files it seesm they do it on the backend.
After reading some more i found about the new facebook business API ( https://developers.facebook.com/docs/reference/ads-api/businessmanager ), and i got nowhere with that either.
I am on the verge of believing that it's impossible, but having the working example on pagemodo makes me unable to give up :D .
[Possible Solution 1]
Another ideea that i have on how to achieve this is to
manually create a number of template pages on my account (not published).
add that user as an admin to one of the pages via API [*]
remove myself from the administration via API [*]
edit the page title/description/etc. via API
publish the page via API
For the normal users, it will look like the page was created auto,so this could work. But the problem is that i couldn't find anything in the API to make the [*] operations work.
Any help appreciated
It's possible. You need to get your Facebook App whitelisted to get access to page creation apis.
It is not possible to create business pages via the public Facebook API.
Just starting out with Facebook's API. I have a client that sends me the access_token after logging into to FB on iPhone. I am wondering where I would specify the permissions I need, for example to access email, or user's music data?
Is it via client using FBSession, or via Koala (ruby gem I use on server side with access_token to get user's info) or in Facebook's app settings page?
Thanks
If your user is logging in via an iOS app, you need to request them in the permissions parameter of FBSession. https://developers.facebook.com/docs/reference/ios/3.1/class/FBSession#permissions
Although I'm not a specialist in mobile development, so I cannot provide you with a functional example (or even properly explain how to do this) I have done a bit of browsing in the Facebook API section of the Developers website, and I believe that I have the answer to your questions. This will not only answer where, but it should also give you how, for many different purposes, there are different permissions that you must add, and this page gives you some idea of how to do all of them.
http://developers.facebook.com/docs/reference/login/
How do you query facebook's graph api via the javascript sdk for users that have allready given you permissions (offline access) and whose auth data you have stored, but who are not currently logged in to facebook?
To answer my question, you can in fact do so. You can use FB.api calls and include the access token at the end of the URL with ?access_token=
I'm not 100% sure of the code you'd need to actually do it, but I think one of the key elements to this would be logging in to the SDK as an application, rather than a Facebook User, as detailed in the documentation # http://developers.facebook.com/docs/authentication
Have you got an example query that you'd like to make with the SDK?