Skip to content

Querying Bookings

This guide covers how to retrieve booking data from Mobiledock using both the GraphQL and REST APIs.

Before proceeding, follow the Integration Setup guide.

In Mobiledock, a booking represents a scheduled visit to a Mobiledock-controlled site. Each booking contains one or more tasks — individual line items describing what is being delivered or collected, including direction, sender, receiver, document reference, and load quantities.

APIBest for
GraphQL (bookings / bookingsV2)Flexible queries — select exactly the fields you need, filter by many criteria
REST (POST /api/v2/bookings)Structured exports using pre-configured layouts, CSV or JSON output
  • Your organisation must have API access
  • You have created an API token with the BookingObservation permission
  • You have a working Mobiledock configuration that includes bookings

All GraphQL requests are POST requests to /api/v1/graphql.

The primary operation for retrieving bookings is bookingsV2. It accepts the following arguments:

ArgumentTypeDefaultDescription
filterBookingsFilterInputV2nullFilter criteria
startInt0Pagination offset
countInt50Number of results (max 1000)
orderingBookingOrderingTimeSort field: Time, Created, or Modified
ascendingBooleantrueSort direction
query GetBookings {
bookingsV2(
count: 500
start: 0
filter: {
location: { id: { eq: "990090c9-7506-487b-9872-c4e65557ae75" } }
area: { name: { in: ["West Docks", "South Docks"] } }
}
) {
results
bookings {
id
bookingType
createdAt
modifiedAt
requestedTime
bookedTime
duration
carrier { name }
space { name }
area { name }
location { name }
vehicle { name size }
status { name }
tasks {
id
direction
document { id type { name } }
senderCore { name }
receiver { name }
loads { load { name } quantity loadTag }
}
}
}
}

The filter property is the most powerful parameter. All filter properties are optional and can be combined freely.

FilterDescriptionType
activeTimeFilter by scheduled start/end windowComparison
areaFilter by area name or IDEntityRefComparisonInput
bookingOptionFilter by booking optionEntityRefComparisonInput
carrierFilter by carrier name or IDEntityRefComparisonInput
createdTimeFilter by creation datetimeComparison
documentFilter by document name or IDEntityRefComparisonInput
directionFilter by directionComparison
documentStatusFilter by document statusEntityRefComparisonInput
documentTypeFilter by document typeEntityRefComparisonInput
fieldValueFilter by custom field values[FieldValueFilterInput!]
groupFilter by booking groupsEntityRefComparisonInput
loadQuantityFilter by load quantities[LoadQuantityFilterInput!]
loadTagFilter by load tagsComparison
locationFilter by location name or IDEntityRefComparisonInput
modifiedTimeFilter by last modified datetimeComparison
occupantFilter by occupant name or IDEntityRefComparisonInput
offsiteFilter by offsite name or IDEntityRefComparisonInput
participantFilter by participant name or IDEntityRefComparisonInput
spaceFilter by space name or IDEntityRefComparisonInput
statusFilter by status name or IDEntityRefComparisonInput
vehicleFilter by vehicle name or IDEntityRefComparisonInput

The Comparison object supports:

OperatorDescription
eqEqual to
neqNot equal to
gtGreater than
gteGreater than or equal
ltLess than
lteLess than or equal
inIncluded in a list
ninNot included in a list
matchContains pattern (like operator)

For exporting large datasets in a structured format using pre-configured layouts, use the REST bookings export endpoint. See the REST Bookings Export reference for the full endpoint specification, parameters, and examples.

If you have further questions, contact assistance@mobiledock.com.