### GET /bmx/tunein/v1/playback/station/_station_
GET {{host}}/bmx/tunein/v1/playback/station/_station_
Accept: */*
Accept-Language: en
X-Bmx-Api-Key: bmx-api-key-dummy
X-Bmx-Device-Id: bmx-device-id-dummy
User-Agent: Bose_Lisa/27.0.6

> {%
    client.test("Response is 401 Unauthorized", function() {
        client.assert(response.status === 401, "Response status is not 401");
    });

    client.test("Response body contains 'Unauthorized'", function() {
        client.assert(response.body.includes("401 Unauthorized"), "Response body does not contain '401 Unauthorized'");
        client.assert(response.body.includes("No access token found."), "Response body does not contain 'No access token found.'");
    });
%}

### POST /bmx/tunein/v1/token
POST {{host}}/bmx/tunein/v1/token
User-Agent: Bose_Lisa/27.0.6
Accept: */*
Accept-Language: en
X-Bmx-Api-Key: bmx-api-key-dummy
X-Bmx-Device-Id: bmx-device-id-dummy
Content-Type: application/json

{"grant_type":"refresh_token","refresh_token":"eyJzZXJpYWwiOiAiY2NiZTkzNDMtYjY0MS00MjMxLWFhYTAtOTI3NTBmNjhjMjY3In0="}

> {%
    client.test("Response is 200 OK", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });

    client.test("Response contains access_token and refresh_token", function() {
        client.assert(response.body.hasOwnProperty("access_token"), "Response missing 'access_token'");
        client.assert(response.body.hasOwnProperty("refresh_token"), "Response missing 'refresh_token'");
    });

    client.global.set("bmx_access_token", response.body.access_token);
%}

### GET /bmx/tunein/v1/playback/station/_station_ (Authorized)
GET {{host}}/bmx/tunein/v1/playback/station/_station_
User-Agent: Bose_Lisa/27.0.6
Accept: */*
Accept-Language: en
Authorization: {{bmx_access_token}}
X-Bmx-Api-Key: bmx-api-key-dummy
X-Bmx-Device-Id: bmx-device-id-dummy

> {%
    client.test("Response is 200 OK", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });

    client.test("Response contains audio information", function() {
        client.assert(response.body.hasOwnProperty("audio"), "Response missing 'audio'");
        client.assert(response.body.audio.hasOwnProperty("streamUrl"), "Response missing 'streamUrl'");
    });
%}
