[#1375] API issues

Migrated from Redmine #1375 | Author: huang Huang
Status: New | Priority: Low, I can wait | Created: 2025-02-21


async function handleBooking(request, env) {
const { method, headers } = request;
if (method !== “POST”) {
return new Response(“\u4E0D\u652F\u63F4\u7684\u8ACB\u6C42\u65B9\u6CD5”, { status: 405 });
}
const signature = headers.get(“x-signature”);
if (!signature) {
console.warn(“\u7F3A\u5C11\u7C3D\u540D”);
return new Response(“\u7F3A\u5C11\u7C3D\u540D”, { status: 400 });
}
const body = await request.text();
console.log(“\u8ACB\u6C42\u4E3B\u9AD4:”, body);
const isValid = await verifySignature(body, signature, env.SHARED_SECRET);
console.log(\u7C3D\u540D\u9A57\u8B49\u7D50\u679C: ${isValid});
if (!isValid) {
console.warn(“\u7121\u6548\u7684\u7C3D\u540D”);
return new Response(“\u7121\u6548\u7684\u7C3D\u540D”, { status: 403 });
}
try {
const data = JSON.parse(body);
const bookingId = data.booking_id;
if (!bookingId) {
console.warn(“\u7F3A\u5C11 booking_id”);
return new Response(“\u7F3A\u5C11 booking_id”, { status: 400 });
}
const bookingDetails = await fetchBookingDetails(bookingId, env);
if (!bookingDetails) {
console.error(“\u7372\u53D6\u9810\u7D04\u8A73\u60C5\u5931\u6557”);
return new Response(“\u7372\u53D6\u9810\u7D04\u8A73\u60C5\u5931\u6557”, { status: 500 });
}
console.log(“\u9810\u7D04\u8A73\u60C5\uFF1A”, bookingDetails);
await saveBookingDetails(bookingDetails, env.db);
return new Response(“\u9810\u7D04\u8A73\u60C5\u5DF2\u7372\u53D6\u4E26\u8655\u7406”, { status: 200 });
} catch (error) {
console.error(“\u89E3\u6790 JSON \u6642\u767C\u751F\u932F\u8AA4\uFF1A”, error);
return new Response(“\u7121\u6548\u7684 JSON \u683C\u5F0F”, { status: 400 });
}
}
async function verifySignature(body, signature, secret) {
const encoder = new TextEncoder();
const keyData = encoder.encode(secret);
const bodyData = encoder.encode(body);
const cryptoKey = await crypto.subtle.importKey(
“raw”,
keyData,
{ name: “HMAC”, hash: “SHA-256” },
false,
[“sign”]
);
const signatureArrayBuffer = await crypto.subtle.sign(“HMAC”, cryptoKey, bodyData);
const computedSignature = bufferToHex(signatureArrayBuffer);
console.log(“\u8A08\u7B97\u51FA\u7684\u7C3D\u540D:”, computedSignature);
console.log(“\u63A5\u6536\u5230\u7684\u7C3D\u540D:”, signature);
return computedSignature.toLowerCase() === signature.toLowerCase();
}
function bufferToHex(buffer) {
return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, “0”)).join(“”);
}
async function fetchBookingDetails(bookingId, env) {
const apiUrl = “https://user-api.simplybook.me/admin”;
const loginUrl = “https://user-api.simplybook.me/login”;
const userTokenPayload = {
jsonrpc: “2.0”,
method: “getUserToken”,
params: {
companyLogin: env.COMPANY_LOGIN,
userLogin: env.USER_LOGIN,
userPassword: env.USER_PASSWORD
},
id: 1
};
try {
const tokenResponse = await fetch(loginUrl, {
method: “POST”,
headers: { “Content-Type”: “application/json” },
body: JSON.stringify(userTokenPayload)
});
const tokenData = await tokenResponse.json();
const userToken = tokenData.result;
if (!userToken) {
console.error(“\u7372\u53D6\u7528\u6236\u4EE4\u724C\u5931\u6557\uFF1A”, tokenData);
return null;
}
console.log(“\u7372\u53D6\u7684\u7528\u6236\u4EE4\u724C\uFF1A”, userToken);
const bookingDetailsPayload = {
jsonrpc: “2.0”,
method: “getBookingDetails”,
params: {
id: bookingId
},
id: 2
};
const response = await fetch(apiUrl, {
method: “POST”,
headers: {
“Content-Type”: “application/json”,
“X-Company-Login”: env.COMPANY_LOGIN,
“X-User-Token”: userToken
},
body: JSON.stringify(bookingDetailsPayload)
});
if (!response.ok) {
console.error(“\u7372\u53D6\u9810\u7D04\u8A73\u60C5\u5931\u6557\uFF1A”, response.statusText);
return null;
}
const responseData = await response.json();
console.log(“\u7372\u53D6\u7684\u9810\u7D04\u8A73\u60C5\uFF1A”, responseData.result);
return responseData.result;
} catch (error) {
console.error(“\u7372\u53D6\u9810\u7D04\u8A73\u60C5\u6642\u767C\u751F\u932F\u8AA4\uFF1A”, error);
return null;
}
}

