派發免費轉活動
curl --request POST \
--url https://your-api-host/vendor/v2.0/freespin/bind \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"channelID": 123,
"eventID": "<string>",
"memberList": [
"<string>"
],
"sign": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-api-host/vendor/v2.0/freespin/bind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channelID' => 123,
'eventID' => '<string>',
'memberList' => [
'<string>'
],
'sign' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channelID: 123,
eventID: '<string>',
memberList: ['<string>'],
sign: '<string>'
})
};
fetch('https://your-api-host/vendor/v2.0/freespin/bind', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-api-host/vendor/v2.0/freespin/bind"
payload = {
"channelID": 123,
"eventID": "<string>",
"memberList": ["<string>"],
"sign": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"grants": [
{
"memberAccount": "test123",
"grantID": "abccc1234567890aaaaa1254"
},
{
"memberAccount": "test1234",
"grantID": "abccc1234567890aaaaa1299"
}
]
},
"status": {
"code": "0",
"message": "success",
"datetime": "2022-07-01T10:13:54.920+08:00",
"traceCode": "7cf25e1957cc47fe8e01f1a7c6d504d6"
}
}
免費旋轉
派發免費轉活動
POST
/
vendor
/
v2.0
/
freespin
/
bind
派發免費轉活動
curl --request POST \
--url https://your-api-host/vendor/v2.0/freespin/bind \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"channelID": 123,
"eventID": "<string>",
"memberList": [
"<string>"
],
"sign": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-api-host/vendor/v2.0/freespin/bind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channelID' => 123,
'eventID' => '<string>',
'memberList' => [
'<string>'
],
'sign' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channelID: 123,
eventID: '<string>',
memberList: ['<string>'],
sign: '<string>'
})
};
fetch('https://your-api-host/vendor/v2.0/freespin/bind', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-api-host/vendor/v2.0/freespin/bind"
payload = {
"channelID": 123,
"eventID": "<string>",
"memberList": ["<string>"],
"sign": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"grants": [
{
"memberAccount": "test123",
"grantID": "abccc1234567890aaaaa1254"
},
{
"memberAccount": "test1234",
"grantID": "abccc1234567890aaaaa1299"
}
]
},
"status": {
"code": "0",
"message": "success",
"datetime": "2022-07-01T10:13:54.920+08:00",
"traceCode": "7cf25e1957cc47fe8e01f1a7c6d504d6"
}
}
- 將 memberList 內的會員整批派發派發卡 (joinOptions=add),整批成功或整批失敗 (all-or-nothing)。
- 任一會員不存在 → 整批拒絕,回 ACCOUNT_DOES_NOT_EXIST,errorMessage 帶不存在的會員帳號。
- 名額檢查:若 (目前已派發數 + 本次 memberList 筆數) 超過活動 maxGrantCount,整批拒絕,回 FREESPIN_QUOTA_FULL。
- 任一會員已綁定 (allowDuplicateJoin=false) 或達單人上限 (max_grants_per_member) → 整批拒絕,回 BAD_PARAMETERS,錯誤訊息帶違規會員。
- 活動狀態異常 (不存在 / 未啟用 / 已過期 / 幣別不符) → 整批拒絕,回 FREESPIN_EVENT_NOT_FOUND 或 BAD_PARAMETERS。
- 成功則回 grants:每筆皆含 grantID 與 memberAccount。
請求參數
number
必填
參與簽章
渠道編號 (若無渠道,請帶入1)
string
必填
參與簽章
活動編號 (24 碼 hex)
string[]
必填
參與簽章
會員帳號列表(至少帶 1 個,不可重複,每個不可為空字串)(form-data 以同名欄位重複傳送多個值)
回應
成功(HTTP 狀態碼固定為 200,請以status.code 判斷結果)
object
{
"data": {
"grants": [
{
"memberAccount": "test123",
"grantID": "abccc1234567890aaaaa1254"
},
{
"memberAccount": "test1234",
"grantID": "abccc1234567890aaaaa1299"
}
]
},
"status": {
"code": "0",
"message": "success",
"datetime": "2022-07-01T10:13:54.920+08:00",
"traceCode": "7cf25e1957cc47fe8e01f1a7c6d504d6"
}
}