How to get console token for ragflow after login using api? #12022
-
|
How to get console token for ragflow after login using api?I did not see any response results in the login api |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The console token (session token) for RAGFlow is not returned in the JSON body of the login API response. Instead, after you log in with import requests
url = "http://your-ragflow-host/v1/user/login"
data = {"email": "your_email", "password": "your_encrypted_password"}
resp = requests.post(url, json=data)
token = resp.headers["Authorization"]
print(token)Use this token as Note: The password must be RSA-encrypted and base64-encoded using the public key from References:
To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
The console token (session token) for RAGFlow is not returned in the JSON body of the login API response. Instead, after you log in with
POST /v1/user/login, the token is sent in the HTTP response headers under theAuthorizationfield. You need to extract it from the headers, not the body. Here’s a Python example:Use this token as
Authorization: <token>(noBearerprefix) in subsequent API requests. If you need an API key (for endpoints that require it), send aPOSTto/…