When creating a post, please add:
- Module: Batch Ingestion
- Link to the classroom item you are referring to: https://www.coursera.org/learn/source-systems-data-ingestion-and-pipelines/gradedLti/xp17c/graded-programming-assignment-2-batch-data-processing-from-an-api
- Description: Running the code below to trouble-shoot Exercise 1, I’m getting 404. The endpoint url from spotify doc says “https://api.spotify.com/v1/browse/featured-playlists”
Trouble Shooting Code from JupyterLab Notebook
access_token = token.get('access_token')
print("Access Token:", access_token)
response = requests.get(url="https://api.spotify.com/v1/browse/featured-playlists", headers=get_auth_header(access_token))
Access Token: BQC2dKvq2tv8UnqinEphvSnNId6XTR3PhjUalTgL8E2kgGj-drb4OMy8HFA-_EY2LZ67YKGIcDH_WZnKrKO0SnqgX9ksSZpOIF_HyZVWQ49UQRKHDcs
headers = get_auth_header(token.get('access_token'))
headers
{'Authorization': 'Bearer BQC2dKvq2tv8UnqinEphvSnNId6XTR3PhjUalTgL8E2kgGj-drb4OMy8HFA-_EY2LZ67YKGIcDH_WZnKrKO0SnqgX9ksSZpOIF_HyZVWQ49UQRKHDcs'}
response = requests.get(url = "https://api.spotify.com/v1/browse/featured-playlists", headers = get_auth_header(token.get('access_token')))
response = response.json()
response
{'error': {'status': 404, 'message': 'Not Found'}}