The above is the code I wrote. Every time I get the Webhook of simplybook, I use the obtained bookid to call the API to get the reservation information. There was no error for a year, but I have been refused to get the information in the past month. Is there a problem, such as frequent acquisition of tokens or the API exceeds the daily limit of 5,000? But I have confirmed that our reservation volume should not exceed 5,000.

Redmine Admin wrote:

hi, could you please provide the first request which gives you the error?

huang Huang wrote:

{
“truncated”: false,
“executionModel”: “stateless”,
“outcome”: “canceled”,
“scriptVersion”: {
“id”: “7e76a9ab-35a0-4ce2-8d80-273ec8483262”
},
“scriptName”: “taihevllageauto”,
“diagnosticsChannelEvents”: ,
“exceptions”: ,
“logs”: [
{
“message”: [
“Received request from User-Agent: simplybook.me API”
],
“level”: “log”,
“timestamp”: 1740150375898
},
{
“message”: [
“User-Agent verified. Processing booking…”
],
“level”: “log”,
“timestamp”: 1740150375898
},
{
“message”: [
“請求主體:”,
“{"booking_id":"75364","booking_hash":"b70eb310db7843685daaddb983b47a59","company":"taihevillage","notification_type":"change","webhook_timestamp":1740150375,"signature_algo":"sha256"}”
],
“level”: “log”,
“timestamp”: 1740150375898
},
{
“message”: [
“計算出的簽名:”,
“3f52e9aca497fd6c5dfe6a03542530c966781aad646c886e996f101ad5036c5e”
],
“level”: “log”,
“timestamp”: 1740150375898
},
{
“message”: [
“接收到的簽名:”,
“3f52e9aca497fd6c5dfe6a03542530c966781aad646c886e996f101ad5036c5e”
],
“level”: “log”,
“timestamp”: 1740150375898
},
{
“message”: [
“簽名驗證結果: true”
],
“level”: “log”,
“timestamp”: 1740150375898
},
{
“message”: [
“獲取的用戶令牌:”,
“f0bf671a059d0f2344ce8be04fc0f0439609ed5543ac6c94cd08b3f09002dddc”
],
“level”: “log”,
“timestamp”: 1740150378730
}
],
“eventTimestamp”: 1740150375898,
“event”: {
“request”: {
“url”: “https://taihevllageauto.zas125314055.workers.dev/”,
“method”: “POST”,
“headers”: {
“accept-encoding”: “gzip, br”,
“cf-connecting-ip”: “2402:1f00:8001:2194::”,
“cf-ipcountry”: “SG”,
“cf-ray”: “9157a3a95c9a2ebc”,
“cf-visitor”: “{"scheme":"https"}”,
“connection”: “Keep-Alive”,
“content-length”: “183”,
“content-type”: “application/json”,
“host”: “taihevllageauto.zas125314055.workers.dev”,
“user-agent”: “simplybook.me API”,
“x-forwarded-proto”: “https”,
“x-real-ip”: “2402:1f00:8001:2194::”,
“x-signature”: “3f52e9aca497fd6c5dfe6a03542530c966781aad646c886e996f101ad5036c5e”
},
“cf”: {
“clientTcpRtt”: 1,
“requestHeaderNames”: {},
“httpProtocol”: “HTTP/1.1”,
“tlsCipher”: “AEAD-AES256-GCM-SHA384”,
“continent”: “AS”,
“asn”: 16276,
“clientAcceptEncoding”: “gzip, deflate”,
“country”: “SG”,
“verifiedBotCategory”: “”,
“tlsClientAuth”: {
“certIssuerDNLegacy”: “”,
“certIssuerSKI”: “”,
“certSubjectDNRFC2253”: “”,
“certSubjectDNLegacy”: “”,
“certFingerprintSHA256”: “”,
“certNotBefore”: “”,
“certSKI”: “”,
“certSerial”: “”,
“certIssuerDN”: “”,
“certVerified”: “NONE”,
“certNotAfter”: “”,
“certSubjectDN”: “”,
“certPresented”: “0”,
“certRevoked”: “0”,
“certIssuerSerial”: “”,
“certIssuerDNRFC2253”: “”,
“certFingerprintSHA1”: “”
},
“tlsClientExtensionsSha1”: “cZTfz0G33jxhytWCjEfVzVcI6Z8=”,
“tlsExportedAuthenticator”: {
“clientFinished”: “6aad4a7b45fe3b62527f6ce46d7949931670816b204fc4540baab74bdc7fdd7604b39def1612e39a37da8358c5b29a13”,
“clientHandshake”: “3849e8483292fdb62bcbe1667f2aebdc5414da1c60efe3b96637aee1d2b86a103a85beceec0a584c42bf03ca023ff741”,
“serverHandshake”: “0c20b514c22f63cf03ce8180c49b6deff05dc39df7bb19276a722f2e8157327651c5cb6288f23011b7c53afcaeac2668”,
“serverFinished”: “12650786dfd0b514b26cb28b018b5015dc14ec19d2464b7ca3a6b3716651a079d069f9515b8334ae1c503ceb42b131a3”
},
“tlsVersion”: “TLSv1.3”,
“city”: “Singapore”,
“timezone”: “Asia/Singapore”,
“requestPriority”: “”,
“edgeRequestKeepAliveStatus”: 1,
“tlsClientRandom”: “WUNV3sRUQbofdDBywkRAoDvrdEfArRKk1oy8J9qQiEA=”,
“longitude”: “103.84680”,
“latitude”: “1.27670”,
“postalCode”: “06”,
“asOrganization”: “OVHcloud”,
“tlsClientHelloLength”: “508”,
“colo”: “SIN”
}
}
},
“id”: 0
}
這是我的log 看不出來是哪裡錯誤

