mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
Document flow's API under /v1
Claude-Session: https://claude.ai/code/session_011i2AG9nwpiKUCVxAdDzYuU
This commit is contained in:
+1
-1
@@ -13,6 +13,6 @@ payload = {
|
||||
"password": "securepassword123",
|
||||
}
|
||||
|
||||
response = requests.post(f"{base}/api/v1/users/", headers=headers, json=payload, timeout=30)
|
||||
response = requests.post(f"{base}/v1/users/", headers=headers, json=payload, timeout=30)
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ api_key = os.environ.get("FLOW_API_KEY", "")
|
||||
headers = {"accept": "application/json", "Content-Type": "application/json", "x-api-key": api_key}
|
||||
|
||||
create = requests.post(
|
||||
f"{base}/api/v1/users/",
|
||||
f"{base}/v1/users/",
|
||||
headers=headers,
|
||||
json={"username": f"docsdel_{uuid.uuid4().hex[:12]}", "password": "securepassword123"},
|
||||
timeout=30,
|
||||
@@ -17,6 +17,6 @@ create = requests.post(
|
||||
create.raise_for_status()
|
||||
user_id = create.json()["id"]
|
||||
|
||||
delete = requests.delete(f"{base}/api/v1/users/{user_id}", headers=headers, timeout=30)
|
||||
delete = requests.delete(f"{base}/v1/users/{user_id}", headers=headers, timeout=30)
|
||||
delete.raise_for_status()
|
||||
print(delete.text)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('FLOW_URL', '')}/api/v1/users/whoami"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/users/whoami"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('FLOW_URL', '')}/api/v1/users/?skip=0&limit=10"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/users/?skip=0&limit=10"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ api_key = os.environ.get("FLOW_API_KEY", "")
|
||||
|
||||
headers = {"Content-Type": "application/json", "x-api-key": api_key}
|
||||
|
||||
who = requests.get(f"{base}/api/v1/users/whoami", headers=headers, timeout=30)
|
||||
who = requests.get(f"{base}/v1/users/whoami", headers=headers, timeout=30)
|
||||
who.raise_for_status()
|
||||
user_id = who.json()["id"]
|
||||
|
||||
@@ -15,7 +15,7 @@ user_id = who.json()["id"]
|
||||
payload = {"password": "DocsExampleResetPass2025!"}
|
||||
|
||||
response = requests.patch(
|
||||
f"{base}/api/v1/users/{user_id}/reset-password",
|
||||
f"{base}/v1/users/{user_id}/reset-password",
|
||||
headers=headers,
|
||||
json=payload,
|
||||
timeout=30,
|
||||
|
||||
+2
-2
@@ -7,12 +7,12 @@ api_key = os.environ.get("FLOW_API_KEY", "")
|
||||
|
||||
headers = {"Content-Type": "application/json", "x-api-key": api_key}
|
||||
|
||||
who = requests.get(f"{base}/api/v1/users/whoami", headers=headers, timeout=30)
|
||||
who = requests.get(f"{base}/v1/users/whoami", headers=headers, timeout=30)
|
||||
who.raise_for_status()
|
||||
user_id = who.json()["id"]
|
||||
|
||||
payload = {"is_active": True}
|
||||
|
||||
response = requests.patch(f"{base}/api/v1/users/{user_id}", headers=headers, json=payload, timeout=30)
|
||||
response = requests.patch(f"{base}/v1/users/{user_id}", headers=headers, json=payload, timeout=30)
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
|
||||
Reference in New Issue
Block a user