I’m using the Instagram Basic Display API and since a few days I’m getting the “Unsupported request – method type” error.
My APP is Live, and validated from Meta since several years.
I tried with my production code, and with a RAW cURL API calls with Postman using a valid token, and I get the same error on both.
This is an example of code I’m using getting a Long Lived User Access Token:
$params = [
'endpoint_url' => 'https://graph.instagram.com/access_token',
'type' => 'GET',
'url_params' => [
'grant_type' => 'ig_exchange_token',
'client_secret' => $this->_appSecret,
'access_token' => $this->_userAccessToken
]
];
$ch = curl_init();
$endpoint = $params['endpoint_url'];
if ('POST' == $params['type']) { // post
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params['url_params']));
curl_setopt($ch, CURLOPT_POST, 1);
} elseif ('GET' == $params['type'] && !$params['url_params']['paging']) { // get
$params['url_params']['access_token'] = $this->_userAccessToken;
// add params to endpoint
$endpoint .= '?' . http_build_query($params['url_params']);
}
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$responseArray = json_decode($response, true);
if (isset($responseArray['error_type'])) {
var_dump($responseArray);
die();
} else {
return $responseArray;
}
And this simple call I tryed too:
curl -X GET https://graph.instagram.com/me?fields=id,username&access_token={VALID_TOKEN}
Error:
{
"error": {
"message": "Unsupported request - method type: get",
"type": "IGApiException",
"code": 100,
"fbtrace_id": "A32uEK5vFtH166PBEaDxkAO"
}
}
David is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3