Video Security Monitoring R6 API Document

Video Security Monitoring R6 API Document

Introduction

These APIs provide services for manipulating ote-stack platform on AI Edge Blueprint. 

API Definitions

otestack v1

User Management

1.Login

POST /v1/authorization

Description

An access token, which contains user information and expiry time, will be returned by presenting username and password. The client should includes the token in the authorization header of HTTP request to access subsequent request until the token is expired. During the validity period (1 hour), the new token with new expiry time can be obtained through the Update token API with current token.

Parameters

Name

Type

Required

Default

Description

user

string

yes

 

user name

password

string

yes

 

user password

Response codes

Code

Description

Code

Description

200

Successful

500

Unexpected internal errors

422

Parameter validation error

Example

POST /v1/authorization Body: { "user": "u1", "password": "xxx" } Response: { "token": "eyxxxxxxxxxxxxxx", "code": 200, "message": "success" }

2.Update Token

PUT /v1/authorization

Description

Returns a new authorization token with new expiry time.

Parameters

Name

Type

Required

Default

Description

Authorization

string

yes

 

token string in Authorization Header

Response codes

Code

Description

Code

Description

200

Successful

500

Unexpected internal errors

422

Parameter validation error

Example

PUT /v1/authorization Header: Authorization: eyxxxxxxxxxxxxxx Response: { "token": "eyyxxxxxxxxxxxx2", "code": 200, "message": "success" }

3.Create User

POST /v1/user

Description

Create a user without access token authorization. This user will be available after system administrator approval.

Parameters

Name

Type

Required

Default

Description

Name

Type

Required

Default

Description

user

string

yes

 

User name

password

string

yes

 

Password should be 8-20 characters long with at least 1 uppercase, 1 lowercase and 1 number.

phone

string

yes

 

Phone number

isAdmin

bool

yes

 

true: general administrator, false: general user

realName

string

yes

 

Real name

Response code

Code

Description

Code

Description

200

Success

500

Unexpected internal errors

422

Parameter validation error

Example

POST /v1/user body: { "user": "u1", "password": "xxX@1234", "phone": "12345678910", "realName": "hello" "isAdmin": true } Response: { "code": 200, "message": "success" }

4.Update Password

PUT /v1/user

Description

Change the password of the logged-in user.

Parameters