Sessions API
whapi · Media
The William Hill Sessions API uses a central authentication service (CAS*) on all resources that require access to a customer’s account or betting functionality. To authenticate, you’ll need to supply a sportsbook username and password, in return you will be given an authentication ticket, which you can use on the majority of requests found within our services. The Sessions API should be used whenever you want to login a customer and: continue to use the W
Authentication
Sample Requests
Obtains a one-time Service Ticket that can be used to access other CAS enabled William Hill services that are not available through the standard suite of APIs. You first need to have logged in a customer to obtain an Authentication Ticket.
Hover any highlighted part to learn what it does
| apiKey | example |
| apiSecret | example |
curl -X GET "https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}/serviceTicket?fields=example&target=example&exclude=example&include=example&languageAsPerTerritory=true" \
-H "apiKey: example" \
-H "apiSecret: example"import requests
params = {
"fields": "example",
"target": "example",
"exclude": "example",
"include": "example",
"languageAsPerTerritory": "true"
}
headers = {
"apiKey": "example",
"apiSecret": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}/serviceTicket",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}/serviceTicket');
url.searchParams.set('fields', 'example');
url.searchParams.set('target', 'example');
url.searchParams.set('exclude', 'example');
url.searchParams.set('include', 'example');
url.searchParams.set('languageAsPerTerritory', 'true');
const response = await fetch(url, {
headers: {
'apiKey': 'example',
'apiSecret': 'example'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}/serviceTicket")
q := baseURL.Query()
q.Set("fields", "example")
q.Set("target", "example")
q.Set("exclude", "example")
q.Set("include", "example")
q.Set("languageAsPerTerritory", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("apiKey", "example")
req.Header.Set("apiSecret", "example")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}/serviceTicket")
uri.query = URI.encode_www_form({
"fields" => "example",
"target" => "example",
"exclude" => "example",
"include" => "example",
"languageAsPerTerritory" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["apiKey"] = "example"
req["apiSecret"] = "example"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}/serviceTicket?" . http_build_query([
"fields" => "example",
"target" => "example",
"exclude" => "example",
"include" => "example",
"languageAsPerTerritory" => "true"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"apiKey: example",
"apiSecret: example"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Checks the validity of a session ticket.
Hover any highlighted part to learn what it does
| apiKey | example |
| apiSecret | example |
curl -X GET "https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}?languageAsPerTerritory=true" \
-H "apiKey: example" \
-H "apiSecret: example"import requests
params = {
"languageAsPerTerritory": "true"
}
headers = {
"apiKey": "example",
"apiSecret": "example"
}
response = requests.get(
"https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}');
url.searchParams.set('languageAsPerTerritory', 'true');
const response = await fetch(url, {
headers: {
'apiKey': 'example',
'apiSecret': 'example'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}")
q := baseURL.Query()
q.Set("languageAsPerTerritory", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("apiKey", "example")
req.Header.Set("apiSecret", "example")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}")
uri.query = URI.encode_www_form({
"languageAsPerTerritory" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["apiKey"] = "example"
req["apiSecret"] = "example"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets/{tgt}?" . http_build_query([
"languageAsPerTerritory" => "true"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"apiKey: example",
"apiSecret: example"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Logs in a customer by obtaining an authentication ticket. It can then be used directly with the other William Hill APIs to access a customer’s sportsbook account, place a bet, etc.
Hover any highlighted part to learn what it does
| apiKey | example |
| apiSecret | example |
curl -X POST "https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets?fields=example&exclude=example&include=example&languageAsPerTerritory=true" \ -H "apiKey: example" \ -H "apiSecret: example"
import requests
params = {
"fields": "example",
"exclude": "example",
"include": "example",
"languageAsPerTerritory": "true"
}
headers = {
"apiKey": "example",
"apiSecret": "example"
}
response = requests.post(
"https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets');
url.searchParams.set('fields', 'example');
url.searchParams.set('exclude', 'example');
url.searchParams.set('include', 'example');
url.searchParams.set('languageAsPerTerritory', 'true');
const response = await fetch(url, {
method: 'POST',
headers: {
'apiKey': 'example',
'apiSecret': 'example'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets")
q := baseURL.Query()
q.Set("fields", "example")
q.Set("exclude", "example")
q.Set("include", "example")
q.Set("languageAsPerTerritory", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("POST", targetURL, nil)
req.Header.Set("apiKey", "example")
req.Header.Set("apiSecret", "example")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets")
uri.query = URI.encode_www_form({
"fields" => "example",
"exclude" => "example",
"include" => "example",
"languageAsPerTerritory" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
req["apiKey"] = "example"
req["apiSecret"] = "example"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/whapi.com/sessions/2.0.0/tickets?" . http_build_query([
"fields" => "example",
"exclude" => "example",
"include" => "example",
"languageAsPerTerritory" => "true"
]);
$opts = ["http" => [
"method" => "POST",
"header" => implode("\r\n", [
"apiKey: example",
"apiSecret: example"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with Sessions API?
Sessions API is a Media API. Developers commonly use media APIs for:
- storing and delivering images, video, and audio
- building digital asset management and media libraries
- transcoding and optimising media for the web
- adding video streaming and playback to your app
- automating content tagging and metadata extraction
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. Sessions API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?