PHP Instagram-API: Caption text does not exist

萝らか妹 提交于 2019-12-11 03:53:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!