Redmine Admin wrote:

this doesn’t look like an API request

please provide company login

huang Huang wrote:

You want my company account password? Or just log in
My login information is taihevillage

huang Huang wrote:

{
“truncated”: false,
“executionModel”: “stateless”,
“outcome”: “ok”,
“scriptVersion”: {
“id”: “7e76a9ab-35a0-4ce2-8d80-273ec8483262”
},
“scriptName”: “taihevllageauto”,
“diagnosticsChannelEvents”: ,
“exceptions”: ,
“logs”: [
{
“message”: [
“Received request from User-Agent: simplybook.me API”
],
“level”: “log”,
“timestamp”: 1740151375244
},
{
“message”: [
“User-Agent verified. Processing booking…”
],
“level”: “log”,
“timestamp”: 1740151375244
},
{
“message”: [
“請求主體:”,
“{"booking_id":"75368","booking_hash":"3d3af72de3247a5cfec44cdb357f525a","company":"taihevillage","notification_type":"create","webhook_timestamp":1740151375,"signature_algo":"sha256"}”
],
“level”: “log”,
“timestamp”: 1740151375244
},
{
“message”: [
“計算出的簽名:”,
“ace8c385154ee68a12460f5e3d1108fc6a2c7080afdb2c3cefcee16a5490c7ad”
],
“level”: “log”,
“timestamp”: 1740151375244
},
{
“message”: [
“接收到的簽名:”,
“ace8c385154ee68a12460f5e3d1108fc6a2c7080afdb2c3cefcee16a5490c7ad”
],
“level”: “log”,
“timestamp”: 1740151375244
},
{
“message”: [
“簽名驗證結果: true”
],
“level”: “log”,
“timestamp”: 1740151375244
},
{
“message”: [
“獲取的用戶令牌:”,
“b8a833ce6a7359c0f3558de13b25905daf2ce55cd6e429828c90475a031b4937”
],
“level”: “log”,
“timestamp”: 1740151376634
},
{
“message”: [
“獲取的預約詳情:”,
{
“id”: “75368”,
“code”: “3m51m5jz1n”,
“is_confirmed”: “1”,
“comment”: null,
“event_id”: “540”,
“event_name”: “2H(老點)$1800”,
“event_duration”: “120”,
“event_buffertime_before”: “0”,
“event_buffertime_after”: “0”,
“event_description”: “”,
“deposit_is_enabled”: 0,
“deposit_event_price”: null,
“event_price”: “1800.0000”,
“event_currency”: “TWD”,
“event_tax_id”: null,
“invoice_id”: null,
“invoice_number”: null,
“invoice_status”: null,
“invoice_currency”: null,
“invoice_line_amount”: null,
“invoice_line_id”: null,
“invoice_payment_received”: null,
“invoice_amount”: “0.0000”,
“invoice_payment_processor”: null,
“invoice_payment_processor_id”: null,
“event_image”: “”,
“event_image_path”: “”,
“unit_id”: “10”,
“unit_name”: “18號老師”,
“unit_description”: “”,
“unit_email”: “chungrose2023@gmail.com,taihevillagemail@gmail.com”,
“unit_phone”: “”,
“unit_image”: “91ea5c8d3921ee6f5a520e142f7c0c8e.png”,
“unit_image_path”: “/uploads/taihevillage91ea5c8d3921ee6f5a520e142f7c0c8e.png/preview/91ea5c8d3921ee6f5a520e142f7c0c8e.png”,
“start_date_time”: “2025-03-02 10:00:00”,
“end_date_time”: “2025-03-02 12:00:00”,
“client_timezone”: null,
“record_date”: “2025-02-21 15:22:52”,
“client_id”: “53365”,
“client_name”: “魏小姐”,
“client_email”: “11212@taihevillage.com”,
“client_phone”: “+886988265836”,
“client_address1”: “”,
“client_address2”: “”,
“client_city”: “”,
“client_zip”: “”,
“client_country_id”: “TW”,
“online_meeting_id”: null,
“company_login”: “taihevillage”,
“company_name”: “泰和村養身美容SPA會館/怡然富足”,
“company_phone”: “02-26492333”,
“company_email”: “zas125314055@gmail.com”,
“additional_fields”: [
{
“value”: “未報到”,
“field_name”: “a0de0efe3ae0c2475c9794b82be2f776”,
“field_title”: “報到”,
“field_position”: “43”,
“field_type”: “select”,
“field_id”: “72”,
“field_pos”: “43”,
“field_values”: “已報到,未報到”
},
{
“value”: “”,
“field_name”: “514b95cbc6379d29a397b28389edb26b”,
“field_title”: “顧客姓名”,
“field_position”: “44”,
“field_type”: “text”,
“field_id”: “120”,
“field_pos”: “44”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “cff185d0fe558a9a2fdb4dc23b3c9dc2”,
“field_title”: “顧客電話”,
“field_position”: “46”,
“field_type”: “digits”,
“field_id”: “121”,
“field_pos”: “46”,
“field_values”: null
},
{
“value”: “不選擇房間”,
“field_name”: “330bd2bcd75687f22335f05c57ab50ae”,
“field_title”: “選擇房間”,
“field_position”: “47”,
“field_type”: “select”,
“field_id”: “122”,
“field_pos”: “47”,
“field_values”: “不選擇房間,推2,推3,推5,推6,油1,油2,油3,油5,油6,油7,油8,油9,油10,油11,油12,美1,美2,美3”
},
{
“value”: “不選擇性別”,
“field_name”: “16e5d7633450f1c800bf5ebd0a056878”,
“field_title”: “選擇性別”,
“field_position”: “49”,
“field_type”: “select”,
“field_id”: “123”,
“field_pos”: “49”,
“field_values”: “不選擇性別,女師,男師”
},
{
“value”: “不選擇國籍”,
“field_name”: “d08289c4e4f08980a9c415876c8720d2”,
“field_title”: “選擇國籍”,
“field_position”: “53”,
“field_type”: “select”,
“field_id”: “124”,
“field_pos”: “53”,
“field_values”: “不選擇國籍,台灣,泰國,越南,大陸”
},
{
“value”: “現金”,
“field_name”: “f3ff8db69be2234759fe662b3fbbedc5”,
“field_title”: “付款方式”,
“field_position”: “63”,
“field_type”: “select”,
“field_id”: “99”,
“field_pos”: “63”,
“field_values”: “現金,line pay,藍新,轉帳,TWQR”
},
{
“value”: “”,
“field_name”: “8ec4d524f9e54d12a088551b5b2c6d58”,
“field_title”: “付款方式金額”,
“field_position”: “67”,
“field_type”: “digits”,
“field_id”: “100”,
“field_pos”: “67”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “7481953881dcc0c3d281213f46c81b66”,
“field_title”: “額外付款方式”,
“field_position”: “72”,
“field_type”: “select”,
“field_id”: “117”,
“field_pos”: “72”,
“field_values”: “現金,line pay,藍新,轉帳,TWQR”
},
{
“value”: “”,
“field_name”: “7cffd299c141f5c3e8e34cdef01bcc90”,
“field_title”: “額外付款方式金額”,
“field_position”: “78”,
“field_type”: “digits”,
“field_id”: “118”,
“field_pos”: “78”,
“field_values”: null
},
{
“value”: “不用卷”,
“field_name”: “a71830558a1c356be06eb20172527024”,
“field_title”: “是否用卷”,
“field_position”: “327”,
“field_type”: “select”,
“field_id”: “101”,
“field_pos”: “327”,
“field_values”: “用卷,不用卷”
},
{
“value”: “”,
“field_name”: “42f20d0a030f4f8fbf62c2caea9d266b”,
“field_title”: “(泰和村)用卷輸入”,
“field_position”: “328”,
“field_type”: “select”,
“field_id”: “102”,
“field_pos”: “328”,
“field_values”: “1100,1200,1300,1388,1500,1600”
},
{
“value”: “”,
“field_name”: “9a17454f0246fdf6fba8239249ed0656”,
“field_title”: “(泰和村)卷號輸入”,
“field_position”: “335”,
“field_type”: “digits”,
“field_id”: “103”,
“field_pos”: “335”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “1a2936c72b87b881dc769dbf328dc5ee”,
“field_title”: “備註”,
“field_position”: “382”,
“field_type”: “text”,
“field_id”: “6”,
“field_pos”: “382”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “89d3ad08ef9e86cd0fda0daa6f1aed29”,
“field_title”: “支出”,
“field_position”: “383”,
“field_type”: “digits”,
“field_id”: “91”,
“field_pos”: “383”,
“field_values”: null
},
{
“value”: “泰和村”,
“field_name”: “343d37b1594945ad851e7d947ef7902e”,
“field_title”: “泰和村”,
“field_position”: “384”,
“field_type”: “select”,
“field_id”: “112”,
“field_pos”: “384”,
“field_values”: “泰和村”
}
],
“status”: {
“id”: “6”,
“name”: “代付款”,
“description”: “”,
“color”: “fac94e”,
“is_default”: “1”
},
“comments”: ,
“history”: [
{
“id”: “205683”,
“sheduler_id”: “75368”,
“datetime”: “2025-02-21 23:22:52”,
“type”: “create”,
“user_id”: “1”,
“agent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15”,
“ip”: “211.76.58.170, 211.76.58.170:127.0.0.1”,
“referer”: “https://taihevillage.secure.simplybook.asia/”,
“login”: “zas125314055”,
“firstname”: “泰和村”,
“lastname”: “”
}
],
“location”: null,
“price”: ,
“promo”: ,
“client_membership_id”: null,
“membership_name”: null,
“membership_rest”: null,
“membership_limit”: null,
“membership_period_start”: null,
“membership_period_end”: null,
“event_category”: {
“id”: “88”,
“name”: “泰和村2H”,
“description”: “”,
“is_default”: “0”,
“position”: “45”,
“file_id”: null,
“seo_url”: null,
“is_visible”: “0”
},
“invoice”: null,
“paid_attributes”: ,
“products”: ,
“is_google_maps_booking”: false
}
],
“level”: “log”,
“timestamp”: 1740151378136
},
{
“message”: [
“預約詳情:”,
{
“id”: “75368”,
“code”: “3m51m5jz1n”,
“is_confirmed”: “1”,
“comment”: null,
“event_id”: “540”,
“event_name”: “2H(老點)$1800”,
“event_duration”: “120”,
“event_buffertime_before”: “0”,
“event_buffertime_after”: “0”,
“event_description”: “”,
“deposit_is_enabled”: 0,
“deposit_event_price”: null,
“event_price”: “1800.0000”,
“event_currency”: “TWD”,
“event_tax_id”: null,
“invoice_id”: null,
“invoice_number”: null,
“invoice_status”: null,
“invoice_currency”: null,
“invoice_line_amount”: null,
“invoice_line_id”: null,
“invoice_payment_received”: null,
“invoice_amount”: “0.0000”,
“invoice_payment_processor”: null,
“invoice_payment_processor_id”: null,
“event_image”: “”,
“event_image_path”: “”,
“unit_id”: “10”,
“unit_name”: “18號老師”,
“unit_description”: “”,
“unit_email”: “chungrose2023@gmail.com,taihevillagemail@gmail.com”,
“unit_phone”: “”,
“unit_image”: “91ea5c8d3921ee6f5a520e142f7c0c8e.png”,
“unit_image_path”: “/uploads/taihevillage91ea5c8d3921ee6f5a520e142f7c0c8e.png/preview/91ea5c8d3921ee6f5a520e142f7c0c8e.png”,
“start_date_time”: “2025-03-02 10:00:00”,
“end_date_time”: “2025-03-02 12:00:00”,
“client_timezone”: null,
“record_date”: “2025-02-21 15:22:52”,
“client_id”: “53365”,
“client_name”: “魏小姐”,
“client_email”: “11212@taihevillage.com”,
“client_phone”: “+886988265836”,
“client_address1”: “”,
“client_address2”: “”,
“client_city”: “”,
“client_zip”: “”,
“client_country_id”: “TW”,
“online_meeting_id”: null,
“company_login”: “taihevillage”,
“company_name”: “泰和村養身美容SPA會館/怡然富足”,
“company_phone”: “02-26492333”,
“company_email”: “zas125314055@gmail.com”,
“additional_fields”: [
{
“value”: “未報到”,
“field_name”: “a0de0efe3ae0c2475c9794b82be2f776”,
“field_title”: “報到”,
“field_position”: “43”,
“field_type”: “select”,
“field_id”: “72”,
“field_pos”: “43”,
“field_values”: “已報到,未報到”
},
{
“value”: “”,
“field_name”: “514b95cbc6379d29a397b28389edb26b”,
“field_title”: “顧客姓名”,
“field_position”: “44”,
“field_type”: “text”,
“field_id”: “120”,
“field_pos”: “44”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “cff185d0fe558a9a2fdb4dc23b3c9dc2”,
“field_title”: “顧客電話”,
“field_position”: “46”,
“field_type”: “digits”,
“field_id”: “121”,
“field_pos”: “46”,
“field_values”: null
},
{
“value”: “不選擇房間”,
“field_name”: “330bd2bcd75687f22335f05c57ab50ae”,
“field_title”: “選擇房間”,
“field_position”: “47”,
“field_type”: “select”,
“field_id”: “122”,
“field_pos”: “47”,
“field_values”: “不選擇房間,推2,推3,推5,推6,油1,油2,油3,油5,油6,油7,油8,油9,油10,油11,油12,美1,美2,美3”
},
{
“value”: “不選擇性別”,
“field_name”: “16e5d7633450f1c800bf5ebd0a056878”,
“field_title”: “選擇性別”,
“field_position”: “49”,
“field_type”: “select”,
“field_id”: “123”,
“field_pos”: “49”,
“field_values”: “不選擇性別,女師,男師”
},
{
“value”: “不選擇國籍”,
“field_name”: “d08289c4e4f08980a9c415876c8720d2”,
“field_title”: “選擇國籍”,
“field_position”: “53”,
“field_type”: “select”,
“field_id”: “124”,
“field_pos”: “53”,
“field_values”: “不選擇國籍,台灣,泰國,越南,大陸”
},
{
“value”: “現金”,
“field_name”: “f3ff8db69be2234759fe662b3fbbedc5”,
“field_title”: “付款方式”,
“field_position”: “63”,
“field_type”: “select”,
“field_id”: “99”,
“field_pos”: “63”,
“field_values”: “現金,line pay,藍新,轉帳,TWQR”
},
{
“value”: “”,
“field_name”: “8ec4d524f9e54d12a088551b5b2c6d58”,
“field_title”: “付款方式金額”,
“field_position”: “67”,
“field_type”: “digits”,
“field_id”: “100”,
“field_pos”: “67”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “7481953881dcc0c3d281213f46c81b66”,
“field_title”: “額外付款方式”,
“field_position”: “72”,
“field_type”: “select”,
“field_id”: “117”,
“field_pos”: “72”,
“field_values”: “現金,line pay,藍新,轉帳,TWQR”
},
{
“value”: “”,
“field_name”: “7cffd299c141f5c3e8e34cdef01bcc90”,
“field_title”: “額外付款方式金額”,
“field_position”: “78”,
“field_type”: “digits”,
“field_id”: “118”,
“field_pos”: “78”,
“field_values”: null
},
{
“value”: “不用卷”,
“field_name”: “a71830558a1c356be06eb20172527024”,
“field_title”: “是否用卷”,
“field_position”: “327”,
“field_type”: “select”,
“field_id”: “101”,
“field_pos”: “327”,
“field_values”: “用卷,不用卷”
},
{
“value”: “”,
“field_name”: “42f20d0a030f4f8fbf62c2caea9d266b”,
“field_title”: “(泰和村)用卷輸入”,
“field_position”: “328”,
“field_type”: “select”,
“field_id”: “102”,
“field_pos”: “328”,
“field_values”: “1100,1200,1300,1388,1500,1600”
},
{
“value”: “”,
“field_name”: “9a17454f0246fdf6fba8239249ed0656”,
“field_title”: “(泰和村)卷號輸入”,
“field_position”: “335”,
“field_type”: “digits”,
“field_id”: “103”,
“field_pos”: “335”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “1a2936c72b87b881dc769dbf328dc5ee”,
“field_title”: “備註”,
“field_position”: “382”,
“field_type”: “text”,
“field_id”: “6”,
“field_pos”: “382”,
“field_values”: null
},
{
“value”: “”,
“field_name”: “89d3ad08ef9e86cd0fda0daa6f1aed29”,
“field_title”: “支出”,
“field_position”: “383”,
“field_type”: “digits”,
“field_id”: “91”,
“field_pos”: “383”,
“field_values”: null
},
{
“value”: “泰和村”,
“field_name”: “343d37b1594945ad851e7d947ef7902e”,
“field_title”: “泰和村”,
“field_position”: “384”,
“field_type”: “select”,
“field_id”: “112”,
“field_pos”: “384”,
“field_values”: “泰和村”
}
],
“status”: {
“id”: “6”,
“name”: “代付款”,
“description”: “”,
“color”: “fac94e”,
“is_default”: “1”
},
“comments”: ,
“history”: [
{
“id”: “205683”,
“sheduler_id”: “75368”,
“datetime”: “2025-02-21 23:22:52”,
“type”: “create”,
“user_id”: “1”,
“agent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15”,
“ip”: “211.76.58.170, 211.76.58.170:127.0.0.1”,
“referer”: “https://taihevillage.secure.simplybook.asia/”,
“login”: “zas125314055”,
“firstname”: “泰和村”,
“lastname”: “”
}
],
“location”: null,
“price”: ,
“promo”: ,
“client_membership_id”: null,
“membership_name”: null,
“membership_rest”: null,
“membership_limit”: null,
“membership_period_start”: null,
“membership_period_end”: null,
“event_category”: {
“id”: “88”,
“name”: “泰和村2H”,
“description”: “”,
“is_default”: “0”,
“position”: “45”,
“file_id”: null,
“seo_url”: null,
“is_visible”: “0”
},
“invoice”: null,
“paid_attributes”: ,
“products”: ,
“is_google_maps_booking”: false
}
],
“level”: “log”,
“timestamp”: 1740151378136
},
{
“message”: [
“預約詳情已保存到數據庫”
],
“level”: “log”,
“timestamp”: 1740151378280
}
],
“eventTimestamp”: 1740151375244,
“event”: {
“request”: {
“url”: “https://taihevllageauto.zas125314055.workers.dev/”,
“method”: “POST”,
“headers”: {
“accept-encoding”: “gzip, br”,
“cf-connecting-ip”: “2402:1f00:8001:2194::”,
“cf-ipcountry”: “SG”,
“cf-ray”: “9157bc0f3da6f93b”,
“cf-visitor”: “{"scheme":"https"}”,
“connection”: “Keep-Alive”,
“content-length”: “183”,
“content-type”: “application/json”,
“host”: “taihevllageauto.zas125314055.workers.dev”,
“user-agent”: “simplybook.me API”,
“x-forwarded-proto”: “https”,
“x-real-ip”: “2402:1f00:8001:2194::”,
“x-signature”: “ace8c385154ee68a12460f5e3d1108fc6a2c7080afdb2c3cefcee16a5490c7ad”
},
“cf”: {
“clientTcpRtt”: 1,
“requestHeaderNames”: {},
“httpProtocol”: “HTTP/1.1”,
“tlsCipher”: “AEAD-AES256-GCM-SHA384”,
“continent”: “AS”,
“asn”: 16276,
“clientAcceptEncoding”: “gzip, deflate”,
“country”: “SG”,
“verifiedBotCategory”: “”,
“tlsClientAuth”: {
“certIssuerDNLegacy”: “”,
“certIssuerSKI”: “”,
“certSubjectDNRFC2253”: “”,
“certSubjectDNLegacy”: “”,
“certFingerprintSHA256”: “”,
“certNotBefore”: “”,
“certSKI”: “”,
“certSerial”: “”,
“certIssuerDN”: “”,
“certVerified”: “NONE”,
“certNotAfter”: “”,
“certSubjectDN”: “”,
“certPresented”: “0”,
“certRevoked”: “0”,
“certIssuerSerial”: “”,
“certIssuerDNRFC2253”: “”,
“certFingerprintSHA1”: “”
},
“tlsClientExtensionsSha1”: “cZTfz0G33jxhytWCjEfVzVcI6Z8=”,
“tlsExportedAuthenticator”: {
“clientFinished”: “3535d969e657cbc336966367dedc80745c364498f23f660aeabfd42634127eafc2a64a1643ada34712a61d01684c7e13”,
“clientHandshake”: “f4396faadb515969b33369277d2748a0e09463c73581164f737d4f7d274425ed72c9e3d3165c9db2181dbd21c490ef46”,
“serverHandshake”: “174b9ac98216084eac7be1b40927dabcff833ed7931fdcf1441d359d2d55073d8bbd267cc4cc0fe0eeb3681203a02685”,
“serverFinished”: “6c96a8313f5d59ea04464d230fdbb29d145bbebec31f6b6121f5bd2e6fad85f02134a3821a2d4c40743251fe3878ba46”
},
“tlsVersion”: “TLSv1.3”,
“city”: “Singapore”,
“timezone”: “Asia/Singapore”,
“requestPriority”: “”,
“edgeRequestKeepAliveStatus”: 1,
“tlsClientRandom”: “ByulAI6C4ygA6k59OZj+0qCnnTS97hfZq79SAyUc2zw=”,
“longitude”: “103.84680”,
“latitude”: “1.27670”,
“postalCode”: “06”,
“asOrganization”: “OVHcloud”,
“tlsClientHelloLength”: “508”,
“colo”: “SIN”
}
},
“response”: {
“status”: 200
}
},
“id”: 1
}

This is the log of the successful getBookingDetails api. Sometimes it fails.

Redmine Admin wrote:

hi, i’m not sure what is this. Please provide just one API request to our API which gives you error. We need raw http request and response for a one API request. We never ask for company password. Company login is needed