为什么我要在instagram api中遇到这个错误

为什么我要在instagram api中遇到这个错误,api,instagram-api,Api,Instagram Api,数组([error\u type]=>OAuthException[code]=>400[error\u message]=>验证验证代码时出错。请确保重定向\u uri与OAuth对话框请求中使用的uri相同) $code = $_GET['code']; }else{ exit('code not set'); } $field = [ 'client_id'=> '********', 'client_secret'=>'*******

数组([error\u type]=>OAuthException[code]=>400[error\u message]=>验证验证代码时出错。请确保重定向\u uri与OAuth对话框请求中使用的uri相同)

        $code = $_GET['code'];
}else{
    exit('code not set');
}

$field = [
    'client_id'=> '********',
    'client_secret'=>'***************',
    'grant_type'=>'authorization_code',
    'redirect_uri'=>'mydomain.com/test.php',
    'code'=>$code,
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://api.instagram.com/oauth/access_token');
curl_setopt($ch, CURLOPT_POST,true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$field);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result,true);

print_r($result);