Authentication

AK/SK + Token Header

Token Validity

7 days (refreshable)

Rate Limit

5 requests/second

Response Format

JSON

Standard Response Format

{
  "errorCode": "0",
  "message": "success",
  "data": {
    // Response data here
  }
}

Quick Start Guide

Get a live camera stream working in 5 steps

1

Get Credentials

Obtain your appKey and secretKey from the HikCentral Connect portal.

2

Get Access Token

POST to /api/hccgw/platform/v1/token/get with your appKey + secretKey. Use the returned accessToken in the Token header for all subsequent requests.

Important: The auth header is Token: your_access_token (NOT Bearer). This is a custom header specific to HikConnect.

3

Get Stream Token

GET /api/hccgw/platform/v1/streamtoken/get to receive appToken and streamAreaDomain. These are needed for the video player.

4

Get EZOPEN URL

POST to /api/hccgw/video/v1/live/address/get with resourceId, deviceSerial, type: "1", protocol: "1". Returns an EZOPEN URL.

5

Play with EZUIKit

Initialize the EZUIKit player with the EZOPEN URL, appToken as accessToken, and streamAreaDomain as env.domain. See the EZUIKit section below.

EZUIKit Integration

Play EZOPEN video streams in the browser using the EZUIKit JS SDK

Why EZUIKit is Required

Encrypted cameras (most modern Hikvision devices) return error EVZ60019 when you request HLS or FLV streams. The ONLY working protocol for encrypted streams is EZOPEN, which requires the EZUIKit SDK to play in a browser.

Installation

npm install ezuikit-js

Import (Named Export)

import { EZUIKitPlayer } from 'ezuikit-js'

Player Constructor

const player = new EZUIKitPlayer({
  id: 'video-container',       // DOM element id (must exist)
  accessToken: appToken,        // From streamtoken/get API
  url: ezopenUrl,               // EZOPEN URL from video API
  env: {
    domain: streamAreaDomain,   // CRITICAL - see warning below
  },
  template: 'pcLive',          // 'pcLive' for live, 'pcRec' for playback
  width: 640,
  height: 360,
})

CRITICAL: env.domain Must Match Your Region

If you don't set env.domain, EZUIKit defaults to the Chinese server (https://open.ys7.com) and your streams will fail silently. Always use the streamAreaDomain value returned by the stream token API.

RegionExample Domain
North/South Americahttps://isgpopen.ezvizlife.com
Europehttps://ieuopen.ezvizlife.com
China (default - wrong for international)https://open.ys7.com

Templates

TemplateUse CaseControls
pcLiveLive streamingPlay, stop, sound, fullscreen
pcRecRecording playbackPlay, pause, seek, speed, fullscreen
simpleVideo only (no controls)None

Fullscreen API

// Enter fullscreen
await player.fullScreen()

// Cleanup when done
player.destroy()

Getting Started

Authentication and basic setup

POST

Get Access Token

/api/hccgw/platform/v1/token/get

Obtain an access token using your AK/SK credentials. The token is valid for 7 days and can be refreshed.

  • Rate limit: 5 requests per second
  • Token validity: 7 days
  • Refresh the token before expiration to maintain access

Request Parameters

NameTypeRequiredDescription
appKeystringRequiredApplication Key provided by HikCentral Connect
secretKeystringRequiredSecret Key provided by HikCentral Connect

Response Parameters

NameTypeRequiredDescription
accessTokenstringRequiredAccess token for API authentication
expireTimestringRequiredToken expiration time (ISO 8601 format)

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/platform/v1/token/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    appKey: 'your_app_key',
    secretKey: 'your_secret_key',
  }),
})

const data = await response.json()

if (data.errorCode === '0') {
  const accessToken = data.data.accessToken
  const expireTime = data.data.expireTime
  console.log('Token obtained:', accessToken)
} else {
  console.error('Error:', data.message)
}
POST

Refresh Access Token

/api/hccgw/platform/v1/token/refresh

Refresh an existing access token to extend its validity period.

Request Parameters

NameTypeRequiredDescription
accessTokenstringRequiredCurrent access token to refresh

Response Parameters

NameTypeRequiredDescription
accessTokenstringRequiredNew access token
expireTimestringRequiredNew expiration time

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/platform/v1/token/refresh', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    accessToken: currentToken,
  }),
})

const data = await response.json()
const newToken = data.data.accessToken

System Services

System information and user management

GET

Get System Properties

/api/hccgw/platform/v1/systemproperties

Retrieve system properties and configuration information.

Response Parameters

NameTypeRequiredDescription
versionstringRequiredSystem version
timezonestringRequiredServer timezone
languagestringRequiredSystem language

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/platform/v1/systemproperties', {
  method: 'GET',
  headers: {
    'Token': accessToken,
  },
})

