api - modify relationship in instagram by using oriceon laravel 5 oauth wrapper -
iam using oriceon/oauth-5-laravel connecting instagram.i authenticated , got name , id through request
$result = json_decode($instagramservice->request('users/self'), true);
want follow person using oriceon/oauth-5-laravel. how post request follow person using .
**note:**dont refer instagram developer page.i reffred lot.but couldnt put post request oriceon/laravel oauth wrapper instagram.
help me.tysm in advance
try .copy method controller , proper routing.
public function followwithinstagram(request $request) { $instagram_id='id of user want follow'; $code = $request->get('code'); $instagramservice = \oauth::consumer('instagram'); if ( ! is_null($code)) { $state = isset($_get['state']) ? $_get['state'] : null; $instagramservice->requestaccesstoken($code, $state); $linkdata = [ 'action' =>'follow', ]; $result =json_decode($instagramservice->request('https://api.instagram.com/v1/users/'.$instagram_id.'/relationship','post',$linkdata),true); if(!$result){ return ("failed"); } else { return ("success"); } } else { $url = $instagramservice->getauthorizationuri(); return redirect((string)$url); } }
Comments
Post a Comment