Ich versuche, damit die Benutzer auf meiner Website mit ihrem Spotify-Konto anmelden, aberSpotify Oauth, Einsteigen Benutzer-Profile
{ "Fehler": "SERVER_ERROR", "ERROR_DESCRIPTION": "Unerwarteter Status: 415 "}
beim Empfang der JSON-Antwort.
Dies ist der Code Ich verwende:
if (isset($_GET['code']) ) {
echo $_GET['code'];
$scode = $_GET['code'];
$surl2 = "https://accounts.spotify.com/api/token";
$sdata2=array("grant_type"=>"authorization_code","code"=>$scode,"redirect_uri"=>$sredicturl,"client_id"=>$Sclient,"client_secret"=>$Ssecret);
$sch2=curl_init($surl2);
curl_setopt($sch2,CURLOPT_POST,true);
curl_setopt($sch2,CURLOPT_POSTFIELDS,$sdata2);
curl_setopt($sch2,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($sch2,CURLOPT_RETURNTRANSFER,1);
$sjson_response2=curl_exec($sch2);
curl_close($sch2);
echo"<br/>".$sjson_response2;
ich an der Nummer 4 in der Spotify-Dokumentation bin ... https://developer.spotify.com/web-api/authorization-guide/
Dank
Arbeitete wie ein Charme, Prost! –