title: Use instagram api through curl in php
body: <p>I'm trying to use an instagram api in a php script...</p>
  
  <p>The api url is "<a href="https://graph.instagram.com/" rel="nofollow noreferrer">https://graph.instagram.com/</a><em>&lt;'user-id></em>?<em>&lt;'params+token></em>" and the curl to call is </p>
  
  <p><code>curl -X GET 'https://graph.instagram.com/&lt;user-id&gt;?&lt;params+token&gt;'</code></p>
  
  <p>which work if I call that with the terminal.</p>
  
  <p>I've tried to convert it in php cURL:</p>
  
  <pre><code>$ch = curl_init();
  
      curl_setopt($ch, CURLOPT_URL, 'https://graph.instagram.com/&lt;user-id&gt;?&lt;params+token&gt;');
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
      $result = curl_exec($ch);
  
      curl_close($ch);
  
      echo "!!!!!! " . $result;
  </code></pre>
  
  <p>$result is </p>
  
  <pre><code>{"error":{"message":"Invalid OAuth access token.","type":"OAuthException","code":190,"fbtrace_id":"***********"}}
  </code></pre>
  
  <p>what I'm doing wrong?</p>