0

When posting pictures to Instagram, it does not post captions. Here's the sample code my mine

$captionText = 'test';
$instagramAPI->timeline->uploadPhoto( $resize_imag, ['caption' => $captionText]);

Picture is uploaded but caption is empty. How can i fix this?

cherrysoft
  • 1,165
  • 8
  • 17
zontrakulla
  • 87
  • 1
  • 11
  • What is $resize_imag? – Ingus Jan 14 '19 at 14:37
  • Can you indicate which implementation of the PHP Instagram API you are using. It will make it easier for people to help out. – cherrysoft Jan 14 '19 at 14:37
  • @Ingus I resize my image after getFile(), that's not the issue as it posts my image successfully. – zontrakulla Jan 14 '19 at 14:42
  • @cherrysoft I use this https://github.com/mgp25/Instagram-API – zontrakulla Jan 14 '19 at 14:44
  • According to the example what you are doing is in theory correct although we can't see the rest of your code. One difference - your "$resize_imag" variable doesn't look like it is an instance of InstagramPhoto as you are not using the getFile method. I understand you may / may not need this step (I am not about to dive into the library API) but maybe try that. Alternatively, assuming the library has no bugs that aren't in the issue list you could try checking permissions on your app (just a thought) or try with another lib. – cherrysoft Jan 14 '19 at 14:59
  • The caption will also not appear if you use a lot of hashtags in it. – Usama Ejaz Jun 30 '19 at 07:50

0 Answers0