const data = await response.json()
console.log('System version:', data.data.version)
console.log('Timezone:', data.data.timezone)
GET

Get Service Package Info

/api/hccgw/platform/v1/servicepackage

Get information about the current service package and its capabilities.

Response Parameters

NameTypeRequiredDescription
packageNamestringRequiredName of the service package
maxDevicesnumberRequiredMaximum number of devices allowed
featuresarrayRequiredList of enabled features

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/platform/v1/servicepackage', {
  method: 'GET',
  headers: {
    'Token': accessToken,
  },
})

const data = await response.json()
console.log('Package:', data.data.packageName)
console.log('Max devices:', data.data.maxDevices)
GET

Get Streaming Token

/api/hccgw/platform/v1/streamtoken/get

Obtain credentials for video streaming via EZUIKit. Returns appKey, appToken (used as accessToken in EZUIKit player), and the regional stream server domain.

  • appToken is different from the API access token - it is specifically for video streaming
  • streamAreaDomain MUST be set in EZUIKit env.domain or streams will fail
  • Default domain (open.ys7.com) is for China only - international accounts must use the returned domain

Response Parameters

NameTypeRequiredDescription
appKeystringRequiredApplication key for EZUIKit SDK
appTokenstringRequiredAccess token for EZUIKit player (use as accessToken param)
streamAreaDomainstringRequiredRegional video server domain (e.g., https://isgpopen.ezvizlife.com). MUST match your region.

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/platform/v1/streamtoken/get', {
  method: 'GET',
  headers: {
    'Token': accessToken,
  },
})

const data = await response.json()
const { appKey, appToken, streamAreaDomain } = data.data
// appToken is used as the accessToken for EZUIKit player
// streamAreaDomain is the regional video server domain
console.log('Stream domain:', streamAreaDomain)
POST

Get Users

/api/hccgw/platform/v1/users/get

Retrieve a list of users with optional filtering.

Request Parameters

NameTypeRequiredDescription
pageNonumberOptionalPage number (starts from 1)(Default: 1)
pageSizenumberOptionalNumber of items per page(Default: 20)
userNamestringOptionalFilter by username

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal number of users
listarrayRequiredArray of user objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/platform/v1/users/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
console.log('Total users:', data.data.total)
data.data.list.forEach(user => {
  console.log(user.userName)
})

Resource Services

Device, area, and camera management

POST

Add Device

/api/hccgw/resource/v1/devices/add

Register a new device to the platform.

Request Parameters

NameTypeRequiredDescription
deviceNamestringRequiredName for the device
deviceSerialstringRequiredDevice serial number
validateCodestringRequiredDevice validation code
areaIdstringOptionalArea ID to assign the device

Response Parameters

NameTypeRequiredDescription
deviceIdstringRequiredUnique identifier of the added device

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/devices/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    deviceName: 'Front Door Camera',
    deviceSerial: 'DS-2CD2143G2-I-ABC123',
    validateCode: 'ABCDEF',
    areaId: 'area_001',
  }),
})

const data = await response.json()
const deviceId = data.data.deviceId
console.log('Device added:', deviceId)
POST

Update Device

/api/hccgw/resource/v1/devices/update

Update device information.

Request Parameters

NameTypeRequiredDescription
deviceIdstringRequiredDevice ID to update
deviceNamestringOptionalNew device name
areaIdstringOptionalNew area assignment

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/devices/update', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    deviceId: 'device_001',
    deviceName: 'Updated Camera Name',
    areaId: 'area_002',
  }),
})

const data = await response.json()
console.log('Device updated:', data.errorCode === '0')
POST

Get Devices

/api/hccgw/resource/v1/devices/get

Retrieve a list of registered devices.

Request Parameters

NameTypeRequiredDescription
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)
areaIdstringOptionalFilter by area
deviceNamestringOptionalFilter by device name

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal device count
listarrayRequiredArray of device objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/devices/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    pageNo: 1,
    pageSize: 20,
    areaId: 'area_001',
  }),
})

const data = await response.json()
console.log('Total devices:', data.data.total)
data.data.list.forEach(device => {
  console.log(`${device.deviceName}: ${device.status}`)
})
POST

Delete Device

/api/hccgw/resource/v1/devices/delete

Remove a device from the platform.

Request Parameters

NameTypeRequiredDescription
deviceIdsarrayRequiredArray of device IDs to delete

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/devices/delete', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    deviceIds: ['device_001', 'device_002'],
  }),
})

const data = await response.json()
console.log('Devices deleted:', data.errorCode === '0')
POST

Add Area

/api/hccgw/resource/v1/areas/add

Create a new area for organizing devices.

Request Parameters

