Skip to content

Market.FROM_TOKEN causes HTTP 400 #324

@chuck-stein

Description

@chuck-stein

Describe the bug
When making a request with Market.FROM_TOKEN, the request will fail with SpotifyException.BadRequestException due to an HTTP 400 error.

To Reproduce
Steps to reproduce the behavior:

  1. Call an endpoint that takes in a market parameter, specifying Market.FROM_TOKEN. For example:
spotifyClientApi.browse.getRecommendations(market = Market.FROM_TOKEN, seedTracks = listOf(/* any track IDs */))
  1. SpotifyException.BadRequestException is thrown, with error code 400.

Expected behavior
A successful response from the endpoint, providing content (such as recommended tracks) relevant to the user's current market/country (pulled from their auth token).

Smartphone (please complete the following information):

  • Device: OnePlus 7 Pro
  • OS: Android 11
  • Browser: Native Android app
  • Version: library version 3.8.8

Additional context
The 400 error is happening because the market parameter is resolved by getting the enum name, which is FROM_TOKEN. However, this is not a valid Spotify market -- it should be from_token in all lowercase instead.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions