2024-07-26 11:20:20 +00:00
|
|
|
# testnet-onboarding-api
|
|
|
|
|
|
|
|
* Install dependencies and build:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
yarn && yarn build
|
|
|
|
```
|
|
|
|
|
|
|
|
* Configure required tokens:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cp .env.example .env
|
|
|
|
|
|
|
|
# Set the sumsub app token and secret key in .env
|
|
|
|
```
|
|
|
|
|
|
|
|
* Start the server:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
yarn start
|
|
|
|
```
|
|
|
|
|
|
|
|
* Usage:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
curl -X POST http://localhost:3000/generate-token \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-d '{"userId": "<user-id>", "levelName": "[kyc-level]", "ttlInSecs": "[token-ttl-in-secs]"}'
|
|
|
|
|
|
|
|
# Optional:
|
|
|
|
# levelName (default: basic-kyc-level)
|
|
|
|
# ttlInSecs (default: 600)
|
|
|
|
```
|
|
|
|
|
|
|
|
* Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
curl -X POST http://localhost:3000/generate-token \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-d '{"userId": "JamesBond007"}'
|
|
|
|
|
|
|
|
# Expected output:
|
|
|
|
# {"token":"<generated-token>"}
|
|
|
|
```
|