NameTypeRequiredDescription
areaNamestringRequiredName of the area
parentAreaIdstringOptionalParent area ID for hierarchy

Response Parameters

NameTypeRequiredDescription
areaIdstringRequiredID of the created area

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/areas/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    areaName: 'Building A - Floor 1',
    parentAreaId: 'root_area',
  }),
})

const data = await response.json()
const areaId = data.data.areaId
POST

Get Areas

/api/hccgw/resource/v1/areas/get

Retrieve the area hierarchy.

Request Parameters

NameTypeRequiredDescription
parentAreaIdstringOptionalFilter by parent area

Response Parameters

NameTypeRequiredDescription
listarrayRequiredArray of area objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/areas/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({}),
})

const data = await response.json()
data.data.list.forEach(area => {
  console.log(`${area.areaName} (ID: ${area.areaId})`)
})
POST

Get Cameras by Area

/api/hccgw/resource/v1/areas/cameras/get

Get all cameras in a specific area.

Request Parameters

NameTypeRequiredDescription
areaIdstringRequiredArea ID to query
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal camera count
listarrayRequiredArray of camera objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/areas/cameras/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    areaId: 'area_001',
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
data.data.list.forEach(camera => {
  console.log(`Camera: ${camera.cameraName}, Status: ${camera.status}`)
})

Alarm Services

Alarm subscriptions, rules, and logs

POST

Subscribe to Message Queue

/api/hccgw/alarm/v1/mq/subscribe

Subscribe to receive alarm notifications via message queue.

Request Parameters

NameTypeRequiredDescription
eventTypesarrayRequiredArray of event types to subscribe

Response Parameters

NameTypeRequiredDescription
subscriptionIdstringRequiredSubscription identifier
mqUrlstringRequiredMessage queue URL

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/alarm/v1/mq/subscribe', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    eventTypes: ['motion', 'intrusion', 'faceDetection'],
  }),
})

const data = await response.json()
const subscriptionId = data.data.subscriptionId
const mqUrl = data.data.mqUrl
console.log('Subscribed to MQ:', subscriptionId)
POST

Get Message Queue Messages

/api/hccgw/alarm/v1/mq/messages

Retrieve messages from the subscribed message queue.

Request Parameters

NameTypeRequiredDescription
subscriptionIdstringRequiredSubscription ID
maxMessagesnumberOptionalMaximum messages to retrieve(Default: 100)

Response Parameters

NameTypeRequiredDescription
messagesarrayRequiredArray of alarm messages

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/alarm/v1/mq/messages', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    subscriptionId: 'sub_001',
    maxMessages: 100,
  }),
})

const data = await response.json()
data.data.messages.forEach(msg => {
  console.log(`Event: ${msg.eventType}, Time: ${msg.timestamp}`)
})
POST

Add Alarm Rule

/api/hccgw/alarm/v1/alarmrules/add

Create a new alarm rule.

Request Parameters

NameTypeRequiredDescription
ruleNamestringRequiredName of the alarm rule
deviceIdsarrayRequiredDevices to apply the rule
eventTypestringRequiredType of event to trigger alarm
scheduleobjectOptionalSchedule configuration

Response Parameters

NameTypeRequiredDescription
ruleIdstringRequiredID of the created rule

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/alarm/v1/alarmrules/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    ruleName: 'Motion Detection Rule',
    deviceIds: ['device_001', 'device_002'],
    eventType: 'motion',
    schedule: {
      startTime: '08:00',
      endTime: '18:00',
      weekDays: [1, 2, 3, 4, 5],
    },
  }),
})

const data = await response.json()
const ruleId = data.data.ruleId
POST

Get Alarm Logs

/api/hccgw/alarm/v1/alarmlogs/get

Retrieve historical alarm logs.

Request Parameters

NameTypeRequiredDescription
startTimestringRequiredStart time (ISO 8601)
endTimestringRequiredEnd time (ISO 8601)
deviceIdsarrayOptionalFilter by devices
eventTypesarrayOptionalFilter by event types
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal log count
listarrayRequiredArray of alarm log objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/alarm/v1/alarmlogs/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    startTime: '2024-01-01T00:00:00Z',
    endTime: '2024-01-31T23:59:59Z',
    eventTypes: ['motion', 'intrusion'],
    pageNo: 1,
    pageSize: 50,
  }),
})

const data = await response.json()
console.log('Total alarms:', data.data.total)

Message Services

Raw message queue operations

POST

Get Raw Messages

/api/hccgw/message/v1/rawmessage/get

Retrieve raw messages from the platform message queue.

Request Parameters

NameTypeRequiredDescription
queueIdstringRequiredQueue identifier
maxCountnumberOptionalMaximum messages(Default: 100)

Response Parameters

NameTypeRequiredDescription
messagesarrayRequiredArray of raw messages

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/message/v1/rawmessage/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    queueId: 'queue_001',
    maxCount: 100,
  }),
})

const data = await response.json()
const messages = data.data.messages
POST

Acknowledge Messages

/api/hccgw/message/v1/rawmessage/ack

Acknowledge receipt of messages to remove them from the queue.

Request Parameters

NameTypeRequiredDescription
queueIdstringRequiredQueue identifier
messageIdsarrayRequiredArray of message IDs to acknowledge

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/message/v1/rawmessage/ack', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    queueId: 'queue_001',
    messageIds: ['msg_001', 'msg_002', 'msg_003'],
  }),
})

const data = await response.json()

Video Services

Live view, recording playback, and snapshots. Encrypted cameras require EZOPEN protocol + EZUIKit player.

POST

Get Video URL (Live & Playback)

/api/hccgw/video/v1/live/address/get

Obtain an EZOPEN URL for live streaming or recorded playback. This single endpoint handles both live and playback by changing the type parameter. For encrypted cameras, you MUST use protocol "1" (EZOPEN) and play the URL with EZUIKit SDK.

  • Encrypted cameras return error EVZ60019 with HLS/FLV - use EZOPEN protocol instead
  • EZOPEN URLs must be played with EZUIKit JS SDK (ezuikit-js npm package)
  • For playback (type="2"/"3"), startTime and stopTime are required
  • Use EZUIKit template "pcLive" for live, "pcRec" for playback

Request Parameters

NameTypeRequiredDescription
resourceIdstringRequiredCamera resource ID (from camera list response)
deviceSerialstringRequiredDevice serial number
typestringRequiredStream type: "1"=live, "2"=cloud playback, "3"=local playback
123
codestringOptionalChannel code (usually "0")(Default: 0)
protocolstringOptionalProtocol: "1"=EZOPEN (required for encrypted streams)(Default: 1)
qualitystringOptionalVideo quality: "1"=HD, "2"=SD(Default: 1)
12
startTimestringOptionalPlayback start time (format: YYYY-MM-DD HH:MM:SS). Required when type="2" or "3".
stopTimestringOptionalPlayback stop time (format: YYYY-MM-DD HH:MM:SS). Required when type="2" or "3".

Response Parameters

NameTypeRequiredDescription
urlstringRequiredEZOPEN URL (e.g., ezopen://open.ezviz.com/<token>/live)

Example

// Get live EZOPEN URL for a camera
const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/video/v1/live/address/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    resourceId: 'camera_resource_id',  // From camera list
    deviceSerial: 'DS-2CD2143G2-I-ABC123',
    type: '1',       // 1=live, 2=cloud playback, 3=local playback
    code: '0',       // Channel code (usually "0")
    protocol: '1',   // 1=EZOPEN (required for encrypted streams)
    quality: '1',    // 1=HD, 2=SD
  }),
})

const data = await response.json()
// Returns an EZOPEN URL like: ezopen://open.ezviz.com/<token>/live
const ezopenUrl = data.data.url
console.log('EZOPEN URL:', ezopenUrl)
// Use this URL with EZUIKit player (see EZUIKit Integration section)
POST

Get Playback URL

/api/hccgw/video/v1/live/address/get

Same endpoint as Get Video URL but with type="2" (cloud) or type="3" (local). Requires startTime and stopTime parameters.

  • Use EZUIKit template "pcRec" for playback
  • Time format is "YYYY-MM-DD HH:MM:SS" (NOT ISO 8601)

Request Parameters

NameTypeRequiredDescription
resourceIdstringRequiredCamera resource ID
deviceSerialstringRequiredDevice serial number
typestringRequired"2"=cloud playback, "3"=local playback
23
codestringOptionalChannel code(Default: 0)
protocolstringOptionalProtocol: "1"=EZOPEN(Default: 1)
qualitystringOptional"1"=HD, "2"=SD(Default: 1)
startTimestringRequiredStart time (YYYY-MM-DD HH:MM:SS)
stopTimestringRequiredStop time (YYYY-MM-DD HH:MM:SS)

Response Parameters

NameTypeRequiredDescription
urlstringRequiredEZOPEN playback URL

Example

// Get playback URL - same endpoint, different type parameter
const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/video/v1/live/address/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    resourceId: 'camera_resource_id',
    deviceSerial: 'DS-2CD2143G2-I-ABC123',
    type: '2',       // 2=cloud playback, 3=local playback
    code: '0',
    protocol: '1',   // 1=EZOPEN
    quality: '1',
    startTime: '2024-01-15 10:00:00',  // Format: YYYY-MM-DD HH:MM:SS
    stopTime: '2024-01-15 11:00:00',
  }),
})

const data = await response.json()
const playbackUrl = data.data.url
// Use with EZUIKit player using template: 'pcRec' for playback
POST

Search Recording Segments

/api/hccgw/video/v1/record/element/search

Search for available recording segments for a camera. Returns time ranges of recorded video.

Request Parameters

NameTypeRequiredDescription
resourceIdstringRequiredCamera resource ID
filterobjectRequiredFilter object with time range and target type
filter.beginTimestringRequiredStart time (ISO 8601, e.g., 2024-01-15T00:00:00.000+00:00)
filter.endTimestringRequiredEnd time (ISO 8601)
filter.targetTypestringOptional"0"=cloud recordings, "1"=local device recordings(Default: 0)
01

Response Parameters

NameTypeRequiredDescription
listarrayRequiredArray of recording segment objects with beginTime and endTime

Example

// Search recording segments for a camera
const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/video/v1/record/element/search', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    resourceId: 'camera_resource_id',
    filter: {
      beginTime: '2024-01-15T00:00:00.000+00:00',  // ISO 8601
      endTime: '2024-01-15T23:59:59.000+00:00',
      targetType: '0',  // 0=cloud, 1=local device
    },
  }),
})

const data = await response.json()
data.data.list.forEach(segment => {
  console.log(`Recording: ${segment.beginTime} - ${segment.endTime}`)
})
POST

Capture Snapshot

/api/hccgw/resource/v1/device/capturePic

Capture a snapshot image from a device camera. Returns a URL to the captured image.

  • Device must be online for capture to succeed
  • Capture URL is temporary and may expire

Request Parameters

NameTypeRequiredDescription
deviceSerialstringRequiredDevice serial number
channelNonumberOptionalChannel number (defaults to 1)(Default: 1)

Response Parameters

NameTypeRequiredDescription
captureUrlstringRequiredURL of the captured snapshot image

Example

// Capture a snapshot from a device camera
const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/resource/v1/device/capturePic', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    deviceSerial: 'DS-2CD2143G2-I-ABC123',
    channelNo: 1,
  }),
})

const data = await response.json()
const captureUrl = data.data.captureUrl
console.log('Snapshot URL:', captureUrl)
POST

Get Recording Schedule

/api/hccgw/video/v1/recordsettings/get

Get the recording schedule settings for a camera.

Request Parameters

NameTypeRequiredDescription
resourceIdstringRequiredCamera resource ID

Response Parameters

NameTypeRequiredDescription
settingsobjectRequiredRecording schedule configuration

Example

// Get recording schedule settings for a camera
const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/video/v1/recordsettings/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    resourceId: 'camera_resource_id',
  }),
})

const data = await response.json()
console.log('Recording settings:', data.data)

Video Intercom Services

Building, resident, and pass management

POST

Add Building

/api/hccgw/visp/v1/buildings/add

Register a new building for intercom services.

Request Parameters

NameTypeRequiredDescription
buildingNamestringRequiredName of the building
buildingNostringRequiredBuilding number
addressstringOptionalBuilding address

Response Parameters

NameTypeRequiredDescription
buildingIdstringRequiredID of the created building

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/visp/v1/buildings/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    buildingName: 'Main Building',
    buildingNo: 'A1',
    address: '123 Main Street',
  }),
})

const data = await response.json()
const buildingId = data.data.buildingId
POST

Get Buildings

/api/hccgw/visp/v1/buildings/get

Retrieve list of buildings.

Request Parameters

NameTypeRequiredDescription
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal building count
listarrayRequiredArray of building objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/visp/v1/buildings/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
data.data.list.forEach(building => {
  console.log(building.buildingName)
})
POST

Add Resident

/api/hccgw/visp/v1/residents/add

Register a new resident.

Request Parameters

NameTypeRequiredDescription
residentNamestringRequiredName of the resident
phoneNostringRequiredPhone number
buildingIdstringRequiredBuilding ID
roomNostringRequiredRoom number

Response Parameters

NameTypeRequiredDescription
residentIdstringRequiredID of the created resident

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/visp/v1/residents/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    residentName: 'John Doe',
    phoneNo: '+1234567890',
    buildingId: 'building_001',
    roomNo: '101',
  }),
})

const data = await response.json()
const residentId = data.data.residentId
POST

Issue Visitor Pass

/api/hccgw/visp/v1/passes/issue

Issue a temporary visitor pass.

Request Parameters

NameTypeRequiredDescription
residentIdstringRequiredResident ID issuing the pass
visitorNamestringRequiredVisitor name
validFromstringRequiredPass validity start (ISO 8601)
validTostringRequiredPass validity end (ISO 8601)

Response Parameters

NameTypeRequiredDescription
passCodestringRequiredPass code for the visitor
qrCodestringRequiredQR code image URL

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/visp/v1/passes/issue', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    residentId: 'resident_001',
    visitorName: 'Jane Smith',
    validFrom: '2024-01-20T09:00:00Z',
    validTo: '2024-01-20T18:00:00Z',
  }),
})

const data = await response.json()
const passCode = data.data.passCode
const qrCode = data.data.qrCode

Access Control Services

Door control and access permissions

POST

Remote Door Control

/api/hccgw/acs/v1/remote/control

Remotely control a door (open/close/remain open).

  • Ensure proper permissions before remote control
  • Control actions are logged for audit purposes

Request Parameters

NameTypeRequiredDescription
doorIdstringRequiredDoor identifier
controlTypestringRequiredControl action
opencloseremainOpenremainClose

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/acs/v1/remote/control', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    doorId: 'door_001',
    controlType: 'open',
  }),
})

const data = await response.json()
if (data.errorCode === '0') {
  console.log('Door opened successfully')
}
GET

Get Encryption Info

/api/hccgw/acs/v1/encryptinfo/get

Get encryption information for secure Bluetooth communication.

Response Parameters

NameTypeRequiredDescription
publicKeystringRequiredPublic key for encryption
algorithmstringRequiredEncryption algorithm

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/acs/v1/encryptinfo/get', {
  method: 'GET',
  headers: {
    'Token': accessToken,
  },
})

const data = await response.json()
const publicKey = data.data.publicKey
const algorithm = data.data.algorithm
POST

Get Access Levels

/api/hccgw/acspm/v1/accesslevel/list

Retrieve list of access levels.

Request Parameters

NameTypeRequiredDescription
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal count
listarrayRequiredArray of access level objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/acspm/v1/accesslevel/list', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
data.data.list.forEach(level => {
  console.log(`Access Level: ${level.name}`)
})
POST

Assign Access to Person

/api/hccgw/acspm/v1/personaccess/assign

Assign access levels to a person.

Request Parameters

NameTypeRequiredDescription
personIdstringRequiredPerson identifier
accessLevelIdsarrayRequiredArray of access level IDs

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/acspm/v1/personaccess/assign', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    personId: 'person_001',
    accessLevelIds: ['level_001', 'level_002'],
  }),
})

const data = await response.json()

Person Management Services

Departments, persons, and credentials

POST

Search Person Groups

/api/hccgw/person/v1/groups/search

Search for person groups (departments).

Request Parameters

NameTypeRequiredDescription
keywordstringOptionalSearch keyword
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal count
listarrayRequiredArray of group objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/person/v1/groups/search', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    keyword: 'Engineering',
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
data.data.list.forEach(group => {
  console.log(`Group: ${group.groupName}`)
})
POST

Add Person

/api/hccgw/person/v1/persons/add

Add a new person to the system.

Request Parameters

NameTypeRequiredDescription
personNamestringRequiredFull name of the person
groupIdstringRequiredGroup/department ID
phoneNostringOptionalPhone number
emailstringOptionalEmail address
cardNostringOptionalCard number

Response Parameters

NameTypeRequiredDescription
personIdstringRequiredID of the created person

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/person/v1/persons/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    personName: 'John Smith',
    groupId: 'group_001',
    phoneNo: '+1234567890',
    email: 'john.smith@example.com',
    cardNo: 'CARD123456',
  }),
})

const data = await response.json()
const personId = data.data.personId
POST

Upload Person Photo

/api/hccgw/person/v1/persons/photo

Upload a photo for facial recognition.

  • Photo should be a clear frontal face image
  • Recommended resolution: 640x480 or higher
  • Maximum file size: 200KB (base64 encoded)

Request Parameters

NameTypeRequiredDescription
personIdstringRequiredPerson identifier
photoBase64stringRequiredBase64 encoded photo (JPEG/PNG)

Example

// First, convert image to base64
const imageFile = await fetch('/path/to/photo.jpg')
const imageBlob = await imageFile.blob()
const base64 = await blobToBase64(imageBlob)

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/person/v1/persons/photo', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    personId: 'person_001',
    photoBase64: base64,
  }),
})

const data = await response.json()
POST

Quick Add Person

/api/hccgw/person/v1/persons/quick/add

Quickly add a person with photo and card in a single request.

Request Parameters

NameTypeRequiredDescription
personNamestringRequiredFull name
groupIdstringRequiredGroup/department ID
photoBase64stringOptionalBase64 encoded photo
cardNostringOptionalCard number
accessLevelIdsarrayOptionalAccess level IDs to assign

Response Parameters

NameTypeRequiredDescription
personIdstringRequiredID of the created person

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/person/v1/persons/quick/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    personName: 'Jane Doe',
    groupId: 'group_001',
    photoBase64: photoBase64String,
    cardNo: 'CARD789012',
    accessLevelIds: ['level_001'],
  }),
})

