Skip to content

Latest commit

 

History

History
104 lines (89 loc) · 2.12 KB

File metadata and controls

104 lines (89 loc) · 2.12 KB

API Testing Examples

Authentication

Register User

curl -X POST http://localhost:3001/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "johndoe",
    "email": "john@example.com",
    "password": "password123",
    "fullName": "John Doe"
  }'

Login

curl -X POST http://localhost:3001/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "johndoe",
    "password": "password123"
  }'

Identity Management

Create Identity

# Replace TOKEN with the JWT token from login
curl -X POST http://localhost:3001/api/identity/create \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer TOKEN" \
  -d '{
    "personalInfo": {
      "firstName": "John",
      "lastName": "Doe",
      "dateOfBirth": "1990-01-01",
      "nationality": "US"
    }
  }'

Get My Identity

curl -X GET http://localhost:3001/api/identity/me \
  -H "Authorization: Bearer TOKEN"

Document Management

Upload Document

curl -X POST http://localhost:3001/api/documents/upload \
  -H "Authorization: Bearer TOKEN" \
  -F "document=@/path/to/document.pdf" \
  -F "documentType=passport" \
  -F "description=Government issued passport"

List Documents

curl -X GET http://localhost:3001/api/documents/list \
  -H "Authorization: Bearer TOKEN"

Credentials

Issue Credential

curl -X POST http://localhost:3001/api/credentials/issue \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer TOKEN" \
  -d '{
    "userId": "USER_ID",
    "type": "identity_verification",
    "subject": {
      "verified": true,
      "level": "basic"
    },
    "expirationDate": "2024-12-31T23:59:59Z"
  }'

Get My Credentials

curl -X GET http://localhost:3001/api/credentials/my-credentials \
  -H "Authorization: Bearer TOKEN"

Dashboard

Get Overview

curl -X GET http://localhost:3001/api/dashboard/overview \
  -H "Authorization: Bearer TOKEN"

Get Activity Feed

curl -X GET http://localhost:3001/api/dashboard/activity \
  -H "Authorization: Bearer TOKEN"