Integration

We offer a comprehensive range of services and technical support to ensure a seamless integration with our PoH service.

Basic Info

1. Dev

RESTful endpoint URL: https://face-dev.privasea.ai

We will provide API KEY & API SECRET for our partners

General API information

PRIVASEA-KEY and PRIVASEA-SIGNATURE parameters in headers, are required in all requests.

| Parameter | Field | Type | Description | :--- | :--- | :--- | :--- | | PRIVASEA-KEY | header | string | API Key | PRIVASEA-SIGNATURE | header | string | Signature

For the GET endpoint, the additional parameter must be sent in the query string

For POST and DELETE endpoints, additional parameters must be sent in the request body, and the content should be application/json

0 value of all number type parameters will be ignored.

Response Message

Responses of all RESTful endpoints are JSON data, which contains

| Name | Type | Description | :--- | :--- | :--- | | code | header | 0 for success | timestamp | number | Response timestamp (millisecond) | msg | string | Description of this request | error | string | A failed response contains error message | data | object | A successful response contains business data

2. Authentication

Signature Description

All endpoints must be signed and authenticated with your API Key to verify that parameters or values have not been modified in transit.

Signing

  1. Set query parameters as key-value pairs: key=value (signature-related value must not be URL-encoded).
  2. Sort the key-value pairs in ascending ASCII order by key and concatenate with & (include timestamp).
  3. Concatenate the above result after PATH with ? to generate PATH_URL.
  4. Concatenate METHOD and PATH_URL.
  5. Concatenate related entity body of POST and DELETE after step 5. Skip this step if there is no entity-body.
  6. Use API Secret and the above result to generate HMAC SHA256 code, then convert it to hexadecimal.
  7. Assign the hex result to PRIVASEA-SIGNATURE, add it to the Header, and send the request.

For Example:

User's API Secret is:

Secret:123456

The base part of the request to get verify code is:

GET /api/v1/verification/channel_code

Step 1, set query parameters as key-value pairs: key=value

  channel=ABC

  expire_at=30

  operation_type=0

Step 2, Sort the key-value pairs in ascending ASCII order by key and concatenate with &

channel=ABC&channel_user_id=1&expire_at=30&operation_type=0

Step 3, concatenate the above result after PATH with ? to generate PATH_URL.

/api/v1/verification/channel_code?channel=ABC&channel_user_id=1&expire_at=30&operation_type=0

Step 4, concatenate METHOD and PATH_URL.

GET/api/v1/verification/channel_code?channel=ABC&channel_user_id=1&expire_at=30&operation_type=0

Step 5, Concatenate related entity body of POST and DELETE after step 4. Skip this step if there is no entity-body.

b'GET/api/v1/verification/channel_code?channel=ABC&channel_user_id=1&expire_at=30&operation_type=0

Step 6, Use API Secret and the above result to generate HMAC SHA256 code, then convert it to hexadecimal.

For example:

API

1. The Interface of Get VerifyCode

GET /api/v1/verification/link_code

Request:

| Parameter | Type | Must | Description | :--- | :--- | :--- | :--- | | channel | string | true | channel name | channel_user_id | string | true | The unique identification mark of the platform user, this can be a user id or a wallet address or others. | expire_at | number | true | The expiration time is the current time + the set number of minutes. If it is 0, the default expiration time is 15 minutes | operation_type | number | true | Enter 0 or 1. 0 indicates the verification code for generating the Link operation. 1 indicates the verification code for generating the UnLink operation

Response:

| Parameter | Type | Description | :--- | :--- | :--- | | linkcode | string | one-time passcode for link request. code in the data object | created_at | number | The time when the code was generated | expire_at | number | The time when the code was generated + expired, millisecond timestamp | channel | string | channel name | channel_user_id | string | The unique identification mark of the platform user, this can be a user id or a wallet address or others. | user_id | number | The unique id of the ImHuman APP user, 0 indicates that the user does not link | operation_type | number | 0 indicates the verification code for generating the Link operation. 1 indicates the verification code for generating the UnLink operation

For Example:

{

    "code": 0,

    "data": {

        "id": 1,

        "created_at": "2024-09-27T10:14:09.297+08:00",

        "updated_at": "2024-09-27T10:14:09.297+08:00",

        "deleted_at": null,

        "channel": "ABC",

        "channel_user_id": "1", 

        "code": "sSnvfP",

        "operation_type": 0, // 0 indicates that the user does not link

        "user_id": 0,

        "expire_at": 1727517600

    },

    "msg": "ok",

    "timestamp": 1727403250336

}

Interface call successful signs:

  1. code= 0;
  2. data is not empty

Error response:

{

    "code": 200403,

    "error": "PRIVASEA-SIGNATURE is invalid",

    "msg": "Unauthorized",

    "timestamp": 1727425273894

}

Interface call unsuccessful signs:

2. The Interface of Query Link

GET /api/v1/verification/query_link

The request flow is as follows:

(1)Obtain the verification code through interface of Get VerifyCode, the operation_type is 0;

(2)Return to ImHuman APP, select link Channel, enter the verification code for link operation

(3)Query whether the user has completed the link by the verification code

Request:

| Parameter | Type | Must | Description | :--- | :--- | :--- | :--- | | channel | string | true | channel name | channel_user_id | string | true | The unique identification mark of the platform user, this can be a user id or a wallet address or others. | linkcode | string | true | verify code

Response:

| Parameter | | | Type | Description | | :--- | :--- | :--- | :--- | :--- | | user_name | | | string | user name created in ImHuman APP | chain | | | string | blockchain where ImHuman NFT is minted | address| | | string | owner's wallet address in Imhuman APP | poh | | | object | | | face-nft | | object | | | | id | number | NFT ID | | | symbol | string | NFT symbol | | | uri | string | uri | | | created_at | date | The time when the NFT is created | | | updated_at | date | The time when the NFT is updated | | | rarity | string | NFT rarity | | | name | string | user name created in ImHuman APP | | | user_id | number | | | | chain | string | blockchain where ImHuman NFT is minted | | voice-nft | | object | | | | id | number | NFT ID | | | symbol | string | NFT symbol | | | uri | string | uri | | | created_at | date | The time when the NFT is created | | | updated_at | date | The time when the NFT is updated | | | rarity | string | NFT rarity | | | name | string | user name created in ImHuman APP | | | user_id | number | | | | chain | string | blockchain where ImHuman NFT is minted | | unique-score | | object | | | | user_id | number | | | | score | number |

For Example:

{

    "code": 0,

    "data": {

        "address": "0xbcb458Ce9fB43369b81c8B4D36917f9621108d4C",

        "chain": "Arbitrum",

         "poh": {

        "face-nft": {

            "id": 1004,

            "created_at": "2024-09-20T02:25:12.012Z",

            "updated_at": "2024-09-20T02:25:14.476Z",

            "deleted_at": null,

            "user_id": 581,

            "name": "face token #1004",

            "symbol": "PRT",

            "rarity": "Super common",

            "uri": "https://storage.googleapis.com/privasea-face/metadata/1004-metadata.json",

            "image_uri": "https://storage.googleapis.com/privasea-face/avatar/1004-avatar.png",

            "face_uri": "https://storage.googleapis.com/privasea-face/vector/1004-vector.json",

            "Attributes": "{\"type\":\"Super common\",\"helix_alpha\":\"Indigo Dye\",\"helix_beta\":\"Pastel Blue\",\"zebra\":\"Tufts Blue\"}",

            "chain": "Arbitrum"

        }

    }

        "user_name": "cxltest07"

    },

    "msg": "ok",

    "timestamp": 1727429806953

}

Interface call successful signs:

  1. code= 0;
  2. data is not empty

Error response:

{

    "code": 200403,

    "error": "PRIVASEA-SIGNATURE is invalid",

    "msg": "Unauthorized",

}

3. The Interface of Query UnLink

Note:We do not recommend that you implement this feature in your app or website, as it may cause errors in our points system or lead to confusion in binding information. We provide this API for your reference in case of need.

GET /api/v1/verification/query_unlink

Request:

| Parameter | Type | Must | Description | :--- | :--- | :--- | :--- | | channel | string | true | always input your channel name | channel_user_id | string | true | The unique identification mark of the platform user, this can be a user id or a wallet address or others. | code | string | true | verify code

Response:

| Parameter | Type | Description | :--- | :--- | :--- | | unlink_status | boolean | The unlinking status | message | string | message

For Example:

{

    "code": 0,

    "data": {

       “message”:”unlink successful”,,

        "unlink_status": true

    },

    "msg": "ok",

    "timestamp": 1727427295325

}

Explanation: If verify_status is true, the verification code passes. You can perform the unlinking operation

Interface call successful signs:

  1. code= 0;
  2. data is not empty
  3. The  unlink_status value can be used to determine whether the operation is done

Error response:

{

    "code": 200404,

    "error": "verify code is not found",

    "msg": "NotFound",

    "timestamp": 1727426789961

}

4. The Interface of One Time Verify

1. Get verify code

GET /api/v1/verification/verify_code

Request:

| Parameter | Type | Must | Description | :--- | :--- | :--- | :--- | | channel | string | true | channel name | channel_user_id | string | true | The unique identification mark of the platform user, this can be a user id or a wallet address or others. | order_id | string | true | The order number for this operation can be a timestamp or something else | expire_time | number | false | The expiration time is the current time + the set number of minutes. If it is 0, the default expiration time is 15 minutes

Response:

| Name | Type | Description | :--- | :--- | :--- | | verify_code | string | Verification code | expire_time | number | Verification code expiration time,millisecond timestamp

For Example:

{

    "code": 0,

    "data": {

        "verify_code": "8gHRDs",

        "expire_time": 1727427914

    },

    "msg": "ok",

    "timestamp": 1727427295325

}

Error response:

{

    "code": 200404,

    "error": "The UID has no Link",

    "msg": "NotFound",

    "timestamp": 1727426789961

}

2. Get verify status

GET /api/v1/verification/verify_status

Request:

| Parameter | Type | Must | Description | :--- | :--- | :--- | :--- | | channel | string | true | channel name | channel_user_id | string | true | The unique identification mark of the platform user, this can be a user id or a wallet address or others. | order_id | string | true | The order number for this operation can be a timestamp or something else

Response:

| Parameter | Type | Description | :--- | :--- | :--- | | verify_status | number | Verification status,0 means no operation, 1 means verification successful, 2 means verification failed, and 3 means not yourself

For Example:

{

    "code": 0,

    "data": {

        "verify_status": 1  // 0 means no operation, 1 means verification successful, 2 means verification failed, and 3 means not yourself 

    },

    "msg": "ok",

    "timestamp": 1727427295325

}

Error response:

{

    "code": 200404,

    "error": "Response timed out.",

    "msg": "NotFound",

    "timestamp": 1727426789961

}

Join us on

Drop us a message

If you would like to know more about the solution we are building or if you want to collaborate in any way, please feel free to reach out on email contact@privasea.tech or fill in the form here

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.