### Authentication Token Example
Source: https://docs.imgarena.com/volleyball/overview/getting-started
Example JSON payload containing an authentication token required for connecting to WebSocket endpoints. This token is obtained from the support team and should be used immediately upon connection.
```json
{
"authToken": "eYCMopB1T9ACqA8TVIoM"
}
```
--------------------------------
### Basic imgarena-llms Integration Example
Source: https://docs.imgarena.com/ufc-5.0/ufc-5.0-russian/master
An example demonstrating the integration of imgarena-llms, likely involving HTML and JavaScript for setup and configuration.
```html
imgarena-llms Example
```
--------------------------------
### Authentication Token Example
Source: https://docs.imgarena.com/table-tennis/new-table-tennis-multisport/overview/getting-started
Demonstrates the JSON payload containing an authentication token. This token is essential for establishing secure connections to WebSocket endpoints and should be kept secret.
```json
{
"authToken": "eYCMopB1T9ACqA8TVIoM"
}
```
--------------------------------
### Authentication Token Request
Source: https://docs.imgarena.com/snooker/overview/getting-started
Example JSON payload demonstrating the structure for requesting an authentication token required for WebSocket API connections. This token is obtained from support@openbet.com.
```json
{
"authToken": "eYCMopB1T9ACqA8TVIoM"
}
```
--------------------------------
### Authentication Token Request Example
Source: https://docs.imgarena.com/basketball/overview/getting-started
Provides an example JSON payload representing an authentication token. This token is required to establish connections to WebSockets endpoints and should be requested from support@imgarena.com.
```json
{
"authToken": "eYCMopB1T9ACqA8TVIoM"
}
```
--------------------------------
### Install @img-arena/streaming-sdk using npm
Source: https://docs.imgarena.com/streambet-sdk-integration/getting-started
Installs the @img-arena/streaming-sdk package using npm. This is the first step to integrate the Interactive Streaming product into your project.
```json
npm install @img-arena/streaming-sdk
```
--------------------------------
### Install @img-arena/streaming-sdk using yarn
Source: https://docs.imgarena.com/streambet-sdk-integration/getting-started
Installs the @img-arena/streaming-sdk package using yarn. This is the first step to integrate the Interactive Streaming product into your project.
```bash
yarn add @img-arena/streaming-sdk
```
--------------------------------
### Initialize Imgarena Feed Connection
Source: https://docs.imgarena.com/mustard-systems-odds-distribution-service/getting-setup
Sends an initialization command to the Imgarena feed after establishing an SSH connection. This is a JSON payload used to signal the start of communication.
```json
{
"request": "init",
"msg": {}
}
```
--------------------------------
### Basic API Call Example
Source: https://docs.imgarena.com/basketball/rest-api-1/overview/using-the-rest-api
Demonstrates making a GET request to retrieve basketball seasons using curl, including authorization and content type headers.
```bash
curl https://dde-api.data.imgarena.com/basketball/seasons \
-X GET \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json'
```
--------------------------------
### IMG Arena Live Event Data Structure
Source: https://docs.imgarena.com/tennis/documentation-1/connecting-programmatically
Example JSON structure for a live event as returned by the `/tournaments/liveevents` endpoint. This data includes start time status, team information (players, entry type, seed), event ID, and tournament name.
```APIDOC
Live Event Data Example:
{
"startTime": {
"status": "FollowsPrevious"
},
"teamA": {
"status": "KnownTennisTeam",
"team": {
"player1": {
"id": "MN13",
"firstName": "Maximilian",
"lastName": "Marterer",
"country": "GER"
},
"entryType": "Standard",
"seed": 8
}
},
"eventId": "2025-9900-MS028",
"teamB": {
"status": "KnownTennisTeam",
"team": {
"player1": {
"id": "F0BT",
"firstName": "Jonas",
"lastName": "Forejtek",
"country": "CZE"
},
"entryType": "Standard"
}
},
"tournamentName": "United Cup"
}
```
--------------------------------
### Sample Hole Started Event Packet
Source: https://docs.imgarena.com/golf-media/round-details-and-match-details-scenarios/hole-started-finished
An example JSON payload representing a 'Hole Started' event, illustrating the data format and typical values for each field.
```JSON
{
"courseId": "392",
"eventElementType": "RoundStatusUpdate",
"groupId": 1211220,
"groupNo": 17,
"holeNo": 10,
"holeOrder": 1,
"roundNo": 1,
"seqNum": 2,
"state": "HoleStarted",
"teamNo": 10,
"timestamp": "2025-02-20T05:17:36.000Z",
"timestampReceived": "2025-02-20T05:17:36.776Z"
}
```
--------------------------------
### Get Volleyball Seasons
Source: https://docs.imgarena.com/volleyball/overview/using-the-rest-api
Example cURL command to fetch a list of volleyball seasons using a GET request to the production API.
```bash
curl https://dde-api.data.imgarena.com/v2/volleyball/seasons \
-X GET \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/json'
```
--------------------------------
### Widget Initialization Example URL
Source: https://docs.imgarena.com/ufc-betbuilder/introduction/ui-workflow
An example URL demonstrating how to initialize the BetBuilder Widget with various parameters.
```url
https://betbuildergbgen2-uat.sportcastlive.com/?key=xxx&fixtureid=107675&brand=xxx®ion=xxx
```
--------------------------------
### Full Integration Example
Source: https://docs.imgarena.com/ufc-5.0/master
Demonstrates the complete setup for integrating the IMG Arena UFC Event Centre into an HTML page. Includes script inclusion, DOM element targeting, and event centre initialization with event listeners for context updates and handshake failures.
```html
IMG Arena Event Centre
```
--------------------------------
### API: Subscription Tag Examples
Source: https://docs.imgarena.com/mustard-systems-odds-distribution-service/faq
Illustrates how to subscribe to market data using tags, demonstrating the additive nature of subscriptions for sports, competitions, events, and market types.
```APIDOC
Subscription Tags:
Examples:
- Subscribe to all golf markets:
["sp.golf"]
- Subscribe to all PGA Tour golf markets:
["comp.golf_pga"]
- Subscribe to all markets from a specific event (e.g., ev.golf_14586):
["ev.golf_14586"]
- Subscribe to markets from a specific event AND all markets of a specific type (e.g., twoball):
["ev.golf_14586", "mt.twoball"]
```
--------------------------------
### Example Shot Data Structure
Source: https://docs.imgarena.com/basketball/live-websockets/betting-live-statistics
An example JSON structure illustrating the format for shot data, including start and end timestamps, and duration for individual shots within a sequence.
```JSON
{
"shotEnd": "2023-02-27T11:33:00.711433Z",
"duration": "00:00:00.9315630",
"shotStart": "2023-02-27T11:33:00.711433Z"
},
{
"shotEnd": "2023-02-27T11:33:02.610775Z",
"duration": "00:00:00.9315630",
"shotStart": "2023-02-27T11:33:01.679212Z"
},
{
"shotEnd": "2023-02-27T11:33:03.74131Z",
"duration": "00:00:01.1305350",
"shotStart": "2023-02-27T11:33:02.610775Z"
},
{
"shotEnd": "2023-02-27T11:33:04.949401Z",
"duration": "00:00:01.2080910",
"shotStart": "2023-02-27T11:33:03.74131Z"
}
```
--------------------------------
### Install SSL Certificate using Java
Source: https://docs.imgarena.com/tennis/stream-endpoints-websockets/connecting-to-the-stream-endpoints
This Java program, `InstallCert.java`, allows users to install SSL certificates from a remote server into the Java KeyStore. It connects to a given hostname and port, retrieves the server's X.509 certificate chain, and provides instructions or mechanisms to add trusted certificates. It requires a Java Runtime Environment and takes the hostname and an optional port and passphrase as command-line arguments.
```java
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. *
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. *
* - Neither the name of Sun Microsystems nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, *
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* http://blogs.sun.com/andreas/resource/InstallCert.java
* Use:
* java InstallCert hostname
* Example:
*% java InstallCert ecc.fedora.redhat.com
*/
import javax.net.ssl.*;
import java.io.*;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
* Class used to add the server's certificate to the KeyStore
* with your trusted certificates.
*/
public class InstallCert {
public static void main(String[] args) throws Exception {
String host;
int port;
char[] passphrase;
if ((args.length == 1) || (args.length == 2)) {
String[] c = args[0].split(":");
host = c[0];
port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
String p = (args.length == 1) ? "changeit" : args[1];
passphrase = p.toCharArray();
} else {
System.out.println("Usage: java InstallCert [:port] [passphrase]");
return;
}
File file = new File("jssecacerts");
if (file.isFile() == false) {
char SEP = File.separatorChar;
File dir = new File(System.getProperty("java.home") + SEP
+ "lib" + SEP + "security");
file = new File(dir, "jssecacerts");
if (file.isFile() == false) {
file = new File(dir, "cacerts");
}
}
System.out.println("Loading KeyStore " + file + "...");
InputStream in = new FileInputStream(file);
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(in, passphrase);
in.close();
SSLContext context = SSLContext.getInstance("TLS");
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ks);
X509TrustManager defaultTrustManager =
(X509TrustManager) tmf.getTrustManagers()[0];
SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
context.init(null, new TrustManager[]{tm}, null);
SSLSocketFactory factory = context.getSocketFactory();
System.out.println("Opening connection to " + host + ":" + port + "...");
SSLSocket socket = (SSLSocket) factory.createSocket(host, port);
socket.setSoTimeout(10000);
try {
System.out.println("Starting SSL handshake...");
socket.startHandshake();
socket.close();
System.out.println();
System.out.println("No errors, certificate is already trusted");
} catch (SSLException e) {
System.out.println();
e.printStackTrace(System.out);
}
X509Certificate[] chain = tm.chain;
if (chain == null) {
System.out.println("Could not obtain server certificate chain");
return; }
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println();
System.out.println("Server sent " + chain.length + " certificate(s):");
System.out.println();
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
MessageDigest md5 = MessageDigest.getInstance("MD5");
for (int i = 0; i < chain.length; i++) {
X509Certificate cert = chain[i];
System.out.println
(" " + (i + 1) + " Subject " + cert.getSubjectDN());
System.out.println
(" Issuer " + cert.getIssuerDN());
sha1.update(cert.getEncoded());
System.out.println(" sha1: " + bytesToHex(sha1.digest()));
md5.update(cert.getEncoded());
System.out.println(" md5: " + bytesToHex(md5.digest()));
System.out.println();
}
System.out.print("Enter certificate to add to trusted keystore [1]:");
String alias = reader.readLine().trim();
if (alias == null || alias.isEmpty()) {
alias = "1";
}
ks.setCertificateEntry(alias, chain[Integer.parseInt(alias) - 1]);
OutputStream out = new FileOutputStream(file);
ks.store(out, passphrase);
out.close();
System.out.println(cert);
System.out.println("added to trusted keystore\n");
}
private static String bytesToHex(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 2);
for(byte b : bytes) {
sb.append(String.format("%02x", b));
}
return sb.toString();
}
private static class SavingTrustManager implements X509TrustManager {
private final X509TrustManager tm;
private X509Certificate[] chain;
SavingTrustManager(X509TrustManager tm) {
this.tm = tm;
}
public X509Certificate[] getChain() {
return chain;
}
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
this.chain = chain;
tm.checkClientTrusted(chain, authType);
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
this.chain = chain;
tm.checkServerTrusted(chain, authType);
}
public X509Certificate[] getAcceptedIssuers() {
return tm.getAcceptedIssuers();
}
}
}
```
--------------------------------
### Initial Connection Request
Source: https://docs.imgarena.com/mustard-systems-odds-distribution-service/faq
Example of an initial request sent after connecting to the API to initialize market subscriptions. This request specifies the tags to subscribe to.
```JSON
{
"request": "init",
"msg": {
"tags": [
"sp.golf",
"comp.golf_europga",
"ev.golf_14759",
"mt.threeball_hole"
]
}
}
```
--------------------------------
### Not Started Match Status JSON Example
Source: https://docs.imgarena.com/tennis/stream-endpoints-websockets/events-id-stream-tennis
An example JSON payload representing the initial state of a tennis match before it begins. This includes placeholder data for umpire, teams, and match status.
```json
{
"timestamp": "1970-01-01T00:00:00.000Z",
"eventElementType": "MatchStatusUpdate",
"matchTime": "00:00:00",
"seqNum": 0,
"matchStatus": {
"umpireCountry": "Unknown",
"umpire": "Unknown",
"teamAPlayer1": "Unknown",
"tossChooser": "Unknown",
"matchState": {
"state": "NotStarted"
},
"teamBPlayer1": "Unknown",
"numSets": -1,
"scoringType": "UnknownScoringType",
"firstServer": "UnknownTeam",
"tossWinner": "UnknownTeam",
"courtNum": -1,
"teamAPlayersDetails": {
"player1Id": "Unknown",
"player1Country": "Unknown"
},
"teamBPlayersDetails": {
"player1Id": "Unknown",
"player1Country": "Unknown"
},
"umpireCode": "Unknown",
"tieBreakType": "Unknown"
}
}
```
--------------------------------
### Full Event Centre Integration Example
Source: https://docs.imgarena.com/golf-event-centre-integration-documentation/master
Demonstrates the complete process of integrating an IMG Arena Event Centre. This includes defining a target HTML element, loading the UMD build of the integration library via a script tag, and initializing the event centre with specific operator and event details. It also shows how to subscribe to message topics like SELECTION_UPDATE and emit context updates.
```html
```
--------------------------------
### Round Object Example
Source: https://docs.imgarena.com/snooker/objects/static-objects/stage/round
An example JSON object representing the details of a round within an event stage. It includes a unique identifier, the round's name, and its start and end dates in UTC.
```json
{
"id": "bc4a56f7-d719-4438-9d5b-e76fbc14342c",
"name": "Stage One/week 1",
"startDateUTC": "2023-06-26T12:00:00",
"endDateUTC": "2023-06-26T12:00:00"
}
```
--------------------------------
### CodeSandbox Streaming Integration Example
Source: https://docs.imgarena.com/golf-event-centre-integration-documentation/faq
A practical example demonstrating streaming integration within a CodeSandbox environment, showcasing how to use generated tokens and integrate with the IMG Arena platform.
```javascript
// This is a conceptual representation of code found in a CodeSandbox example.
// The actual implementation would involve specific libraries and API calls.
// Assume you have obtained authToken and timestamp from token generation:
// const { authToken, timestamp } = await generateStreamingToken(operatorId, alcToken);
// Example of initializing the integration library with streaming capabilities:
// import { IntegrationLibrary } from '@imgarena/integration-sdk'; // Hypothetical SDK
// const integrationLib = new IntegrationLibrary({
// operatorId: 'YOUR_OPERATOR_ID',
// // Other configuration...
// });
// // Function to start streaming for a specific event/hole
// async function startStreaming(eventId, holeId, authToken, timestamp) {
// try {
// const streamConfig = {
// eventId: eventId,
// holeId: holeId,
// auth: {
// token: authToken,
// timestamp: timestamp
// }
// };
// await integrationLib.startStreaming(streamConfig);
// console.log(`Streaming started for event ${eventId}, hole ${holeId}`);
// } catch (error) {
// console.error('Failed to start streaming:', error);
// }
// }
// // Example usage:
// // startStreaming('tournament-id-123', 'hole-1', 'simulated_auth_token_12345', 1678886400000);
// Link to example: https://codesandbox.io/s/group-detail-view-only-forked-rfq0li
```
--------------------------------
### Market Subscription Tag Examples
Source: https://docs.imgarena.com/imga-dl-trading-odds-distribution-service/faq
Illustrates various ways to construct tag arrays for market subscriptions. Subscribing to a single tag or a combination of tags determines the data received, following an additive logic.
```JSON
["sp.golf"]
```
```JSON
["comp.golf_pga"]
```
```JSON
["ev.golf_14586"]
```
```JSON
["ev.golf_14586", "mt.twoball"]
```
--------------------------------
### Start Time Object Example (JSON)
Source: https://docs.imgarena.com/golf-event-centre-integration-documentation/static-data/schedule-endpoint
This JSON snippet illustrates the structure for representing a start time within an event, including its status and the scheduled time. It is a component used in broader event data structures.
```json
{
"status": "StartsAt",
"time": "17:06Z"
}
```
--------------------------------
### Example cURL Command with Query Parameters
Source: https://docs.imgarena.com/snooker/overview/using-the-rest-api
Illustrates making an API call with query parameters to filter results. This example fetches completed and official fixtures, including authorization and accept headers.
```bash
curl 'https://dde-api.data.imgarena.com/snooker/fixtures?status=Completed&type=Official' \
-X GET \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Accept: application/json'
```
--------------------------------
### Imgarena Event Title Examples
Source: https://docs.imgarena.com/streaming-integration/faqs/event-mapping
Examples of event titles as they appear in API responses, illustrating different conventions for participant naming based on sport. This helps in understanding how team names are formatted for mapping.
```APIDOC
[Q] Filip Horansky (SVK) vs [3] Corentin Moutet (FRA)Soniia Cheah (MAS) vs [2] V. Sindhu Pusarla (IND)HNK Rijeka v Luton TownHitech Assumption Thonburi v PEAMontreal Canadiens @ Toronto Maple Leafs
```
--------------------------------
### Connect to Imgarena LLM Feed (Staging)
Source: https://docs.imgarena.com/imga-dl-trading-odds-distribution-service/getting-setup
Establishes an SSH connection to the staging environment of the Imgarena LLM feed. Requires the path to the generated private key file and the assigned username. Supports ports 22 and 2093.
```shell
ssh -i [generated private key file path] [username]@golf-odds-distribution.staging.imgarena.dev -p 22
```
--------------------------------
### Stage Object Structure Example
Source: https://docs.imgarena.com/snooker/objects/static-objects/stage
Provides a concrete example of the JSON structure for a Stage object. This includes the stage's unique identifier, name, UTC timestamps for start and end dates, and an array of associated rounds, along with an empty array for groups.
```json
{
"id": "c1ff5198-d901-4ee0-a690-deea1405eec5",
"name": "Main",
"startDateUTC": "2023-06-26T12:00:00",
"endDateUTC": "2023-07-14T12:00:00",
"rounds": [
{
"id": "bc4a56f7-d719-4438-9d5b-e76fbc14342c",
"name": "Stage One/week 1",
"startDateUTC": "2023-06-26T12:00:00",
"endDateUTC": "2023-06-26T12:00:00"
},
{
"id": "afe5834f-8836-488a-9351-ac8db74b374b",
"name": "Stage One/week 2",
"startDateUTC": "2023-06-26T12:00:00",
"endDateUTC": "2023-06-26T12:00:00"
},
{
"id": "d1b46422-93ff-4e45-98b5-d8b74fef174d",
"name": "Stage One/week 3",
"startDateUTC": "2023-06-26T12:00:00",
"endDateUTC": "2023-06-26T12:00:00"
}
],
"groups": []
}
```
--------------------------------
### API: Get Tournament Order of Play (OOP)
Source: https://docs.imgarena.com/tennis/documentation-1/draws-vs-oops
Provides the Order of Play (OOP) for each court, detailing the sequence of matches, court assignments, and scheduled start times. This endpoint reflects the exact order matches are to be played. Start times for matches scheduled to 'follow previous' are estimates.
```APIDOC
GET /tournaments/{id}/events
Description:
Returns the Order of Play (OOP) for a specific tournament, detailing match scheduling per court.
Parameters:
- id (path, required): The unique identifier for the tournament.
Returns:
- Order of Play (OOP) details: Includes matches, court sequence numbers, scheduled start times (either 'not before' or 'follows previous'), and match states.
Notes:
- The OOP is typically published daily by the tournament director, usually around 30 minutes after the last match of the day concludes.
- 'follows previous' start times are rough estimates.
- This endpoint serves as the definitive source for when specific events are scheduled to take place.
```