0
votes

I'am programming with the Spotify Search API. To show the results on my webpage I use PHP and the API in JSON format.

My question is: How can I give Spotify OAuth Token in PHP? How can I make this in the URL? For Example:

https://api.spotify.com/v1/search?query=Song&type=track&offset=0&limit=50&token=[MY TOKEN]

Thanks a lot for all answers.

1

1 Answers

0
votes

No. You cannot. You have to send the key with POST. You are talking about a GET request. You can do that with cURL. Read this.

$headers = ['Accept: application/json', 'Content-Type: application/json', 'Authorization: Bearer '.$access['access_token'].'']; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);