mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 11:40:25 +00:00
80 lines
2.5 KiB
HTTP
80 lines
2.5 KiB
HTTP
### ============================================
|
|
### Eigent Server API Tests
|
|
### ============================================
|
|
### VSCode Extension: "REST Client" by Huachao Mao
|
|
### Extension ID: humao.rest-client
|
|
### ============================================
|
|
|
|
@baseUrl = http://localhost:3001/api
|
|
@token = YOUR_TOKEN_HERE
|
|
|
|
### ──────────────────────────────────────────
|
|
### Auth (no token required)
|
|
### ──────────────────────────────────────────
|
|
|
|
### Register a new user
|
|
POST {{baseUrl}}/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "test@example.com",
|
|
"password": "testpassword123"
|
|
}
|
|
|
|
### Login
|
|
# @name login
|
|
POST {{baseUrl}}/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "test@example.com",
|
|
"password": "testpassword123"
|
|
}
|
|
|
|
### Save token from login response (use this after running login)
|
|
@authToken = {{login.response.body.token}}
|
|
|
|
### ──────────────────────────────────────────
|
|
### User
|
|
### ──────────────────────────────────────────
|
|
|
|
### Get current user info
|
|
GET {{baseUrl}}/user
|
|
Authorization: Bearer {{authToken}}
|
|
|
|
### ──────────────────────────────────────────
|
|
### Privacy Settings
|
|
### ──────────────────────────────────────────
|
|
|
|
### Get privacy settings
|
|
GET {{baseUrl}}/user/privacy
|
|
Authorization: Bearer {{authToken}}
|
|
|
|
### Update privacy settings
|
|
PUT {{baseUrl}}/user/privacy
|
|
Authorization: Bearer {{authToken}}
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"take_screenshot": true,
|
|
"access_local_software": false,
|
|
"access_your_address": false,
|
|
"password_storage": false
|
|
}
|
|
|
|
### Update only help_improve
|
|
PUT {{baseUrl}}/user/privacy
|
|
Authorization: Bearer {{authToken}}
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"help_improve": true
|
|
}
|
|
|
|
### ──────────────────────────────────────────
|
|
### User Stats
|
|
### ──────────────────────────────────────────
|
|
|
|
### Get user stats
|
|
GET {{baseUrl}}/user/stat
|
|
Authorization: Bearer {{authToken}}
|