问题
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?
回答1:
$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.
来源:https://stackoverflow.com/questions/52176066/php-instagram-api-caption-text-does-not-exist