Hello,
I’ve been looking to start a bridge without using the NFC card or the QR code. I’ve been looking to hit the /switch-on api route but I have noticed that this is impossible without a nonce. From what I’ve seen there isn’t much information about the nonce, how to create one, or how it’s used out there. I have also seen that you can send a static code here: https://forum.fabman.io/t/how-to-call-resource-bridge-switchon-and-qr/469/2 . However, I do not see any information about what the “static code” is or what it is. Does anyone know if I’m going about this the right way?
We are looking to integrate turning the bridge on and off with using just a web app, but have not actually been able to switch on the bridge remotely. The QR code and NFC cards currently work, but this will not work with our setup.
I’m looking for any information and anything helps !
Thanks in advance!
Hey @FabmanAPIUser,
the POST /resources/{id}/bridge/switch-on
endpoint does allow admins to switch on equipment without a nonce (and POST /resources/{id}/bridge/switch-off
allows admins to switch off equipment.)
Non-admins are not allowed to switch equipment on or off remotely. The nonce is part of the QR code you scan and ensures that you’re actually in front of the machine.
The article you mentioned was for developing your own bridges, which is a much more complicated endeavor.
I’ve been trying to do the same thing with an admin account. I get 201s back that say "state": "pending","type":"activate"
but nothing happens on the bridge and when I poll the bridge it has "inUse": false
Is this expected behavior?
Thank you for the help!
My team has been using an api-key from this page: https://fabman.io/manage/{id}/configuration/integrations impersonating the account owner.
However as far as we can see in the activity log the machine was not activated. I do not see anything really change on the bridge after the API has been hit. The api returns the following:
{
"id": {id},
"account": {account},
"resource": {resource},
"state": "pending",
"type": "activate",
"validUntil": "2025-04-30T17:26:01.000Z",
"member": {member},
"error": null,
"createdAt": "2025-04-30T17:24:01.416Z",
"updatedAt": "2025-04-30T17:24:01.416Z",
"result": null,
"message": null,
"successMessage": null,
"authorizedMember": null
}
I would think that the machine would turn on and leave activity in the activity log, but the physical bridge does not seem like it is active at all
Also for context I am sending an empty body
@raphael can you clarify if what we are seeing expected behavior?
Can you guys give me more details? What’s the firmware version on your bridge? (You can see that if you re-enter the bridge’s setup mode. Or you can send me your bridge ID and I can look it up.)
Because I just tried the following and it worked:
- Pair a bridge to any equipment. (In my case it was equipment ID 436.)
POST https://fabman.io/api/v1/resources/<id>/bridge/switch-on
with the body {}
. I’ve used the Fabman Live API documentation page for that:
- The bridge switched on immediately and showed my name on the display.
If you still cannot reproduce this, send me all details as a DM or to support@fabman.io and I’ll take a closer look.
The problem was that the firmware on some bridges was too old to be aware of the “switch on without nonce” remote command. It was introduced in firmware version 5.10
, which had not yet been applied to all bridges.
I’ve now scheduled the update to 5.11.1
for all current machines. Please DM me or send a message to support@fabman.io if you still have a bridge with an older firmware that does not automatically update.