Skip to content
Last updated

RFID Assignment

This guide explains how to manage RFID assignments for members using the MMS API V2.

Introduction

RFIDs (Radio Frequency Identification) are used by members to access the gym (turnstiles), lock/unlock lockers, and log in to EGYM machines. Assigning an RFID to a member's account is a crucial step in the onboarding process.

Workflow

The typical workflow for managing RFIDs is:

  1. Assign an RFID to a member.
  2. List RFIDs to see what is currently assigned.
  3. Find a member by scanning an RFID.
  4. Remove an RFID if it's lost or replaced.

1. Assign RFID

You can assign an RFID to a member using the POST endpoint. This adds the RFID to the member's list of credentials.

curl -i -X POST \
  'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/rfids' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "rfid": "0x12345678",
    "type": "Mifare"
  }'

Note:

  • The rfid value should be a hex string starting with 0x.
  • If you want to replace all RFIDs for a user (e.g., if they lost their card and got a new one), use the PUT endpoint (updateUsersRfids) instead.
  • If you pass RFID that already belongs to other member it will be automatically reassigned to target member

2. List RFIDs

To retrieve all RFIDs assigned to a member, use the GET endpoint.

curl -i -X GET \
  'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/rfids?allSources=false' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

3. Find Member by RFID

If a member scans their RFID at a terminal, you can identify them using the GET endpoint with the RFID value.

curl -i -X GET \
  'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/rfid/{rfid}?tagFormat=HITAG1' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

4. Remove RFID

To remove a specific RFID from a member's account (e.g., if it was lost), use the DELETE endpoint.

curl -i -X DELETE \
  'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/rfids/{rfid}?tagFormat=HITAG1' \
  -H 'x-api-key: YOUR_API_KEY_HERE'