Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on $account = $twitterAds->getAccounts(ACCOUNT_ID); #27

Closed
panand363 opened this issue Jun 20, 2017 · 5 comments
Closed

Error on $account = $twitterAds->getAccounts(ACCOUNT_ID); #27

panand363 opened this issue Jun 20, 2017 · 5 comments

Comments

@panand363
Copy link

panand363 commented Jun 20, 2017

If I leave the ACCOUNT_ID empty, I still get the following error

Any help will be really appreciated.

`An uncaught Exception was encountered

Type: Hborras\TwitterAdsSDK\TwitterAds\Errors\Forbidden

Message: FORBIDDEN

Filename: /var/www/report-downloader/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php

Line Number: 430

Backtrace:

                File: /var/www/report-downloader/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php

                Line: 408

                Function: manageErrors                

        
    
        
            


                File: /var/www/report-downloader/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php

                Line: 221

                Function: http                

        
    
        
            


                File: /var/www/report-downloader/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds/Account.php

                Line: 58

                Function: get                

        
    
        
            


                File: /var/www/report-downloader/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php

                Line: 88

                Function: all                `
@hborras
Copy link
Owner

hborras commented Jun 20, 2017

Hi @panand363

It will be helpfull if you can tell me which are you using of the library and a piece of code to try to replicate it!

Thanks!

@panand363
Copy link
Author

panand363 commented Jun 21, 2017

Hey
thanks for the quick reply. Please check the following

` $twAds = new TwitterAds(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);

        //Retrieve Account information

        $account = $twAds->getAccounts(ACCOUNT_ID);
        $account = $twAds->getAccounts();`

I try either of the command ($twAds->getAccounts()) at one time and both give me the error. So basically with or without the ACCOUNT_ID .
Please note that I am assuming that the Owner ID in Twitter is same as ACCOUNT_ID .

Many thanks for your time
Regards

P Anand

@hborras
Copy link
Owner

hborras commented Jun 21, 2017

Hi @panand363 ,

I've checked this, and it looks like you are using bad credentials.

I want to check a few things before.

1 - Is your app whitelisted by the Twitter Ads API team? If not, you should contact with them before.

2 - OWNER_ID is NOT the same as ACCOUNT_ID. ACCOUNT_ID is an hexadecimal code associated to an account, but is not the same.

If you're not able to get your accounts with the second instruction:

$account = $twAds->getAccounts();

It looks like the problem is in the first point.

Could you check this?

Thanks!

@panand363
Copy link
Author

Hi @hborras ,
Sorry for replying later.
The First step for White-list, I am doing that now. You are right, My app was not whitelisted.

i am new with Twitter and had no clue to start. But thanks for all the help.

Regards

@hborras
Copy link
Owner

hborras commented Jun 26, 2017

@panand363 You're wellcome!

So I'm going to close this issue! 👍

@hborras hborras closed this as completed Jun 26, 2017
@ghost ghost mentioned this issue Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants