Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
  • Device capabilities & events
  • API reference
    • Public conventions
    • Development specification
    • accessToken: Get administrator token
    • API request example
    • Error codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • AI analysis
    • AI Insight
      • bindDeviceAiInsight: Enable AI Insight package
      • unbindDeviceAiInsight: Unbind AI Insight package
      • queryDeviceAiInsight: Query active AI Insight package
      • queryDeviceAiInsightList: List AI Insight packages on channel
      • queryAiInsightCount: Query AI Insight purchase quota
      • queryUnusedAiInsightList: List unused AI Insight packages
      • setDeviceAiInsightSwitch: Set AI Insight service switch
      • activateDeviceAiInsight: Activate queued AI Insight package
      • setDeviceAiLanguage: Set channel AI language
      • addAiInsightFeature: Add face library member
      • updateAiInsightFeature: Update face library member
      • addAiInsightFaceImages: Append face registration images
      • deleteAiInsightFaceImages: Delete face registration images
      • listAiInsightFeature: List registered face members
      • deleteAiInsightFeature: Delete face members
      • listAiInsightUnknownFace: List unknown face clusters
      • deleteAiInsightUnknownFace: Delete unknown face images
      • queryCondensedRecordBitmap: Query AI Insight highlight calendar mask
      • getCondensedRecords: Query AI Insight highlight clips
      • searchAiAlarmMessageByPage: Search alarm messages by keyword
      • getAlarmMessageStatistics: Daily alarm statistics and safety report
      • reportAiMsgFeedback: Submit AI smart-alarm accuracy feedback
    • Legacy APIs (deprecated)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
What it does
Request URL
Minimum permission
Request parameters
Sample input
Response data fields
Sample output
Error codes
Notes
Related

bindDeviceAiInsight: Enable AI Insight package

bindDeviceAiInsight: Enable AI Insight package

What it does

Enable the specified AI Insight package on a device channel under the developer account.

Request URL

POST https://openapi-[DataCenter].easy4ip.com/openapi/bindDeviceAiInsight

Minimum permission

Administrator token. See Permission codes.

Request parameters

Parameter nameParameter typeRequired or notParameter description
tokenStringYesAdministrator accessToken
productIdStringNoThing-model product ID (optional). Obtain via Batch detail by device ID.
deviceIdStringYesDevice serial number
channelIdStringYesChannel ID
strategyIdStringNoAI Insight plan strategy ID for the plan spec to enable. Required when opening a new plan from account quota (call queryAiInsightCount first). See Manage AI Insight. Allowed values: See AI Insight packages.
deviceAiInsightIdStringNoUnique id of an unused AI Insight package in inventory. Required when using account inventory (from queryUnusedAiInsightList). See Manage AI Insight. Allowed values: From queryUnusedAiInsightList.
activateNowBooleanNoWhen the channel already has a plan: true activates the new plan immediately and queues the old one; false queues the new plan
languageStringNoChannel AI language; optional. Omit to leave the saved language unchanged Allowed values: One of 37 language codes, e.g. en, zh_CN.
personSwitchIntegerNoPerson detection switch; optional. 1 on, 0 off Allowed values: 0 or 1.
vehicleSwitchIntegerNoVehicle detection switch; optional Allowed values: 0 or 1.
petSwitchIntegerNoPet detection switch; optional Allowed values: 0 or 1.
packageSwitchIntegerNoPackage detection switch; optional Allowed values: 0 or 1.
aorSwitchIntegerNoAOR switch (plan must include AOR entitlement) Allowed values: 0 or 1.
faceSwitchIntegerNoFace library switch (plan must include face entitlement) Allowed values: 0 or 1.

Common request fields and signing: Signing conventions and Common request payload.

Sample input

{
  "id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
  "system": {
    "ver": "1.0",
    "appId": "lcdxxxxxxxxx",
    "sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
    "time": 1706511734,
    "nonce": "f5a1ae2d-c09c-4d39-a744-83a5c2c653c2"
  },
  "params": {
    "token": "<yourAccessToken>",
    "deviceId": "TESTQWERXXXX",
    "channelId": "0",
    "strategyId": "3"
  }
}

Response data fields

No data returned

Sample output

{
  "id": "d5c287b4-5b2f-4f03-baf5-8032c5c354af",
  "result": {
    "code": "0",
    "msg": "The operation was successful"
  }
}

Error codes

This method may return the codes below. See Error codes and Capability errors for the full catalog.

Gateway and auth (SN / TK / OP)

CodeMeaningNext step
SN1001Signature errorCheck sign per Signature
TK1002Token invalid or expiredRefresh accessToken
OP1002Missing required parameterAdd required fields
OP1003Invalid parameterMatch this page’s parameter table
OP1009Permission deniedCheck token and device bind/share grants
OP1013Total call limit exceededReduce call rate
OP1014Daily per-interface limit exceededSee Interface call limits
DV1007Device offlineWait until the device is online

See Error codes · OP/SN/TK for the full catalog.

Device access and channels (DV10xx)

CodeMeaningNext step
DV1007Device offline or timeoutWait for the device to come online
DV1009Device busyRetry later
DV1012Insufficient share/grant permissionCheck sub-account Permission / Resource
DV1019Capability not supportedConfirm model and capability list
DV1020Channel offlineCheck channel status
DV1026Function not supportedUse another API or upgrade firmware
DV1028Not bound or channel missingVerify deviceId / channelId

See Error codes · DV.

AI Insight (AI)

CodeMeaningNext step
AI1004No AI Insight plan in inventoryVerify inventory id
AI1006No active AI Insight plan on channel / plan not foundEnable a plan or verify deviceAiInsightId
AI1007Insufficient quota or inventory (strategyId and deviceAiInsightId both missing)Supply strategyId or inventory id
AI1010Device does not support this strategyId (e.g. non dual-lens device)Use a supported plan or device
AI1011GB-standard device cannot enable AI InsightUse a non-GB device or product path
AI1101Account has no face library rightsEnable AI Insight or cloud plan with face rights

See Error codes · AI.

Notes

Administrator accessToken only; sub-accounts cannot call this API. Provide strategyId or deviceAiInsightId, not both (new purchase vs inventory). National-standard (GB) devices may return AI1011; thing-model devices may require channelId 0; dual-lens devices must use a supported strategyId (otherwise AI1010).

Related

  • Development specification
  • AI Insight packages
  • Signing conventions
  • Common request payload
  • AI Insight module index
detectDeviceSnap: Device snapshot detection
unbindDeviceAiInsight: Unbind AI Insight package