Integrating Deposit Pages


The tutorial below guides you through the process of integrating a deposit page into an Android app (with Java code samples).


You already have a logged-in William Hill customer within an application, and therefore a login ticket (what we refer to as a TGT)


  1. Obtaining a Service Ticket - to do that, call the getServiceTicket() method from the Sessions API.(the credentials in the example below are obfuscated)
    httpcon = (HttpURLConnection) ((new URL(API_LOGIN_URL + "/" + sessionTicket + "/serviceTicket?target=" + TARGET).openConnection()));
    httpcon.setRequestProperty("Content-Type", "application/json");
    httpcon.setRequestProperty("Accept", "application/json");
    httpcon.setRequestProperty("apiKey", "l7xx1ce849xxxxxxxxxxxxxx");
    httpcon.setRequestProperty("apiSecret", "dca6e5xxxxxxxxxxxxxxxxxx");

    The target URL is the service you wish to use, in this case, deposits for mobile. The URL is:

    In the response from the call, you will get a Service Ticket.

         "ticket" : "ST-2xx0567-sxxxxxxx-gibxxx"


  2. Opening the web view via a CAS re-direct - to do that, add your ticket and service to the following URL:


    webView.setWebViewClient(new WebViewClient());
    webView.loadUrl("" + response + "&target=" + TARGET + "&cust_login=true");

    Your webview should look like the screenshow shown below:


  3. Closing the web view - in our scenario, once the deposit is completed, the website will attempt to redirect the user to:

     You can intercept this navigation event, and close the window and re-direct the customer back to your normal app view.