2

I use Instagram-API for the posting images with captions. I try:

$ig->timeline->uploadPhoto($photo->getFile(), ["caption" => "Hello world!"]);

The request is completed, the image is successfully uploaded, but the caption is empty.

When I run the example uploadPhoto.php, the image is also loaded without a title.

How can I fix that?

scopchanov
  • 7,966
  • 10
  • 40
  • 68
amensum
  • 21
  • 4

1 Answers1

0
$photoFilename = Enter Path here;

$photo = new \InstagramAPI\Media\Photo\InstagramPhoto($photoFilename);

$captionText = 'Hello world!';

$ig->timeline->uploadPhoto($photo->getFile(), ['caption' => $captionText]);

Run this Code it works Properly.

If Any Issue came then send me your code, I will correct it.

Aliaksandr Sushkevich
  • 11,550
  • 7
  • 37
  • 44