const data = await response.json()
const personId = data.data.personId
POST

Search Persons

/api/hccgw/person/v1/persons/search

Search for persons with various filters.

Request Parameters

NameTypeRequiredDescription
keywordstringOptionalSearch keyword
groupIdstringOptionalFilter by group
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal count
listarrayRequiredArray of person objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/person/v1/persons/search', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    keyword: 'John',
    groupId: 'group_001',
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
console.log('Found:', data.data.total, 'persons')

On-Board Monitoring Services

Vehicle and driver management

POST

Add Vehicle

/api/hccgw/obd/v1/vehicles/add

Register a new vehicle.

Request Parameters

NameTypeRequiredDescription
plateNostringRequiredVehicle plate number
vehicleNamestringOptionalVehicle name/identifier
deviceIdstringOptionalAssociated device ID

Response Parameters

NameTypeRequiredDescription
vehicleIdstringRequiredID of the created vehicle

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/obd/v1/vehicles/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    plateNo: 'ABC-1234',
    vehicleName: 'Delivery Truck 1',
    deviceId: 'device_001',
  }),
})

const data = await response.json()
const vehicleId = data.data.vehicleId
POST

Get Vehicles

/api/hccgw/obd/v1/vehicles/get

Retrieve list of vehicles.

Request Parameters

NameTypeRequiredDescription
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)
plateNostringOptionalFilter by plate number

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal count
listarrayRequiredArray of vehicle objects

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/obd/v1/vehicles/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    pageNo: 1,
    pageSize: 20,
  }),
})

const data = await response.json()
data.data.list.forEach(vehicle => {
  console.log(`${vehicle.plateNo}: ${vehicle.vehicleName}`)
})
POST

Add Driver

/api/hccgw/obd/v1/drivers/add

Register a new driver.

Request Parameters

NameTypeRequiredDescription
driverNamestringRequiredDriver name
licenseNostringRequiredLicense number
phoneNostringOptionalPhone number

Response Parameters

NameTypeRequiredDescription
driverIdstringRequiredID of the created driver

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/obd/v1/drivers/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    driverName: 'Mike Johnson',
    licenseNo: 'DL123456789',
    phoneNo: '+1234567890',
  }),
})

const data = await response.json()
const driverId = data.data.driverId
POST

Get Vehicle Location

/api/hccgw/obd/v1/vehicles/location

Get current location of a vehicle.

Request Parameters

NameTypeRequiredDescription
vehicleIdstringRequiredVehicle identifier

Response Parameters

NameTypeRequiredDescription
latitudenumberRequiredLatitude coordinate
longitudenumberRequiredLongitude coordinate
speednumberRequiredCurrent speed (km/h)
timestampstringRequiredLocation timestamp

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/obd/v1/vehicles/location', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    vehicleId: 'vehicle_001',
  }),
})

const data = await response.json()
const { latitude, longitude, speed, timestamp } = data.data
console.log(`Location: ${latitude}, ${longitude} - Speed: ${speed} km/h`)

Attendance Services

Time card and attendance reports

POST

Get Attendance Records

/api/hccgw/attendance/v1/records/get

Retrieve attendance check-in/out records.

Request Parameters

NameTypeRequiredDescription
startTimestringRequiredStart time (ISO 8601)
endTimestringRequiredEnd time (ISO 8601)
personIdsarrayOptionalFilter by person IDs
groupIdstringOptionalFilter by group
pageNonumberOptionalPage number(Default: 1)
pageSizenumberOptionalItems per page(Default: 20)

Response Parameters

NameTypeRequiredDescription
totalnumberRequiredTotal record count
listarrayRequiredArray of attendance records

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/attendance/v1/records/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    startTime: '2024-01-01T00:00:00Z',
    endTime: '2024-01-31T23:59:59Z',
    groupId: 'group_001',
    pageNo: 1,
    pageSize: 50,
  }),
})

const data = await response.json()
console.log('Total records:', data.data.total)
POST

Get Time Card Report

/api/hccgw/attendance/v1/timecard/report

Generate a time card report for specified period.

Request Parameters

NameTypeRequiredDescription
startDatestringRequiredStart date (YYYY-MM-DD)
endDatestringRequiredEnd date (YYYY-MM-DD)
personIdsarrayOptionalFilter by person IDs
groupIdstringOptionalFilter by group

Response Parameters

NameTypeRequiredDescription
reportarrayRequiredArray of time card entries

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/attendance/v1/timecard/report', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    startDate: '2024-01-01',
    endDate: '2024-01-31',
    groupId: 'group_001',
  }),
})

const data = await response.json()
data.data.report.forEach(entry => {
  console.log(`${entry.personName}: ${entry.totalHours} hours`)
})
POST

