Skip to content

Interacting with CampCard readers

A CampCard reader represents a device which can read and write Cynox Camp-Card cards. Typically, a card can be applied or removed at any time.
A reader device is usually interacted with by the staff at the reception using a PMS, where cards and guests are managed.

Querying CampCard readers

Use the campCardReaders connection to get all readers:

query campCardReaders {
campCardReaders {
edges {
node {
id
label
latestReport {
id cardId cardPresent cardData {
credits language privileges validityEnd validityStart
}
}
}
}
}
}

You can provide the filters parameter to filter the readers by campsite or external ID.

The latestReport property provides the latest data reported by the device, such as whether a card is present or not. You can use Webhooks or GraphQL Subscriptions to get notified about when this changes.

Note: This type of device is normally dedicated to a specific location or use case. It can be assumed, that the unique external ID does not change, even if a physical device needs to be replaced at some point. The IDs related to the location and intended use case of the devices can be provided by Cynox upon request. For convenience, API users could provide means to allow configuration by manually assigning devices from a list of available device instead.

Writing a card

To write new data to the card currently on the reader, use

mutation writeCard($readerId: GlobalID!, $data: CampCardDataInput!) {
campCardReaderWriteCard(readerId: $readerId, data: $data) {
__typename
...on CampCardReaderWriteCommand {
id
executionState
}
...on OperationInfo {
messages {
kind, message
}
}
}
}

You will receive either a CampCardReaderWriteCommand to indicate a successful request or a list of messages indicating any errors:

{
"campCardReaderWriteCard": {
"__typename": "CampCardReaderWriteCommand",
"executionState": "CONFIRMED"
}
}

In the same way you can use campCardReaderFormatCard to format a card, i.e. completely erase it.