We offer two main types of integration methods, each with distinct advantages depending on the level of control and customization you need.
The UOF Proxy integration enables direct data handling from the Unified Odds Feed (UOF), forwarding responses directly without modification. Here's how it works:
Simplicity: The integration is straightforward, requiring only that responses from the UOF be passed through without modification. We provide a 1-to-1 function setup, which simplifies integration as you don't need to handle complex transformations; we'll handle XML validation and parsing.
Optimization: We manage caching and optimize request volumes, meaning fewer redundant calls and better data efficiency.
Considerations: While UOF Proxy is streamlined, it does have some limitations. There are no customization options since it's a direct pass-through integration, and it may require a proxy server setup to serve front-end requests if one isn't already in place.
For further details, you can refer to the UOF Proxy Documentation.
The Data Adapter approach allows for a fully customized integration, giving you complete control over how data is fetched, transformed, and displayed. Here's what you need to know:
Flexibility: With this method, you determine exactly how the data is transformed and presented to match your needs. You have complete control over market and outcome names and the presentation of data in general.
Responsibility: This integration provides maximum flexibility, but it also comes with the responsibility of ensuring that all data transformations on the client side adhere strictly to our data specifications.
Customization: Ideal for applications needing personalized display options or unique data structures, the Data Adapter approach allows you to maintain the look, feel, and functionality as desired. Both integration methods support widget theme customization, enabling you to tailor the appearance to match your style. You can achieve this by applying custom CSS properties directly to the widget's underlying HTML components.
You can find more information in the Data Adapter Documentation.
Object to be passed into addToBetSlip
| Name | Type | Required | Description |
|---|---|---|---|
succeeded | boolean | Yes | True if outcomes were successfully validated and added to bet slip. |
reason | string | No | Reason for failed action, if present it will be displayed in the widget. |
Error object used to display the correct error state in the widget.
| Name | Type | Description |
|---|---|---|
type | number | Error type: • 1 - General: Blocks all actions except removing outcomes from bet slip in custom bet widget.• 2 - BetStop: Blocks all actions in custom bet widget.• 3 - Calculation: Blocks adding outcomes to bet slip |
message | string | Text that will be displayed for error, localization required. |
callback({ type: 1, message: "Something went wrong" });Arguments passed to the calculate function.
| Name | Type | Description |
|---|---|---|
matchId | string | Sportradar match ID. See Getting Identifiers |
selectedOutcomes | UniqueOutcome[] | Array of all the selected outcomes in the widget. |
| Name | Type | Description |
|---|---|---|
matchId | string | Sportradar match ID. See Getting Identifiers |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Sportradar market ID. |
specifiers | string | No | For markets that have same id but different specficer. |
| Name | Type | Required | Description |
|---|---|---|---|
isActive | boolean | Yes |
{
isActive: false;
}| Name | Type | Description |
|---|---|---|
teamId | string |
Represents a single selected outcome in the widget.
| Property | Type | Required | Description |
|---|---|---|---|
matchId | string | Yes | Sportradar match ID. See Getting Identifiers |
marketId | number | string | Yes | Market identifier |
outcomeId | number | string | Yes | Outcome identifier |
srMarket | SRMarket | No | Sportradar market reference |
srOutcome | string | No | Sportradar outcome identifier |
| Method | Parameters | Returns | Description |
|---|---|---|---|
equals | UniqueOutcome | boolean | Returns true if the outcome is equal to the given UniqueOutcome. |
isSameMarket | UniqueOutcome | boolean | Returns true if the outcome belongs to the same market as the given UniqueOutcome |
getSelection | — | string | Returns XML string representation of the outcome as needed by UOF calculation endpoint |
toString | — | string | Returns string representation of the outcome |
Example:
{
matchId: "22223333",
marketId: "oneXtwo",
outcomeId: "x",
srMarket: { id: "1" },
srOutcome: "1"
}This function is called when the user clicks "Add to bet slip" button. Here you receive selected outcomes and validate them before adding them to your bet slip or reject them.
| Name | Type | Required | Description |
|---|---|---|---|
args | Object | Yes | Object with data. |
args.matchId | string | Yes | Match id of match that outcomes belong to. |
args.selectedOutcomes | UniqueOutcome[] | Yes | Array of outcomes that were selected in the widget. |
args.displayedOdds | string | No | Snapshot of odds returned by last calculation, CAUTION: ODDS ARE NOT UP TO DATE |
callback | AddToBetSlipHandleResult | boolean | Yes | To accept or reject call this function. If data is not received in time set by addToBetslipTimeoutMs widget prop or by defalt in 10000ms. |
Upon succesfull validation your call callback parameter and pass in AddToBetSlipHandleResult object.
function betslipCallback(args, callback) {
if (validation(args) is succesfull) {
callback({
succeeded: true
})
} else {
callback({
succeeded: false,
reason: 'Reason why it failed'
})
}
}