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.

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.