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

please how can i solve this , i can't retrieve user info #2

Closed
composercodes opened this issue Oct 17, 2015 · 7 comments
Closed

please how can i solve this , i can't retrieve user info #2

composercodes opened this issue Oct 17, 2015 · 7 comments

Comments

@composercodes
Copy link

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in /var/www/vhosts/showmb.com/dev1/maged/DirkGroenen/Pinterest/Utils/CurlBuilder.php on line 70

Fatal error: Uncaught exception 'DirkGroenen\Pinterest\Exceptions\PinterestException' with message 'Pinterest error (code: 401) with message: Authorization failed.' in /var/www/vhosts/showmb.com/dev1/maged/DirkGroenen/Pinterest/Transport/Request.php:196 Stack trace: #0 /var/www/vhosts/showmb.com/dev1/maged/DirkGroenen/Pinterest/Transport/Request.php(78): DirkGroenen\Pinterest\Transport\Request->execute('GET', 'https://api.pin...') #1 /var/www/vhosts/showmb.com/dev1/maged/DirkGroenen/Pinterest/Endpoints/Users.php(28): DirkGroenen\Pinterest\Transport\Request->get('me', Array) #2 /var/www/vhosts/showmb.com/dev1/maged/init.php(41): DirkGroenen\Pinterest\Endpoints\Users->me(Array) #3 /var/www/vhosts/showmb.com/dev1/maged/index.php(16): include('/var/www/vhosts...') #4 {main} thrown in /var/www/vhosts/showmb.com/dev1/maged/DirkGroenen/Pinterest/Transport/Request.php on line 196
@dirkgroenen
Copy link
Owner

This is more a problem of your PHP configuration. Please check this thread (or drop the error google and look through the results) to fix it for now.

In case anyone else is having the same questions I might check to create a workaround in the code.

@composercodes
Copy link
Author

@dirkgroenen Please can i give you my ftp details and you check where is the wrong ,
might be wrong with code , Please can you help me
Thanks,

@dirkgroenen
Copy link
Owner

You can paste the relevant parts of the code here or on something like codebin. Please make sure you've checked the sites from my previous response.

@composercodes
Copy link
Author

@dirkgroenen Please last question I need to get count of followers , It come as a collection how to get count .
{ "data": [ { "url": "https:\/\/www.pinterest.com\/ben\/", "first_name": "Ben", "last_name": "Silbermann", "id": "123456" }, { "url": "https:\/\/www.pinterest.com\/evan\/", "first_name": "Evan", "last_name": "Sharp", "id": "234567" } ], "page": { "cursor": "PyEyNXxmMGVmZDA5mOTAw", "next": "https:\/\/api.pinterest.com\/v1\/me\/followers\/?access_token=<YOUR-ACCESS-TOKEN>&cursor=PyEyNXxmMGVmZDA5YmOTAw" } }
Please how to get all count from this collection

Thanks,

@dirkgroenen
Copy link
Owner

Please surround your code with back-thicks makes it a bit more readable..

As for the followers count: you can't get that from the followers endpoint. The counts are located in the User object which can be retrieved through:

$pinterest->users->me(array(
    'fields' => 'username,first_name,last_name,counts'
));

Note the extra field count in the above example. You have to add this otherwise it will return null.

You can also you the find endpoint to retrieve this information for another user:

$pinterest->users->find('dirkgroenen', array(
    'fields' => 'username,first_name,last_name,counts'
));

@composercodes
Copy link
Author

@dirkgroenen Thanks very much for help .

Thanks,

@khalilrehman36
Copy link

Hi,
I am getting error while trying to create board using "dirkgroenen/Pinterest-API-PHP".

the error is.
PinterestException in Request.php line 227:
Pinterest error (code: 401) with message: Authorization failed.

My code to create board is.
$pinterest->boards->create(array(
"name" => "Test board from API",
"description" => "Test Board From API Test"
));

whereas I can get user information etc but problem is with post request.

Can you please help me in this regards.
Thanks in advance

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

3 participants