# 认证

在浏览器中打开 <https://t.me/apmfun_bot?start=connect> ，按照提示获取 Access Code。然后通过以下接口发送该 Access Code，即可获取 JWT token。

## Login with Access Code

> Authenticate user with access code and return JWT token

```json
{"openapi":"3.0.3","info":{"title":"Bitbot Authentication API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"User authentication and session management operations"}],"servers":[{"url":"https://api.apm-api.com","description":"Production Environment"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT access token authentication"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"System API key authentication"}}},"paths":{"/login/access-code":{"post":{"tags":["Authentication"],"summary":"Login with Access Code","description":"Authenticate user with access code and return JWT token","operationId":"loginWithAccessCode","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Access code"}}}}}},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"token":{"type":"string","description":"JWT access token"},"tokenType":{"type":"string"},"user":{"type":"object","properties":{"user_id":{"type":"integer"},"email":{"type":"string"},"username":{"type":"string"}}}}},"msg":{"type":"string"}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"msg":{"type":"string"}}}}}}}}}}}
```
