HCP OpenAPI Technical Documentation

Bitbucket - ctiteam / apface — Bitbucket

System - APFace

Below is the documenation of HCP OpenAPI endpoints which are used by the APFace Lambda function.

Please note that the guides are intended to call the HCP OpenAPI only, NOT to invoke the Lambda function.

The guides include the endpoints and request body data which are used only. For the complete details, please refer to the official documentation of HikCentral.

In HCP, “Person“ refers to a student record which is created.

For the request header configuration, refer to HCP OpenAPI's Headers Configuration

Add a Person

This endpoint is used when inserting a new record into HCP.

URL: */artemis/api/resource/v1/person/single/add
Method: POST
Body: JSON

Sample Request:

{ "personCode": student_number, "personFamilyName": "APU", "personGivenName": student_number, "orgIndexCode": "2", # APU org ID "remark": s3_version_id, "beginTime": today_datetime, "endTime": completion_datetime + 7, "gender": 0, # 1-male, 2-female, 0-unknown "faces": [ { "faceData": base64_img } ] }


Sample Response:

{ "code": "0", "msg": "Success", "data": "1150" }

Get person information according to person code

This endpoint is used when checking if a student number exists in HCP. Search student record via student number.

If a student record exists in HCP, the personId must be saved for the use of updating details and photos. Take note that personId and personCode are two different data.

picUri is used to identify if the student record in HCP has a photo.

remark is used to identify the photo version.

URL: */artemis/api/resource/v1/person/personCode/personInfo
Method: POST
Body: JSON

Sample Request:

{ "personCode": student_number }

Sample Response: (if student exists)

Sample Response: (if student doesn’t exist)

Take note that personId and personCode is two different data. personCode is the student number, while personId is the ID which is auto generated by HCP.

personId is used to update the details and photo of a student record.

Edit a person's information (Except photo)

This endpoint is mainly used when updating the Effective Period and Remark of a student record. This endpoint cannot be used to update photo.

URL: */artemis/api/resource/v1/person/single/update
Method: POST
Body: JSON

Sample Request:

Sample Response:

Edit the information of face linked with the person

This endpoint is used when editing the photo of a student record.

URL: */artemis/api/resource/v1/person/face/update
Method: POST
Body: JSON

Sample Request:

Sample Response:

Copyright © Asia Pacific University. All Rights Reserved.