7-Eleven integration

Everything a 7-Eleven app needs to open the TrueVisions NOW mini-app signed in: which token to send, how to open any page with it, and what the viewer sees. Every page requires a signed-in viewer; there is no guest mode.

At a glance

7-Eleven
Partner slug7eleven
Base URLhttps://mini-app.truevisions.co.th/[th|en]/7eleven
Credentialaccess_token (POST form field)
Also acceptedtoken, partner_token
Sign-in pathTrueID AAA: request code → binding page only if AAA asks → token exchange.
How to open a pagePOST to the page URL with the token in the form body.

Step by step

  1. Set up the WebView. JavaScript, DOM storage, inline media playback, autoplay without a gesture and protected media. See Install in your app and DRM in WebViews.
  2. Pick the page the viewer should land on from Pages you can open, in th or en, and add ?embed=1.
  3. Open it with the token. POST to that URL with access_token and the device fields in the form body. Copy-paste code is in Examples.
  4. Let the redirects run. The server asks AAA for a code and exchanges it; the WebView gets a 303back to the same page, signed in. If the viewer has never linked TrueID, AAA's binding page opens first (TrueID login + OTP), then returns to the same page.
  5. Listen to the bridge. ready, auth-state, open-content, close, orientation, subscribe, sign-in. See postMessage bridge.
  6. Re-sign-in when asked. On sign-in (the stream lookup rejected the token), open the message's returnUrl the same way as step 3 with a fresh token. Sessions last about an hour; after that any page asks again.
  7. Test on pre-production with your own test accounts before going live (see Testing).

Pages you can open

All of these accept the token the same way. mOdBP4KN5vd3 is a real series title on pre-production; use any content id from the feeds.

PageURLWhat it shows
Partner home/th/7eleven?embed=1Landing page with the partner's shelves.
Sport/th/7eleven/sport?embed=1All live and upcoming sport, grouped by day.
Series/th/7eleven/series?embed=1All series and movies in the free catalogue.
The Voice 2026/th/7eleven/thevoice?embed=1The Voice shelf page.
Content detail/th/7eleven/content/mOdBP4KN5vd3?embed=1One title: synopsis, episodes, Watch Now.
Player/th/7eleven/play/mOdBP4KN5vd3?embed=1Full-screen player; a series starts at episode 1.
Player, one episode/th/7eleven/play/mOdBP4KN5vd3?ep=<EPISODE_ID>&embed=1Jump to a specific episode.
Live channel/th/7eleven/watch/<CHANNEL_ID>?embed=1Live TV player for one channel.

Examples

Raw requests for the four most common pages. The response is a redirect chain; let the WebView follow it.

All seriesHTTP
POST https://mini-app.truevisions.co.th/th/7eleven/series?embed=1
Content-Type: application/x-www-form-urlencoded

access_token=<SEVEN_ELEVEN_TOKEN>&device_id=<DEVICE_ID>&session_id=<SESSION_ID>&platform=ANDROID&version=<APP_VERSION>
Sport scheduleHTTP
POST https://mini-app.truevisions.co.th/th/7eleven/sport?embed=1
Content-Type: application/x-www-form-urlencoded

access_token=<SEVEN_ELEVEN_TOKEN>&device_id=<DEVICE_ID>&session_id=<SESSION_ID>&platform=ANDROID&version=<APP_VERSION>
Content detail pageHTTP
POST https://mini-app.truevisions.co.th/th/7eleven/content/mOdBP4KN5vd3?embed=1
Content-Type: application/x-www-form-urlencoded

access_token=<SEVEN_ELEVEN_TOKEN>&device_id=<DEVICE_ID>&session_id=<SESSION_ID>&platform=ANDROID&version=<APP_VERSION>
Straight into the playerHTTP
POST https://mini-app.truevisions.co.th/th/7eleven/play/mOdBP4KN5vd3?embed=1
Content-Type: application/x-www-form-urlencoded

