Bind a device via API
Bind a device via API
A camera must be bound to the developer account before OpenAPI can see it. Consumer-app-only devices are invisible. Overview: Integrate a camera.
Prerequisites and security code
You need AppId / AppSecret, an administrator accessToken, and the device serial number.
code on bindDevice is the device verification value:
- Device has an auth capability set: send the password set after device init.
- No auth set, but the label or QR code has a 6-digit security code: send those six digits.
- No auth set and no 6-digit code: send
codeempty.
Optional encryptCode uses the AES rule on that page. If both are sent, code wins.
bindDevice
POST https://openapi-[DataCenter].easy4ip.com/openapi/bindDevice
Required: token, deviceId, code. Success is result.code "0" with no data. Page: bindDevice.
SDK provisioning or new firmware
A new device, or a device that just upgraded, may not finish through HTTP bindDevice alone. Use the client SDK and the demo. See Build a mobile app and SDK first preview. Probe first with Pre-bind information (device.prebind.get).
Verify with the main device query
Call Paged device detail (device.detail.page) or Bind state (device.bindstate.get). Do not use the old checkDeviceBindOrNot / listDeviceDetailsByPage for new work; they are explicitly replaced. See Legacy APIs.
Bind errors such as DV1001 (bound to another account), DV1003 / DV1029 (already bound), DV1005 (verification code): bindDevice and Return codes.
Unbind
unBindDevice removes the device from this account. After unbind, OpenAPI list calls no longer return it.
