How to Use VIGI NVR OpenAPI Function

Knowledgebase
Configuration Guide
11-19-2025
128

Contents

Objective

Requirements

Introduction

Configuration

Verification

Conclusion

Objective

This article provides guidance on how to call the NVR API interfaces based on the OpenAPI Document. It can be used as a reference for integrating the NVR with third-party software platforms.

Requirements

  • VIGI NVR (The firmware requires support for openAPI)
  • VIGI NVR Open API Document
  • Laptop and Postman

Introduction

Based on NVR OpenAPI function and OpenAPI Document, VIGI NVR can be integrated into third-party software platforms. This document uses Postman software as an example to demonstrate how to call the NVR API interface.

Configuration

Complete the Digest Authentication and Obtain the access_token

Step 1. Log in NVR’s web interface with its’ IP address. Enter the Username and Password, click Log in.

The web login page of the NVR.

Step 2. Navigate to Settings > Network > Openapi. Enable OpenAPI function.

The location of OpenAPI function.

Notes: The default OpenAPI port is 20443. If you modify the port or configure port forwarding for remote access, ensure that the OpenAPI port at your request is updated to match the actual OpenAPI port in use.

Step 3. Open Postman. Refer to the document, select the GET method and enter: https://192.168.68.100:20443/openapi/token. Send a No Auth request to obtain the nonce and other parameters from the response header.

Obtain nonce and other parameters from the response header.

Step 4. Referring to the document, calculate the response in the request header for Digest Authentication. The response is derived from the username, password and the authentication information returned by the NVR. If the NVR specifies SHA-256 as the algorithm, the calculation is performed as follows:

  • A1 = SHA256(admin:realm:password)
  • A2 = SHA256(method:uri)
  • response = SHA256(A1:nonce:A2)

Use the information obtained from the previous step’s response header together with the calculation method described above to generate the response.

Step 5. Referring to the OpenAPI document. In the request header, add the Authorization, enter the value, which is Digest username="admin", nonce="", realm="TP-LINK NVR", response=" ". Click Send.

You will get the access_token.

Obtain the access_token.

Call API Interface

Step 1. The access_token is encoded by Percent-encoding as URL, remember decoding because Header Field needs origin string. You can decode it using online tools, for example: https://url-decode.com/.

Decode the access_token.

Step 2. In the Authorization, select Bearer Token, enter the decoded access_token. Referring to the document. Select the API method and enter the Request and Request Body (some API methods require a Body).

This document provides detailed instructions for calling some specific APIs, depending on whether a Request Body is included.

  • added_devices. This API is used for getting added devices.

Referring to the OpenAPI document. Select the GET method, enter the request, click Send. The response body will contain the information of added devices.

The response body returned by the API call.

  • sound. This API is used for setting output sound.

Referring to the OpenAPI document. Select the POST method, enter the request. In the Request Body, select raw and JSON format. Enter the Body ,turn off the mute function for the camera on Channel 1, set the camera volume to 43, and set the system volume to 76, then click Send.

The response body returned by the API call.

Verification

Step 1. Navigate to Information >System Message > Channel Information. Check the added camera’s information. Compare the device information in the returned Response Body to verify consistency.

Check the added device’s information.

Step 2. Navigate to Settings > Camera > Stream > Audio. Check that the mute function of the camera on Channel 1 is disabled, the camera volume is set to 43, and the system volume is set to 76.

The audio information.

Conclusion

You have successfully called the added_devices API to retrieve device information under the NVR channel and successfully called the sound API to modify the camera volume settings for the NVR channel.

Get to know more details of each function and configuration please go to Download Center | TP-Link to download the manual of your product.

Please Rate this Document

Related Documents