ssm.ro Docs
API for Developers

RFID Cards

Endpoint for creating or updating the RFID card code of a contact (employee) in the ssm.ro platform.

The RFID cards endpoint sets the access card code for an existing contact, identified by marca. The operation is an upsert: if the contact does not have an RFID card yet, one is created; if it already has one, the existing code is replaced with the one sent.

This operation requires the RFID Card Access app to be enabled for the organization.


Create or update RFID card

POST /v1/contacts/rfid

Sets the RFID card code for an existing contact, identified by marca:

  • if the contact has no RFID card, one is created with the code sent;
  • if the contact already has an RFID card, its code is updated with the value sent.

What this operation does NOT change

The call affects only the RFID code. It does not change:

  • the card status (active / inactive);
  • the locked status resulting from too many failed attempts;
  • the PIN associated with the card.

These operations are performed from the dashboard, in the RFID Card Access app.

Parameters

ParameterInTypeRequiredDescription
organizatiebodystringYesThe organization's subdomain (e.g., demo-organization)
marcabodystringYesThe employee ID of the contact the card is being associated with
codRFIDbodystringYesThe RFID card code

Example request

{
  "organizatie": "demo-organization",
  "marca": "M00212",
  "codRFID": "0006627031"
}

Response

On success, the endpoint returns 204 No Content (no body). On error, the response is a JSON object of the form:

{
  "error": "Contactul cu marca M00212 nu a fost gasit"
}
CodeDescription
204 No ContentThe RFID code was created or updated for the contact (and, if needed, the local account was created)
400 Bad RequestThe organization is not set or is invalid
401 UnauthorizedMissing or invalid authentication token
404 Not FoundThis API version is not available on the client's installation (endpoint does not exist)
422 Unprocessable EntityValidation error — see the message in the response
500 Server ErrorInternal server error

Availability on older installations

This feature is only available starting with the version that includes the /v1/contacts/rfid endpoint. On older installations, the route does not exist and the server responds with 404 Not Found — a sign that this API version is not available on that installation. In this case, the response body may be HTML/text (not the usual JSON object), so check the HTTP status code (404), not the response content.

Possible messages for 422 Unprocessable Entity

MessageCause
Lipsa cod RFIDThe codRFID parameter is missing or empty
Contactul cu marca {marca} nu a fost gasitNo contact exists with the given marca
Aplicatia RFID nu este activataThe RFID Card Access app is not enabled for the organization
Contul nu este de tip localThe contact already has a real (non-local) account connected
Contactul are rol de utilizator!The contact has a user role