Comments (6)
Sorry, now I've got it.
If anyone else ever gets as confused as I was, this is the solution:
$account = new AdAccount('act_' . $accountID);
$reports = $account->getReportsStats($fields, $params);
$response = array();
foreach($reports as $report) {
$response[] = $report->getData();
}
return json_encode($response);
from facebook-php-business-sdk.
it looks like you're doing a lot of work to just get the json again, you may want to think about something like:
$json = $reports->getResponse()->getRawResponse();
from facebook-php-business-sdk.
Thanks, much better!
from facebook-php-business-sdk.
I am using the same code as la-bas but I'm greeted with a permission error. It seems I can't reach reports as an Analyst account while I can reach the reports via the Ads Manager. What's the difference between calling them in the browser and calling them in code?
Error:
This Ads API call requires the user to be admin of the ad account. User xxxxxxxxxxxx not admin on ad account xxxxxxxxxxxxxxxxxxxxx.
from facebook-php-business-sdk.
@siegerhansma, please create a new issue with the exact series of requests your using and we can look into it
from facebook-php-business-sdk.
The SDK requires PHP 5.4 and above so this is why you see these errors.
Sent from my iPhone
On Dec 5, 2014, at 7:55 PM, sandy69 [email protected] wrote:
I am getting PHP Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in /FacebookAds/Object/AdAccount.php on line 34
Below is the PHP Code, where I am accessing the class. Please let me know, if you see any issues with the code. I am not a PHP Expert. Thanks.
array ( 'account_id', 'total_actions', 'spend' ), 'date_preset' => 'last_7_days', ); $account = new AdAccount('act_' . $accountID); $account->getReportsStats($fields, $params); return json_encode($account->getData()); ?>—
Reply to this email directly or view it on GitHub.
from facebook-php-business-sdk.
Related Issues (20)
- getDefaultRequestHeaders() is misspelled as getDefaultRequestHeaderds() HOT 1
- PHP 8.1 Deprecation HOT 4
- syntax error, unexpected '|', expecting ';' or '{' HOT 4
- Union types are only allowed since php8 HOT 2
- Exception: field 'id' is required Error HOT 2
- شخص ما أخترق حسابي الشخصي
- Normalizer.php strlen() must be of type string Problem
- Facebook Multi-Language Ads
- Syntax error in FB version v16.0.0 HOT 1
- The AdAccountFields enum does not currently implement the ACCOUNT_STATUS field. HOT 1
- Exception thrown without a stack frame in Unknown on line 0 HOT 1
- How to create a AAA advertisements above version 17
- Fix package installation instructions in README file
- Fff HOT 1
- error
- ad creative Url Tracking Params Update HOT 1
- OpenSSL SSL_connect: Connection reset by peer in connection to graph.facebook.com:443 Error
- Static singletons used everywhere HOT 3
- Incorrect PHPDoc types HOT 2
- Not able to access Business User Insights for multiple users using the Instagram API.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-php-business-sdk.