APIドキュメント
ベットおよびクーポン計算の システム統合
このシステムは、ベット計算とクーポン管理プロセスの自動化を目指すスポーツベッティングオペレーター、ブックメーカー、およびプラットフォーム開発者向けに設計されています。結果計算の迅速な統合を可能にし、クーポンステータス(勝ち、負け、払い戻し)に関する正確なデータを提供し、オペレーターのサーバーと計算システム間の相互作用を簡素化します。
POST /v1/coupon json
{
"coupon_id": "A7F3K9",
"type": "express",
"events": [
{ "id": 88213, "pick": "1", "odds": 2.10, "result": "win" },
{ "id": 88150, "pick": "over_2_5", "odds": 1.80, "result": "win" }
],
"total_odds": 3.78, "status": "won"
} システムはどのように機能しますか?
ユーザー認証
エラーレスポンス json
"errorCode":1,
"fullErrorCode":99,
"errorMessage":"Invalid access level" リクエスト送信の例(マネージャーから提供されたデータを使用してください):
POST {APIHOST}/WebServices/BCService.asmx/LogIn/ python
import requests
import json
url = "https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/"
payload = json.dumps({
"login": "[email protected]",
"password": "demo-password"
})
headers = {
'Content-Type': 'application/json'
}
print(response.text) POST {APIHOST}/WebServices/BCService.asmx/LogIn/ php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"login":"[email protected]",
"password":"demo-password"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response; POST {APIHOST}/WebServices/BCService.asmx/LogIn/ js
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"login": "[email protected]",
"password": "demo-password"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error)); POST {APIHOST}/WebServices/BCService.asmx/LogIn/ java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"login\":\"[email protected]\",\r\n \"password\":\"demo-password\"\r\n}");
Request request = new Request.Builder()
.url("https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute(); ベットまたはクーポンの送信メソッド
ペイロード本体の例 json
{
"data":{
"list_bets":[
"line#586464528|17|954|2.5#4.27", "live#586464528|87|4|0#1.12"
],
"realAmount":"2",
"currency":"USD",
"lang":"en",
"remote_host":"https://mysites.com",
"rate_mode":"reject"
}
} remote_host および rate_mode パラメータ
レスポンスフィールドおよびエラーの説明
操作成功
操作成功 json
{
"errorCode": 0,
"fullErrorCode": 0,
"errorMessage": ""
} エラーコード
一般エラー json
{
"errorCode": 1,
"fullErrorCode": [ERROR_CODE],
"errorMessage": "[ERROR_DESCRIPTION]"
} オッズが変更された際のエラー処理に関する推奨事項
オッズが変更された際のエラー処理に関する推奨事項 json
{
"errorCode":1,
"fullErrorCode":2,
"errorMessage":"Odds have changed",
"rate_mode":"reject",
"changed":[
{
"gid":"586464528", // match ID
"rb":2.15, // odds in your coupon
"rg":"2.27", // current real odds
"rt":0 // status of change. 0 - decreased, 1 - increased
}
]
} 計算結果の送信
単一クーポンのデータ例 json
{
"remote_host": "https://mysite.com",
"Heads": [{
"KeyHead": {
"Id": "344143",
"BarCode": "x9c52i8411"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 11130,
"DateReceive": "1597075782"
}]
} 複数クーポンのデータ例
複数クーポンのデータ例 json
{
"remote_host": "https://mysite.com",
"Heads": [{
"KeyHead": {
"Id": "313",
"BarCode": "75vz48t935"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 19.85,
"DateReceive": "1592937968"
}, {
"KeyHead": {
"Id": "312",
"BarCode": "77i0r6e15t"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 12.51,
"DateReceive": "1592937280"
}]
}