REST: Bookings Export
The bookings export endpoint allows you to export bookings based on specific criteria and a pre-configured data structure (layout).
Endpoint
Section titled “Endpoint”POST /api/v2/bookingsQuery parameters
Section titled “Query parameters”| Parameter | Type | Description |
|---|---|---|
skip | number | Number of records to skip from the beginning |
count | number | Maximum number of records to return (max 1000) |
Request body
Section titled “Request body”| Property | Type | Description |
|---|---|---|
layoutId | string | UUID of the layout configured in the Mobiledock UI. Determines output columns and their order |
filter | object | Filter criteria (see Querying Bookings) |
format | string | Output format: json or csv |
viewAs | string | Data type: bookings or tasks |
Example
Section titled “Example”curl -X POST "https://my.mobiledock.com/api/v2/bookings?skip=0&count=100" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "layoutId": "00000000-0000-0000-0000-000000000000", "filter": { "location": { "name": { "eq": "Example DC" } } }, "format": "json", "viewAs": "bookings" }'const response = await fetch( 'https://my.mobiledock.com/api/v2/bookings?skip=0&count=100', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ layoutId: '00000000-0000-0000-0000-000000000000', filter: { location: { name: { eq: 'Example DC' } }, }, format: 'json', viewAs: 'bookings', }), });
const { data } = await response.json();Response
Section titled “Response”The response is a JSON object with a data array. Each object represents a single booking. The keys correspond to the column names defined in the layout.
{ "data": [ { "ID": "MDB-25-BBPD-959B", "PIN": "44918", "POs": "PO-0010, PO-0020, PO-0030", "Receivers": "Example DC", "Senders": "SUPPLIER A, SUPPLIER B", "Pallets": 100, "Cartons": 1000, "Status": "Completed", "Scheduled": "15/05/2025 16:00:00", "Carrier": "Example Carrier", "Direction": "Inbound", "Space": "Bay 03" } ]}