Documentation for controlling and preserving Bose SoundTouch devices
To fully replace Bose cloud services for the Spotify account addition flow in the “Stockholm” SoundTouch application, the following routes have been implemented in the soundtouch-service:
The Stockholm background worker (in worker_common.js and spotify_worker.js) performs a token exchange using an authorization code.
POST /oauth/account/{account}/music/musicprovider/{sourceID}/token/csHandleBoseAccountToken in pkg/service/handlers/handlers_oauth.go.cmd/soundtouch-service/main.go under the /oauth route group.The SoundTouch application registers a new music source (e.g., Spotify) with the Bose cloud profile.
POST /streaming/account/{account}/sourceHandleMargeAddSource in pkg/service/handlers/handlers_marge.go.cmd/soundtouch-service/main.go under the /streaming route group.application/vnd.bose.streaming-v1.1+xml containing <source> with <username>, <sourceproviderid>, and <credential type="token_version_3">.The soundtouch:// deep link redirect URI is handled by the management interface which provides the OAuth callback.
GET /mgmt/spotify/callbackHandleMgmtSpotifyCallback in pkg/service/handlers/handlers_mgmt.go.POST /mgmt/spotify/confirm (used by mobile apps for deep-link codes).HandleMgmtSpotifyConfirm in pkg/service/handlers/handlers_mgmt.go.HandleMargeAddSource in pkg/service/handlers/handlers_marge.go parses the incoming XML and persists the new source to the DataStore for the corresponding account.HandleBoseAccountToken in pkg/service/handlers/handlers_oauth.go supports the /oauth/account/.../token/cs path.access_token and token_type “Bearer” after exchanging the code via ExchangeCodeAndStore.cmd/soundtouch-service/main.go within the /streaming, /oauth, and /mgmt route blocks.