accountLink overview

    accountLink overview


    Article summary

    accountLink is a set of required methods that support OTT account linking, entitlement linking, and media history messaging. If metadata integration is planned for your SVOD app, you must implement these set of calls to ensure users have the best experience with search and discovery.

    If you plan to integrate the Continue Watching feature for your app, the following set of calls are required:

    All of these events happen within the context of an authenticated, provisioned X1 Device, therefore these methods do not need to provide such details as the user or device ID (the X1 JavaScript API framework will flesh out these messages with those details along with a relevant X1 App identifier, timestamp, and correlation ID for tracing events through the system).

    Some X1 Apps only require a single entitlement – all content in a locality is bound to a subscription, regardless of subscription level. Other X1 Apps may need to explicitly provide a list of entitlements if they sell content in multiple packages. For single entitlement apps, the accountLink message tracking signIn, appLaunch, and signOut is all that is required. For X1 Apps that can map multiple entitlements to a subscriber, these methods are designed to be flexible for the OTT app developers to integrate with – the OTT app can include entitlement IDs with the appLaunch and signIn messages or provide them separately through the entitlementsUpdate calls.

    This message is sent based on the user taking the actions of: signing into the X1 App, launching the X1 App, and signing out of the X1 App.

    Example Account Link Call Sequences

    The following code section describes the API calls that would be sent during a sequence of user interactions with an X1 App.

      // User signs in successfully
    	$badger.accountLink().signIn([ { "id": "Prime" }, {"id": "britbox" }, { "id": "Sundance Now" } ]);
    	// User begins watching a movie
    	$badger.accountLink().mediaEvent({ contentId: "12345678", completed: false, progess: 0, progressUnits: "percent" });
    	// User finishes watching the same movie
    	$badger.accountLink().mediaEvent({ contentId: "12345678", completed: true, progess: 95, progressUnits: "percent" });
    	// User exits the X1 App and returns to X1
    	// No messages are sent
    

    	// User opens the X1 App and is automatically signed in
    	$badger.accountLink().appLaunch([ { "id": "Prime" }, { "id": "britbox" }, { "id": "Sundance Now" } ]);
    	// User subscribes to Screambox channel within the X1 App
    	$badger.accountLink().update([ { "id": "Prime" }, { "id": "britbox" }, { "id": "Sundance Now" }, { "id": "screambox" } ]);
    	// User resumes a movie they started watching from another device
    	$badger.accountLink().mediaEvent({ contentId: "11345678", completed: true, progess: 50, progressUnits: "percent" });
    	// User exits the X1 App and returns to X1
    	// No messages are sent
    

    	// User opens the app and is automatically signed in
    	$badger.accountLink().appLaunch([ { "id": "Prime" }, { "id": "britbox" }, { "id": "Sundance Now" } ]);
    	// User signs out of their account
    	$badger.accountLink().signOut();
    


    Was this article helpful?