access_token=<SEVEN_ELEVEN_TOKEN>&device_id=<DEVICE_ID>&session_id=<SESSION_ID>&platform=ANDROID&version=<APP_VERSION>
Android (Kotlin)Kotlin
// Opens any mini-app page signed in: POST the token to the page itself.
fun openMiniApp(webView: WebView, path: String, token: String) {
    fun enc(s: String) = URLEncoder.encode(s, "UTF-8")
    val body =
        "access_token=" + enc(token) + "&" +
        "device_id=" + enc(deviceId) + "&" +
        "session_id=" + enc(sessionId) + "&" +
        "platform=" + enc("ANDROID") + "&" +
        "version=" + enc(appVersion)
    webView.postUrl("https://mini-app.truevisions.co.th/th/7eleven" + path, body.toByteArray())
}

openMiniApp(webView, "/sport?embed=1", token)
openMiniApp(webView, "/series?embed=1", token)
openMiniApp(webView, "/content/mOdBP4KN5vd3?embed=1", token)
openMiniApp(webView, "/play/mOdBP4KN5vd3?embed=1", token)
iOS (Swift)Swift
// Opens any mini-app page signed in: POST the token to the page itself.
func openMiniApp(_ webView: WKWebView, path: String, token: String) {
    var request = URLRequest(url: URL(string: "https://mini-app.truevisions.co.th/th/7eleven" + path)!)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    var form = URLComponents()
    form.queryItems = [
        .init(name: "access_token", value: token),
        .init(name: "device_id", value: deviceId),
        .init(name: "session_id", value: sessionId),
        .init(name: "platform", value: "iOS"),
        .init(name: "version", value: appVersion),
    ]
    request.httpBody = form.percentEncodedQuery?.data(using: .utf8)
    webView.load(request)
}

openMiniApp(webView, path: "/sport?embed=1", token: token)
openMiniApp(webView, path: "/series?embed=1", token: token)
openMiniApp(webView, path: "/content/mOdBP4KN5vd3?embed=1", token: token)
openMiniApp(webView, path: "/play/mOdBP4KN5vd3?embed=1", token: token)
Web (iframe): an iframe can't send headers, so POST a form into itHTML
<iframe name="tvs" allow="autoplay; fullscreen; encrypted-media" style="width:100%;height:100%;border:0"></iframe>

<form id="tvs-open" method="post" target="tvs" action="https://mini-app.truevisions.co.th/th/7eleven/series?embed=1">
  <input type="hidden" name="access_token" value="<SEVEN_ELEVEN_TOKEN>">
  <input type="hidden" name="platform" value="WEB">
</form>
<script>document.getElementById("tvs-open").submit()</script>

<!-- Other pages: change the form action, e.g.
     https://mini-app.truevisions.co.th/th/7eleven/sport?embed=1
     https://mini-app.truevisions.co.th/th/7eleven/content/mOdBP4KN5vd3?embed=1 -->
FieldExampleMeaning
device_id<DEVICE_ID>Stable device id you already report to TrueID.
session_id<SESSION_ID>Your app session id (a UUID is generated when omitted).
platformANDROIDANDROID or iOS. Picks the AAA client id.
version<APP_VERSION>Your app version, e.g. 9.12.0.

If a page is opened without a token

The page sends the viewer to the TrueID login page (identity.trueid.net) and brings them back to the same page once they log in. That works, but it makes the viewer log in again inside your app, so always open pages with the token.

When sign-in fails

The WebView lands on /th/7eleven/auth/error?code=…, a localised page with a Back to home button.

CodeMeaningWhat to do
missing_credentialsNo token found in the request.Check the form field name: access_token.
aaa_10032AAA says the partner token is expired or invalid.Refresh your token and open the page again.
aaa_14229The account has no mobile number and cannot be linked.Show your own guidance; retrying won't help.
request_codeAAA could not be reached or refused the request.Retry; contact us if it persists.
exchangeThe code could not be exchanged for a token.Open the page again.
invalid_stateThe sign-in link expired (10 minutes) or was tampered with.Open the page again.

Testing

  • Pre-production base URL: https://mini-app.truevisions.co.th. It talks to TrueID pre-production (identity.trueid-preprod.net).
  • Pre-production TrueID accounts can be real accounts: purchases may charge real money. Use the test accounts from onboarding.
  • In the WebView's network log the first request is your page URL with the token, then a 303 back to the same URL with #at=…, which the page removes from the address bar at once.