hikopenapi-native-node
v1.0.3
Published
native hikopenapi node
Downloads
2
Readme
HIKOPENAPI-NATIVE-NODE
iSee/iFar Artemis Http Client Nodejs SDK
接口获取:海康威视开放平台
适配ISC/PVIA等基于iSee/iFar架构的平台,基于AK/SK认证的方式封装了HTTP/HTTPS 的 POST/GET 方法,提供nodejs下调 OpenAPI HTTP 接口统一的入口。
Support
适配windows x64环境与linux x64环境,基于原生nodejs开发,对系统环境没有特别要求
平台需部署openapi网关后即可调用相关接口,appKey appSecret请联系海康工作人员获取,请求请使用https://portal_ip:443/artemis/
Author
qoddi
email:[email protected]
Installation
$ npm install hikopenapi-native-node --safe
Usage
安装部署即可直接使用,无需特殊配置,基于cpp认证库,提供post get方法支持 Example:
const Hikopenapi=require('hikopenapi-native-node');
let requestUrl='https://123.123.123.123:443/artemis/api/video/v1/cameras/previewURLs';
let headers={"content-type":"application/json","accept":"application/json"};
let body=JSON.stringify({
"cameraIndexCode": "fsjdfkj2hkjsdhfkajhskdjahksdjahksjfhsf" ,
"streamType":0,
"protocol":"rtsp",
"transmode":0,
"expand":"transcode=0"});
let timeout=15;
let appKey='12345';
let appSecret='skjfhakjshdakjh12312jkhk';
//封装认证库POST方法
let httpRes=await Hikopenapi.httpPost(requestUrl,headers,body,appKey,appSecret,timeout);
console.log(httpRes); //{"status":true,error:0,data:""}
//封装认证库GET方法
let httpRes=await Hikopenapi.httpGet(requestUrl,headers,"12345","sfakjshdkjh1",timeout);
console.log(httpRes); //{"status":true,error:0,data:""}
Error Code
| 码值 | 信息 | | :--------: | :---------------:| | 0 | 无错误 | | 10000以下 | http状态 |
License
(The MIT License)