dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:
https://developers.pinterest.com/docs/getting-started/introduction/
Apache License 2.0
173 stars 76 forks source link

pin send error #111

Closed suleymanengintr closed 4 years ago

suleymanengintr commented 4 years ago

I get the following error when sending pin but I couldn't find the solution

Fatal error: Uncaught DirkGroenenPinterestExceptionsPinterestException: Pinterest error (code: 400)

vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php on line 246

deindoideas commented 4 years ago

Hi, it's bad request error. Can you post params of pin you are trying to send ?

suleymanengintr commented 4 years ago

Notice: Undefined variable: pinid in /var/www/vhosts/domain.com/domain.domain.com/curls.php on line 182

Notice: Undefined variable: pin in /var/www/vhosts/domain.com/domain.domain.com/curls.php on line 188

Notice: Undefined variable: pin in /var/www/vhosts/domain.com/domain.domain.com/curls.php on line 189

Notice: Undefined variable: pin in /var/www/vhosts/domain.com/domain.domain.com/curls.php on line 189

Fatal error: Uncaught DirkGroenen\Pinterest\Exceptions\PinterestException: Pinterest error (code: 400) with message: You need to upload an image or provide the 'image_url' parameter in /var/www/vhosts/domain.com/domain.domain.com/pinte/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php:246 Stack trace: #0 /var/www/vhosts/domain.com/domain.domain.com/pinte/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php(98): DirkGroenen\Pinterest\Transport\Request->execute('POST', 'https://api.pin...', Array) #1 /var/www/vhosts/domain.com/domain.domain.com/pinte/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Endpoints/Pins.php(66): DirkGroenen\Pinterest\Transport\Request->post('pins/?fields=id...', Array) #2 /var/www/vhosts/domain.com/domain.domain.com/curls.php(190): DirkGroenen\Pinterest\Endpoints\Pins->create(Array) #3 {main} thrown in /var/www/vhosts/domain.com/domain.domain.com/pinte/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php on line 246

deindoideas commented 4 years ago

You have this error: You need to upload an image or provide the 'image_url' parameter. Are you sending image url on pin creation params ?

suleymanengintr commented 4 years ago

Yes, it sends this error on newly launched sites.

dirkgroenen commented 4 years ago

This is a Pinterest error, most likely not caused by the package but rather your implementation.

Please share more of your code so we can either reproduce it, or spot the issue.