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
    • Return codes
    • Interface call limits
    • Account docking
    • Device APIs
    • Device live broadcast
    • Push configuration
    • Cloud storage service
    • Resource pool quota
    • Legacy APIs (deprecated)
      • Door lock access (legacy)
      • Device messages (legacy)
      • Device query (deprecated)
      • Device maintenance (legacy)
        • Modify Device or Channel Name - Imou Open Platform
        • Modify Device Password for Network Camera Apps - Imou Open Platform
        • Refresh Device Cover Picture - Set Device Video Cover - Imou Open Platform
        • Upgrade Device - Device Upgrade - Imou Open Platform
        • Verify Device Password Documentation - Imou Open Platform
        • uploadDeviceCoverPicture: Set device video cover
      • Device operation (legacy)
      • Device ability (legacy)
      • Motion detection config (legacy)
      • Preset collection (legacy)
      • Timed cruise (legacy)
      • Local recording config (legacy)
      • Audio volume (legacy)
      • Storage (legacy)
      • Video and imaging (legacy)
      • Time zone (legacy)
      • Wi-Fi (legacy)
      • Local recording query (legacy)
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Function details
Request address
Request format
Introduction parameter description
oldPasswordV2 / newPasswordV2 encryption (V2)
Sample input
Return data field description
Sample output
Error codes
Related

modifyPassword (Modify Device Password for Network Camera Apps - Imou Open Platform)

modifyPassword: Modify Device Password for Network Camera Apps - Imou Open Platform

Deprecated: Use Change password (device.password.set). This legacy HTTP page is retained for existing integrations.

Function details

Modify the device password.

Note: This interface is valid for devices with password-management capability (historically TCM; other models such as prosegur may be supported).

Request address

https://openapi-[DataCenter].easy4ip.com/openapi/modifyPassword

Request format

HTTP POST. JSON body layout: Request conventions. Sign with Signature.

Introduction parameter description

ParameterParameter TypeWhether it will be filledDefaultLegal valueParameter Description
tokenStringYesAdministrator AccessToken
deviceIdStringYesDevice serial number
oldPasswordStringconditionalUse either V1 or V2Current device password (V1 encryption); see algorithm below
oldPasswordV2StringconditionalUse either V1 or V2Current device password (V2 encryption); see algorithm below
newPasswordStringconditionalUse either V1 or V2New device password (V1 encryption); see algorithm below
newPasswordV2StringconditionalUse either V1 or V2New device password (V2 encryption); see algorithm below

Password encryption algorithm detailed description: Password calculated formula is: Base64 (AES256_CBC (SourcePassword, Key [], IV []); Encryption rules are as follows:

  1. The algorithm is AES / CBC / PKCS5PADDING in the method of encrypting the CBC packet. 2, SourcePassword is the plain text password of the device; 3, Key [] is a binary array of key (Key); 4, key (key) is: LowerCase(MD5(UpperCase(Base64(KDF(deviceId,MD5(appsecret)))))), the KDF algorithm is PBKDF2WITHMACSHA256, iterates 1200 times, exports the secret key length 256; 5, IV [] is the binary array of initialized vector, which is: MD5 (Appsecret), encrypting the MD5 algorithm of MessageDigest with Java.

Apparatus new password rules require:

  1. Password composition must contain at least two of the numbers, uppercase letters, lowercase letters, and special characters, length of 8 to 32 characters long. Among them, in addition to ['] ["] [;] [:] [&] [space], any visible character outside the six characters; 2, password cannot be Chinese characters.

oldPasswordV2 / newPasswordV2 encryption (V2)

Same algorithm as v2 capability device.password.set:

Device password field encryption (v2 OpenAPI)

Applies to passwordV2 on device.password.verify and oldPasswordV2 / newPasswordV2 on device.password.set. All three use the same algorithm (same family as bind encryptCodeV2; different field names).

StepDescription
1. PlaintextDevice password as a UTF-8 string (newPasswordV2 must meet the strength rules below before encryption)
2. FactorpwdFactor = "op_api_" + appId + "_PWD_KEY_" + deviceId (appId from system.appId; must match derivation)
3. SaltFirst 16 bytes of SHA-256(UTF-8(pwdFactor))
4. PBKDF2PBKDF2WithHmacSHA256: password = deviceId, salt as above, 1200 iterations, 256-bit output → kdfRaw
5. AES keykdfBase64 = Base64(kdfRaw) (standard Base64); aesKey = SHA-256(UTF-8(kdfBase64.toUpperCase())) → 32-byte AES-256 key
6. Nonce12 random bytes per encryption (changes each time)
7. EncryptAES/GCM/NoPadding, GCM tag 128 bits; cipher block = AES-GCM(plaintext) (includes tag)
8. Wire valueBase64(nonce[12] ‖ cipher block) as the request field string

appSecret is not used in v2 key derivation.

New password plaintext (before encrypting newPasswordV2 only): length 8–32; at least two of digit, uppercase, lowercase, special; special means visible chars except ', ", ;, :, &, and space; no CJK.

After a successful verify, the full passwordV2 ciphertext from that request may be copied into oldPasswordV2 (same appId, deviceId, same plaintext).

Sample input

{
 "id":"d5c287b4-5b2f-4f03-baf5-8032c5c354af",
 "system":{
 "ver":"1.0",
 "appId":"lcdxxxxxxxxx",
 "sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
 "time":1599031074,
 "nonce":"8ec8a7bd1d1c95420de20d92422d457d"
 },
 "params":{
 "token":"At_00006acr3456d12312d3grf60147de7ec",
 "deviceId":"TESTQWERXXXX",
 "oldPassword":"jdueu37ajusdii3873jsc8",
 "newPassword":"ewurosd739fdjf102kg823"
 }
}

Return data field description

No data returned

Sample output

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

Error codes

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

Gateway and auth (SN / TK / OP)

CodeMeaningNext step
SN1001Signature errorCheck sign per Development specification
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 Return codes · OP/SN/TK for the full catalog.

Sub-accounts (SUB)

CodeMeaningNext step
SUB1001–SUB1002Sub-account lacks API permissionUpdate policy via addPolicy
SUB1005Sub-account token expiredRefresh subAccountToken
SUB1006No device grant for sub-accountCheck Resource and device serial
SUB1008Sub-account not bound to appCreate and bind the sub-account first

See Return codes · SUB.

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 Return codes · DV.

Device password (DV10xx)

CodeMeaningNext step
DV1016Device password errorVerify password
:---:---:---
DV1020Password format invalidFollow device password rules

See Return codes · catalog.

Related

  • Development specification
  • API conventions
  • Change password
  • Module index
Modify Device or Channel Name - Imou Open Platform
Refresh Device Cover Picture - Set Device Video Cover - Imou Open Platform