Get Attendance Summary

/api/hccgw/attendance/v1/summary/get

Get attendance summary statistics.

Request Parameters

NameTypeRequiredDescription
datestringRequiredDate (YYYY-MM-DD)
groupIdstringOptionalFilter by group

Response Parameters

NameTypeRequiredDescription
totalPersonsnumberRequiredTotal persons
checkedInnumberRequiredNumber checked in
absentnumberRequiredNumber absent
latenumberRequiredNumber late

Example

const response = await fetch('https://ius.hikcentralconnect.com/api/hccgw/attendance/v1/summary/get', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Token': accessToken,
  },
  body: JSON.stringify({
    date: '2024-01-15',
    groupId: 'group_001',
  }),
})

const data = await response.json()
const { totalPersons, checkedIn, absent, late } = data.data
console.log(`Checked in: ${checkedIn}/${totalPersons}, Late: ${late}, Absent: ${absent}`)

Error Codes

Common error codes and their meanings

CodeMessageDescriptionSolution
0SuccessThe request was successful.-
0x1001Invalid ParameterOne or more request parameters are invalid or missing.Check that all required parameters are provided and have valid values.
0x1002Parameter Type ErrorA parameter has an incorrect data type.Verify that parameter types match the API specification (string, number, array, etc.).
0x1003Parameter Out of RangeA parameter value is outside the allowed range.Check the allowed range for numeric parameters in the API documentation.
0x2001Authentication FailedInvalid or expired access token.Refresh your access token or obtain a new one using the /token/get endpoint.
0x2002Invalid App KeyThe provided app key is invalid or has been revoked.Verify your app key is correct and active in the HikCentral Connect portal.
0x2003Invalid Secret KeyThe provided secret key is invalid.Verify your secret key matches the one in the HikCentral Connect portal.
0x2004Token ExpiredThe access token has expired.Refresh your token using the /token/refresh endpoint or obtain a new one.
0x2005Permission DeniedThe account does not have permission for this operation.Contact your administrator to grant the required permissions.
0x2006Rate Limit ExceededToo many requests in a short period. Rate limit is 5 requests per second.Implement request throttling in your application. Wait before retrying.
0x3001Resource Not FoundThe requested resource (device, camera, area, etc.) does not exist.Verify the resource ID is correct and the resource has not been deleted.
0x3002Resource Already ExistsA resource with the same identifier already exists.Use a different identifier or update the existing resource instead.
0x3003Resource Limit ExceededThe maximum number of resources has been reached.Upgrade your service package or delete unused resources.
0x3004Device OfflineThe device is currently offline and cannot respond to commands.Check the device network connection and power status.
0x3005Device BusyThe device is busy processing another request.Wait and retry the request after a short delay.
0x3006Invalid Device SerialThe device serial number is invalid or already registered.Verify the serial number is correct and not registered to another account.
0x3007Invalid Validation CodeThe device validation code is incorrect.Check the validation code on the device label or in the device documentation.
EVZ60019Encrypted StreamThe camera stream is encrypted. HLS and FLV protocols cannot be used.Use EZOPEN protocol (protocol: "1") and play the stream with EZUIKit JS SDK. See the EZUIKit Integration section.
0x4001Video Stream ErrorFailed to establish video stream connection.Check camera connectivity and try again. Verify the protocol is supported.
0x4002Recording Not FoundNo recording available for the specified time range.Verify the camera has recording enabled and check the time range.
0x4003Stream Token ExpiredThe streaming token has expired.Obtain a new streaming token using the /streamtoken/get endpoint.
0x5001Subscription FailedFailed to create message queue subscription.Verify the event types are valid and try again.
0x5002Queue Not FoundThe specified message queue does not exist.Create a new subscription to get a new queue ID.
0x5003Message Acknowledge FailedFailed to acknowledge messages.Verify the message IDs are valid and belong to the specified queue.
0x6001Person Photo InvalidThe uploaded photo does not meet requirements.Ensure the photo is a clear frontal face image, minimum 640x480, under 200KB.
0x6002Card Number DuplicateThe card number is already assigned to another person.Use a different card number or remove it from the existing person.
0x6003Face Recognition FailedNo face detected in the uploaded photo.Upload a clear photo with a visible frontal face.
0x7001Access Control ErrorFailed to execute access control command.Verify the door is connected and try again.
0x7002Door Not ConfiguredThe door is not properly configured for remote control.Configure the door in the HikCentral Connect portal.
0x8001Internal Server ErrorAn unexpected error occurred on the server.Try again later. If the problem persists, contact support.
0x8002Service UnavailableThe service is temporarily unavailable.Wait and retry. Check the HikCentral Connect status page.
0x8003Database ErrorA database error occurred.Try again later. If the problem persists, contact support.