Integrate ProphetX Play into Your Existing Odds Screen Platform
Guide to integrating ProphetX play into your odds screen platform, including steps for data ingestion, user session management, geolocation checks, and play tracking.
Integrate ProphetX Play into Your Existing Odds Screen Platform
High-Level Steps
- Ingest Sports Events and Marketing Data
- Manage User Sessions
- Geolocation Check
- Make Plays
- Certify with ProphetX
Notes:
- The current API documentation is limited, we will be updating it as an ongoing service to assure the most up to date documentation is available
- This document itself only includes how to make plays. In order to manage plays and check plays histories, users would need to log into the website or use our mobile app here respectively.
Ingest Sport Events and Marketing Data
Ingest events and markets using our affiliate API. Make sure line_id is recorded, as this is needed to make a play. Affiliate API documentation: Affiliate API Documentation
Recommended steps:
- Get production affiliate API token from ProphetX if you do not have one yet.
- Call
get_sport_eventsto get a list of events of a tournament. - Call
get_multiple_marketsto get markets of a list of events. Make sure theline_idis recorded, as it is needed to make plays later.
{
"data": {
"10073803": [
{
"display_name": "Total Runs",
"id": 258,
"line": 7.5,
"name": "Fixed total 7.5",
"selections": [
{
"display_line": "7.5",
"display_name": "under 7.5",
"display_odds": "+119",
"line": 7.5,
"line_id": "40a32ae7b39684d430cf494be26cbe6b",
"name": "under 7.5",
"odds": 119,
"outcome_id": 13,
"stake": 42.81,
"updated_at": 1728663193784820000,
"value": 32.61
},
{
"display_line": "7.5",
"display_name": "over 7.5",
"display_odds": "-122",
"line": 7.5,
"line_id": "7d8bbf46022a2329f792a2e0dfb18408",
"name": "over 7.5",
"odds": -122,
"outcome_id": 12,
"stake": 32.46,
"updated_at": 1728659738559788000,
"value": 39.6
}
],
"type": "total"
},
......,
{
"display_name": "1st-5th Inning Spread",
"favourite": true,
"id": 275,
"line": -0.5,
"name": "Fixed home -0.5",
"selections": [
{
"competitor_id": 10000001,
"display_line": "-0.5",
"display_name": "Los Angeles Dodgers -0.5",
"display_odds": "+103",
"line": -0.5,
"line_id": "5cfa3fd055082c25448ed0bdee083092",
"name": "Los Angeles Dodgers -0.5",
"odds": 103,
"outcome_id": 1714,
"stake": 702.05,
"updated_at": 1728662243408684000,
"value": 681.6
},
{
"competitor_id": 10000033,
"display_line": "+0.5",
"display_name": "San Diego Padres +0.5",
"display_odds": "-111",
"line": 0.5,
"line_id": "48470acfbf067d1dc8c76d4692315c34",
"name": "San Diego Padres +0.5",
"odds": -111,
"outcome_id": 1715,
"stake": 13.89,
"updated_at": 1728662243408817000,
"value": 15.42
}
],
"type": "spread"
}
]
}
}Manage User Session
This step does not need to store the user’s email and password but requires the user to enter their email/password once every 30 days.
Recommended steps:
- Pop out a modal to ask the user to enter ProphetX email/password to connect to ProphetX.
- Call Login API using the user-provided email/password to get two tokens:
accessTokenandrefreshToken. TheaccessTokenexpires within 1 hour, andrefreshTokenis valid for 30 days. Store therefreshTokenandaccessTokenon your server side. - Once
refreshTokenexpires, use the endpoint Extend Session API to get a newrefreshTokenusing theaccessToken. In the request, you can useBearer <previous refreshToken>as Authorization. A validrefreshTokenis needed to make plays. - After 30 days, if the
accessTokenis created or your side failed to get a newrefreshTokenusing the existingaccessToken, ask the user to repeat step 1.
Geolocation Check
The geolocation check can be implemented as follows:
Minimum Integration Example
// Include Solus into your page and Initialize the GcHtml5 instance
<script src="https://cdn.geocomply.com/path/to/gc-html5.js" type="text/javascript"></script>
<script type="text/javascript">
var geoClient = GcHtml5.createClient();
</script>// AMD / RequireJS application can do it this way
define(['gc-html5'], function(GcHtml5) {
var geoClient = GcHtml5.createClient();
});
// Setting up the parameters
geoClient.setUserId("user_identifier");
// Setting up the license string
geoClient.setLicense("license_string");
// Register events handler
geoClient.events.on('engine.success', function(text,xml) {
// Process the response XML
})
.on('engine.failed', function(code, message) {
// Handle errors
});
// Request Geolocation
geoClient.request();
Geocomply integration example:
- Replace the
srcpart from the above code blocks for the geocomply library by Geocomply Library - Call Geocomply License API to get a Prophet license. This is a one-time license, and you need to get a new one for each geolocation request.
- Call User ID API to get the user ID.
- Follow the code blocks "Geocomply integration example" to make the geolocation request using the above user ID and license from step 2.
- Once you get a response, call Decrypt API to get a decrypted response + ProphetX special logic.
- Make sure
<error_code>0</error_code>and"isActiveStates": true, then the user is allowed to make a play. If not satisfied, the user geolocation failed, and your platform can ask them to manually trigger the geolocation request again.
{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<nodes>
<gc_transaction>8b21cb1d4e54d0de</gc_transaction>
<error_code>0</error_code>
<error_message/>
<sdk solution=\"Solus\" os=\"Mac\"/>
<geolocate_in>1800</geolocate_in>
<buffer_time>35</buffer_time><conn_type>static</conn_type>
<mac_address>unknown</mac_address>
<device_uuid>1726663819576–07167EAD-AC76–4DCC-854C-CBCB40926D25</device_uuid>
<ip ipaddress=\"45.122.19.131\" proxyscore=\"0.00\" lat=\"41.8108\" lon=\"-71.3667\" acc=\"100000\" country_code=\"US\" country=\"United States\" region_code=\"NY\" region=\"New York\"
city=\"Huntington Station\" err=\"0\" secondary=\"1\"/><wifi lat=\"40.82496\"
lon=\"-71.45789\" acc=\"33.145748641574\" country_code=\"US\"
country=\"United States\" region_code=\"NY\" region=\"New York\"
city=\"\" street=\"Main Street\" err=\"0\" primary=\"1\"
dist_to_border=\"31591.854251358\"/><gsm lat=\"\" lon=\"\" acc=\"\"
country_code=\"\" country=\"\" region_code=\"\" region=\"\"
city=\"\" street=\"\" err=\"202\"/><gps lat=\"\" lon=\"\"
acc=\"\" country_code=\"\" country=\"\" region_code=\"\"
region=\"\" city=\"\" street=\"\" err=\"202\"/>
<user_id>78d76eaf-3227–4045–8c6a-5e6fa3cc8a26</user_id>
<reason>Verfiy geo location</reason><user_session_id/>
<custom_fields>
<custom_field id=\"email\">[email protected]</custom_field>
<custom_field id=\"phoneNumber\">2348232834</custom_field>
</custom_fields><timestamp>2024–09–30T15:00:52.672Z</timestamp>
<akey>ProphetXProd</akey></nodes>\n",
"isActiveStates": true,
"errorMessage": ""}Make Plays
Once the geolocation check from the above step succeeds, the user is then legally allowed to make plays on our platform through your website.
Recommended steps:
- Make sure the user is geolocated successfully from the previous step.
- From the event/market data ingested in step 1, find the specific
line_idthat the user is interested in playing. - Upon user click on the specific event/market/line/side, pop out a window to ask the user to enter Prophet Cash amount and odds, which can default to the best odds your side shows.
- If
refreshTokenis expired, get a newrefreshTokenusingaccessToken. - Call Wagers API by providing
lineID,odds,stakeas the payload.
Send Tracking Data to ProphetX
To better track the performance of integration effectively, implement the equivalent of this curl command on your side for each play placed. The <user_id> can be obtained from the /me endpoint, and the refId is from the play placement response.
curl --request POST \
--url https://track.customer.io/api/v1/customers/<user_id>/events \
--header 'content-type: application/json' \
--header 'Authorization:Basic ZWQxMDdkMTYxMDgwN2E0YWQyNTA6ZjBiMzFhNjc1YjkwNTlmMGMwMTc=' \
--data '{"name":"Bet Placed","data":{"wager_id": "<wager_refId>",
"bet_placement_location": "beeBettor"}}'Updated 9 days ago