NicklasWallgren / instagram-api

Instagram Private API
MIT License
145 stars 47 forks source link

How can I comment on other's media post? #42

Closed Rocky-hana closed 3 years ago

Rocky-hana commented 3 years ago

I executed this code.

$instagram = Instagram::builder()->build();
$instagram->login('id', 'pw');
$response = $instagram->comment('media_id', 'test');

But I got this error.

 Instagram\SDK\Exceptions\ApiResponseException  : feedback_required

  at /vagrant/app/adtech_ugc/vendor/nicklasw/instagram-api/src/Response/Serializers/AbstractResponseSerializer.php:137
    133|             case ResponseErrorTypes::RATE_LIMIT:
    134|                 $exception = new RateLimitResponseException($envelope);
    135|                 break;
    136|             default:
  > 137|                 $exception = new ApiResponseException($envelope);
    138|                 break;
    139|         }
    140|
    141|         return $exception;

  Exception trace:

  1   Instagram\SDK\Response\Serializers\AbstractResponseSerializer::toException(Object(Instagram\SDK\Response\Responses\Media\CommentResponse))
      /vagrant/app/adtech_ugc/vendor/nicklasw/instagram-api/src/Response/Serializers/AbstractResponseSerializer.php:59

  2   Instagram\SDK\Response\Serializers\AbstractResponseSerializer::decode(Object(GuzzleHttp\Psr7\Response), Object(Instagram\SDK\Client\Client))
      /vagrant/app/adtech_ugc/vendor/nicklasw/instagram-api/src/Client/Client.php:174

Please tell me how to write the correct code. Thank you for the wonderful product!

NicklasWallgren commented 3 years ago

@Rocky-hana

Hey, Basically, that's an error from instagram where you hit the limit of the requests. Check your email or mobile app, try re-login and wait a few hours (maybe days) until proceeding.

Either that, or your account is flagged by Instagram for spam or abusive behaviour.