BasicPSF
PPS API Documentation
v1
GET

Push Booking Results — Batch

/fmi/data/vLatest/databases/{db}/layouts/QC_Booking/script/CLIV%20Booking%20Results%20Batch?script.param={encoded_payload}

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.

🧪
UAT Environment

Use this environment for integration testing. Test record references will be provided by the PPS integration team.

PropertyValue
Base URLhttps://pps.basicpsf.com
DatabaseBasicPSF_Test
Full endpointhttps://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_Test/layouts/QC_Booking/script/CLIV%20Booking%20Results%20Batch
⚠️
Production Environment

Do not use for testing. All writes affect live PPS operational data. Separate production credentials are required.

PropertyValue
Base URLhttps://pps.basicpsf.com
DatabaseBasicPSF_PPS
Full endpointhttps://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.

💡
No minimum batch size

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.

PropertyValue
MethodSession token (Bearer)
Token lifetime15 minutes inactivity
HeaderAuthorization: Bearer {session_token}

Endpoint

PropertyValue
MethodGET
Script nameCLIV Booking Results Batch
Layout contextQC_Booking
Script parameterJSON string passed as URL query parameter script.param
SessionMust be closed with DELETE to /sessions/{token} immediately after the call
ℹ️
How BasicPSF processes the request

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

HTTP
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
⚠️
URL-encode the script.param value

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

FieldTypeRequiredDescription
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:

StepAction
1Receive the GET request. FM extracts script.param from the URL query string.
2Loop through each result object.
3Find the QC_Booking record where internalOrderReference matches internalOrderRef.
4Validate that bookingResult is "Booked" or "Unavailable".
5Write CLIV_Booking_Result, bookingDate, and InspectorName to the record.
6BasicPSF auto-stamps CLIV_Booking_Confirmed_At on commit.
7Log the result (success or error reason) for that item.
8Continue to the next item regardless of individual errors.
9Return a summary of all results when the loop completes.
💡
Partial success

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.

200
Script executed

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.

401
Unauthorized

Session token invalid or expired. Re-authenticate and retry.

404 (FM 105)
Script not found

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.

400
Bad request

Malformed request body or missing script.param field.

scriptResult structure

Response body
{
  "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" }]
}
ℹ️
scriptResult is a JSON string

BasicPSF returns scriptResult as a string. Parse it as JSON after extracting it from the response to access the structured result data.

⚠️
Always close the session after the GET

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

HTTP
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

HTTP
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

HTTP
DELETE https://pps.basicpsf.com/fmi/data/vLatest/databases/BasicPSF_Test/sessions/{session_token}
Authorization: Bearer {session_token}

Successful response

Response · 200 OK
{
  "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 · 200 OK (with failures)
{
  "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" }]
}
⚠️
Always parse scriptResult

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.