Our development team has encountered an authentication barrier when attempting to integrate with the Amazon Music API. Despite having a valid Security Profile ID and following the documented OAuth flow, we’re receiving 401 Unauthorized errors when making requests to the /v1/me
endpoint.
Technical Details
-
Endpoint:
https://api.music.amazon.dev/v1/me
-
Error Code: 401 (Unauthorized)
-
Security Profile ID:
amzn1.application.19571cc1198346a2b597383eb70125e3
-
Application name: Fanbee
-
Authentication Method: Bearer token via Login with Amazon (LWA)
Error Response
json
Could not fetch Amazon user details; error={"message":"Request failed with status code 401","name":"AxiosError","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Authorization":"Bearer xxxxx","x-api-key":"amzn1.application.19571cc1198346a2b597383eb70125e3","Content-Type":"application/json","User-Agent":"axios/0.27.2","x-datadog-trace-id":"8048322002310700321","x-datadog-parent-id":"236766196493680524","x-datadog-sampling-priority":"1","x-datadog-tags":"_dd.p.dm=-0","traceparent":"00-00000000000000006fb1623821b09d21-03492999ecd37f8c-01","tracestate":"dd=t.dm:-0;s:1"},"method":"get","url":"https://api.music.amazon.dev/v1/me"},"code":"ERR_BAD_REQUEST","status":401}
Usecase
We want to access a user’s playlist for a release/track pre-save feature.