工作原理
- 客户在您的界面里说明需要驶入。您先确认两点:道闸能用他的号码打电话开启,且他的手机保持在线。若道闸装了 Entrixy 控制器,则完全不需要手机。
- 您创建一次请求并展示它的二维码。客户扫码、安装应用、添加道闸并授予权限——您的公司已经在列表里等着。
- 您通过 API 开启并注明是哪位员工。客户在日志里看到带该姓名的开启记录,随时一点即可收回权限。
认证
There are two ways in, and the difference is what the client sees.
Signature bound to your domain
You publish a public key on your own domain and sign every call with the private one. We take the key from the domain itself, so the right to call and the right to be shown under that domain are the same thing: the file disappears, the domain moves or changes hands — the calls stop within a day. There is no one-off "verified" tick to outlive reality.
https://<your domain>/.well-known/entrixy.json
{ "key": "<Ed25519 public key, 32 bytes, base64>" }
Then each request carries four headers:
X-Entrixy-Org: your-domain.com X-Entrixy-Ts: 1750000000 // unix seconds, ±300 s X-Entrixy-Nonce: 0011…ff // 32 hex, used once X-Entrixy-Sig: <base64> // Ed25519 over the base string base = "<domain>.<ts>.<nonce>." + sha256(raw request body)
A repeated nonce is refused, and so is a body that does not match the signature. This is the mode where the client sees your domain and your logo.
A domain written in national characters goes into the header and into the base string in its punycode form — xn--… — the same form it takes in the address of the key file. The client is still shown the readable spelling.
A secret, if you have no domain
Register, issue a secret in the cabinet and put it in the body. Your calls work the same, but the client is shown only the name you wrote for yourself, with a note that the domain is not confirmed — no logo, no domain. A company that has set a domain can no longer use a secret: otherwise a leaked secret would speak in the name of a confirmed one.
POST https://entrixy.com/api/company.php?a=<action>
Content-Type: application/json
{ "org_id": 17, "secret": "…", … }
创建请求
POST /api/company.php?a=request
{ "org_id": 17, "secret": "…", "ref": "order-517", "ttl_hours": 72 }
→ { "code": "rrGzNweV31rkHV6Q",
"url": "https://entrixy.com/c/rrGzNweV31rkHV6Q",
"expires_in_hours": 72 }
ref 是您自己的订单号,会在状态里回传。请把 url 放进二维码展示给客户。
请求状态
POST /api/company.php?a=status
{ "org_id": 17, "secret": "…", "code": "rrGzNweV31rkHV6Q" }
→ { "state": "issued", "key_ref": 4821, "ref": "order-517",
"claimed_at": "2026-09-09 12:20:11", "issued_at": "2026-09-09 12:24:03" }
| 状态 | Meaning |
|---|---|
new | 二维码已创建,客户尚未到来 |
claimed | 客户已打开应用——正在进行中 |
issued | 权限已授予; key_ref 用它来开启 |
revoked | 客户收回了权限 |
expired | 客户到来之前请求已过期 |
开启
POST /api/company.php?a=open
{ "org_id": 17, "secret": "…", "key_ref": 4821,
"number_id": 93, "actor": "Ivan P., shift 12" }
→ { "ok": 1 }
actor 是必填项:客户在日志里看到的就是它。凡是能在您那边认出员工的都行——姓名、工号、班次。不填则调用被拒。
| 响应 | Meaning |
|---|---|
403 forbidden | 这把钥匙不属于您,或其中没有该对象 |
403 revoked | 客户收回了权限 |
403 expired | 钥匙的有效期已结束 |
400 actor_required | 未注明员工 |
429 rate_limit | 同一把钥匙每分钟开启次数过多 |
您在应用中的名片
注册公司时把名称和方形标志发给我们。客户会在扫码打开的页面、授权确认页以及日志的每一行旁看到它们——一眼就知道放谁进来。标志由我们自己提供,不从其他服务器加载图片。
快速上手
在您的账户里注册公司:先提交申请,随后密钥、回调地址、标志和请求列表都在公司后台。申请由人工审核——客户信任的是被我们放进列表的公司。