Push Booking Results — Batch
Push multiple QC booking results to BasicPSF in a single authenticated call. CLIV sends a JSON array of results and BasicPSF processes each one internally — finding the matching record and writing the result — without requiring a separate API call per booking.
Use this environment for integration testing. Test record references will be provided by the PPS integration team.
| Property | Value |
|---|---|
| Base URL | https://pps.basicpsf.com |
| Database | BasicPSF_Test |
| Full endpoint | https://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_Test/layouts/QC_Booking/script/CLIV%20Booking%20Results%20Batch |
Do not use for testing. All writes affect live PPS operational data. Separate production credentials are required.
| Property | Value |
|---|---|
| Base URL | https://pps.basicpsf.com |
| Database | BasicPSF_PPS |
| Full endpoint | https://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_PPS/layouts/QC_Booking/script/CLIV%20Booking%20Results%20Batch |
Overview
This endpoint uses the BasicPSF API to invoke a script directly via a GET request. CLIV sends the JSON payload as a URL-encoded script.param query parameter. BasicPSF receives the array, loops through each result, finds the matching QC_Booking record by internalOrderRef, and writes the result fields.
The response includes a per-result summary so CLIV can identify any records that could not be matched or contained invalid data.
When to use
Single endpoint (PATCH)
Use when confirming one booking in real time, immediately after it is processed. Lower complexity, easier to debug individual results.
Batch endpoint (this page)
Use when pushing a queue of results together — end-of-day jobs, scheduled syncs, or any scenario where multiple bookings have been processed together. One authentication, one call.
The batch endpoint accepts arrays of any size including a single item. However for single real-time confirmations the single PATCH endpoint is recommended for simplicity.
Authentication
Authentication is identical to the single endpoint. Obtain a session token via the sessions endpoint and pass it as a Bearer token. See the Authentication section on the index page for full details.
| Property | Value |
|---|---|
| Method | Session token (Bearer) |
| Token lifetime | 15 minutes inactivity |
| Header | Authorization: Bearer {session_token} |
Endpoint
| Property | Value |
|---|---|
| Method | GET |
| Script name | CLIV Booking Results Batch |
| Layout context | QC_Booking |
| Script parameter | JSON string passed as URL query parameter script.param |
| Session | Must be closed with DELETE to /sessions/{token} immediately after the call |
The BasicPSF API script endpoint executes a named script via a GET request and returns its result in scriptResult. The payload is URL-encoded and passed as the script.param query parameter. BasicPSF handles all record matching and writing internally — no per-record API calls are needed from CLIV.
Payload
The payload is passed as a URL query parameter named script.param. The value must be a JSON string containing the array of booking results. URL-encode the entire value before appending to the URL.
Request structure
GET /fmi/data/vLatest/databases/{db}/layouts/QC_Booking/script/CLIV%20Booking%20Results%20Batch
?script.param=%7B%22bookingResults%22%3A%5B...%5D%7D
Authorization: Bearer {session_token}
// No request body — payload is in the URL query parameter only
The script.param query parameter value must be URL-encoded before appending to the request URL. Most HTTP client libraries handle this automatically when you set query parameters via their params/query interface rather than building the URL manually.
Booking result object fields
| Field | Type | Required | Description |
|---|---|---|---|
internalOrderRef |
String | Required | The PPS internal order reference. Used to find the matching QC_Booking record. |
bookingResult |
String | Required | Must be exactly "Booked" or "Unavailable". Case sensitive. |
bookingDate |
Date | Conditional | Required when bookingResult is "Booked". Send as empty string when Unavailable. Format: YYYY-MM-DD |
inspectorName |
String | Conditional | Required when bookingResult is "Booked". Full name of the assigned inspector. Send as empty string when Unavailable. |
Processing
BasicPSF processes each result in the array sequentially. For each item:
| Step | Action |
|---|---|
| 1 | Receive the GET request. FM extracts script.param from the URL query string. |
| 2 | Loop through each result object. |
| 3 | Find the QC_Booking record where internalOrderReference matches internalOrderRef. |
| 4 | Validate that bookingResult is "Booked" or "Unavailable". |
| 5 | Write CLIV_Booking_Result, bookingDate, and InspectorName to the record. |
| 6 | BasicPSF auto-stamps CLIV_Booking_Confirmed_At on commit. |
| 7 | Log the result (success or error reason) for that item. |
| 8 | Continue to the next item regardless of individual errors. |
| 9 | Return a summary of all results when the loop completes. |
If one record in the batch cannot be matched or has an invalid value, processing continues for the remaining items. The response will identify which items succeeded and which failed. CLIV should check the response summary and retry failed items.
Responses
BasicPSF returns a JSON result via scriptResult in the response body. The HTTP status reflects whether the script executed — not whether all individual records succeeded.
The script ran to completion. Check scriptResult in the response body for per-record outcomes. Some records may have failed even with a 200 response.
Session token invalid or expired. Re-authenticate and retry.
The script name in the URL does not match. Verify the name is exactly CLIV Booking Results Batch and URL-encoded as CLIV%20Booking%20Results%20Batch.
Malformed request body or missing script.param field.
scriptResult structure
{
"response": {
"scriptResult": "{
\"processed\": 3,
\"succeeded\": 2,
\"failed\": 1,
\"results\": [
{ \"internalOrderRef\": \"ORD-001\", \"status\": \"OK\" },
{ \"internalOrderRef\": \"ORD-002\", \"status\": \"OK\" },
{ \"internalOrderRef\": \"ORD-999\", \"status\": \"Error\",
\"error\": \"Record not found\" }
]
}"
},
"messages": [{ "code": "0", "message": "OK" }]
}
BasicPSF returns scriptResult as a string. Parse it as JSON after extracting it from the response to access the structured result data.
The GET request does not automatically close the FM session. CLIV must send a DELETE to /fmi/data/vLatest/databases/{db}/sessions/{token} immediately after receiving the response. Failing to do this will leave idle sessions open on FM Server until the 15-minute inactivity timeout.
Full Examples
Step 1 — Authenticate
POST https://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_Test/sessions
Authorization: Basic <base64(username:password)>
Content-Type: application/json
{}
Step 2 — GET script endpoint with payload
GET https://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_Test/layouts/QC_Booking/script/CLIV%20Booking%20Results%20Batch
?script.param=%7B%22bookingResults%22%3A%5B%7B%22internalOrderRef%22%3A%22ORD-2025-00123%22%2C%22bookingResult%22%3A%22Booked%22%2C%22bookingDate%22%3A%2204%2F28%2F2025%22%2C%22inspectorName%22%3A%22Zhang%20Wei%22%7D%5D%7D
Authorization: Bearer {session_token}
// Decoded script.param value for readability:
// {"bookingResults":[
// {"internalOrderRef":"ORD-2025-00123","bookingResult":"Booked",
// "bookingDate":"2025-04-28","inspectorName":"Zhang Wei"},
// {"internalOrderRef":"ORD-2025-00124","bookingResult":"Booked",
// "bookingDate":"2025-04-29","inspectorName":"Li Fang"},
// {"internalOrderRef":"ORD-2025-00125","bookingResult":"Unavailable",
// "bookingDate":"","inspectorName":""}
// ]}
Step 3 — Close the session
DELETE https://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_Test/sessions/{session_token}
Authorization: Bearer {session_token}
Successful response
{
"response": {
"scriptResult": "{\"processed\":3,\"succeeded\":3,\"failed\":0,\"results\":[{\"internalOrderRef\":\"ORD-2025-00123\",\"status\":\"OK\"},{\"internalOrderRef\":\"ORD-2025-00124\",\"status\":\"OK\"},{\"internalOrderRef\":\"ORD-2025-00125\",\"status\":\"OK\"}]}"
},
"messages": [{ "code": "0", "message": "OK" }]
}
Partial failure response
{
"response": {
"scriptResult": "{\"processed\":3,\"succeeded\":2,\"failed\":1,\"results\":[{\"internalOrderRef\":\"ORD-2025-00123\",\"status\":\"OK\"},{\"internalOrderRef\":\"ORD-2025-00124\",\"status\":\"OK\"},{\"internalOrderRef\":\"ORD-2025-00999\",\"status\":\"Error\",\"error\":\"Record not found\"}]}"
},
"messages": [{ "code": "0", "message": "OK" }]
}
A 200 HTTP response only means the script executed. CLIV must always parse scriptResult and check failed count. Any failed items should be logged and retried or escalated to the PPS integration team.