Guest User

Untitled

a guest
Jan 19th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. https://api.instagram.com/v1/users/self/media/recent?access_token={access-token}
  2.  
  3. https://api.instagram.com/v1/users/{user-id}/media/recent?access_token={access-token}
  4.  
  5. use MetzWebInstagramInstagram;
  6.  
  7. $instagram = new Instagram(array(
  8. 'apiKey' => 'YOUR_APP_KEY',
  9. 'apiSecret' => 'YOUR_APP_SECRET',
  10. 'apiCallback' => 'YOUR_APP_CALLBACK'
  11. ));
  12.  
  13. // grab OAuth callback code
  14. $code = $_GET['code'];
  15. // or maybe $code = $request->code; // if you are using Laravel
  16. $data = $instagram->getOAuthToken($code);
  17.  
  18. // set user access token
  19. $instagram->setAccessToken($data);
  20.  
  21. // and
  22. $pictures = $instagram->getUserMedia();
Add Comment
Please, Sign In to add comment