Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFacing issue in getting account details #25
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi Jigna, I've updated your comment in order to hide your personal information. Don't share your tokens keys. Regarding to the error. Do you get any exception? Have you connected before with the ads api with TWURL or another app? Thanks |
This comment has been minimized.
This comment has been minimized.
cipljigna
commented
Apr 17, 2017
|
HI hborras, Thanks for hiding my info. I have checked and i am getting now following error. Fatal error: Uncaught Hborras\TwitterAdsSDK\TwitterAds\Errors\NotAuthorized: NOT_AUTHORIZED. Do you know how i can authorize or give permission to my Ad account. Can you please share TURL sample code in php. How i can fetch camping's detils, ads list, ads click, etc. Thanks in advance. |
This comment has been minimized.
This comment has been minimized.
|
Hi Jigna, Do you have your app whitelisted for Twitter Ads API? It could be also a mistake in the access tokens. Go here https://apps.twitter.com/app/{{your_app_id}}/keys And regenerate them |
This comment has been minimized.
This comment has been minimized.
cipljigna
commented
Apr 17, 2017
|
HI Hborras, i have done changes as per you request but still facing same error. I also trying to solve this from my end. Fatal error: Uncaught Hborras\TwitterAdsSDK\TwitterAds\Errors\NotAuthorized: NOT_AUTHORIZED in httpdocs/twitter_ads/src/TwitterAds.php:428 Stack trace: #0 httpdocs/twitter_ads/src/TwitterAds.php(408): Hborras\TwitterAdsSDK\TwitterAds->manageErrors(Object(stdClass)) #1 httpdocs/twitter_ads/src/TwitterAds.php(221): Hborras\TwitterAdsSDK\TwitterAds->http('GET', 'https://ads-api...', 'accounts/18ce54...', Array) #2 httpdocs/twitter_ads/src/TwitterAds/Account.php(71): Hborras\TwitterAdsSDK\TwitterAds->get('accounts/18ce54...', Array) #3 httpdocs/twitter_ads/src/TwitterAds.php(88): Hborras\TwitterAdsSDK\TwitterAds\Account->load('18ce54hdiwf') #4 /httpdocs/twitter_ads/examples/quick_start.php(22): Hborras\TwitterAdsSDK\TwitterAds->getAccounts('18ce54hdiwf') #5 {main} thrown in /httpdocs/twitter_ads/src/TwitterAds.php on line 428 Thanks |
This comment has been minimized.
This comment has been minimized.
|
Hi Jigna, I think I know what the problem is. Could it be that, the account you have selected '18ce54hdiwf', you don't have access with your user? I explain: There're two ways to connect in Twitter Ads API with one Ads Account. 1 - A user creates an APP, (like your app) and use the access tokens provided in the page I've pointed before. Is NECESSARY to: for the user that has created the app, to be allowed to manage that Ad Account. 2 - A user creates an APP, and connect with other user, obtain new ACCESS_TOKEN and ACCESS_TOKEN_SECRET and use their access tokens CONSUMER_KEY and CONSUMER_SECRET are equal (because they are related to the app). This is something that you should do on your end. With this lib you can switch between accounts, but the connection should be done in your end. Tell me if this helped you! Thanks |
cipljigna commentedApr 17, 2017
•
edited by hborras
Hi There,
I am trying to fetch account details through "quick_start.php" but i am not getting any data. Please see below details for your reference.
const CONSUMER_KEY = '';
const CONSUMER_SECRET = '';
const ACCESS_TOKEN = ' ';
const ACCESS_TOKEN_SECRET = '';
const ACCOUNT_ID = '';
// Create twitter ads client
$twitterAds = new TwitterAds(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
// Retrieve account information
$account = $twitterAds->getAccounts(ACCOUNT_ID);
print_r($account);
In $account, i am not getting any data.
Thanks in advance.
Jigna Mandaliya