Working on a site using Wordpress as a headless CMS. We had an instagram feed on the site using the old API, and are switching over the the new Graph API. We are using this plugin in Wordpress, but just using it to generate an access token which we use in our own PHP to make a call to the API and send the response to the front-end.
The call looks like this:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://graph.instagram.com/me/media?fields=id,caption&access_token=" . $access_token);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
The access token is there, and newly created, but we get an error with code 190 back from the API:
{"error":{"message":"Failed to decrypt","type":"OAuthException","code":190,"fbtrace_id":"ASRrRc2KE2ZegUesqjtv9bA"}}
A little googling told me this is usually due to an invalid access token, but again, the token is brand new and should be working.
What am I missing here?