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
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('FLOW_URL', '')}/api/v1/projects/"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/projects/"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('FLOW_URL', '')}/api/v1/projects/"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/projects/"
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ api_key = os.environ.get("FLOW_API_KEY", "")
|
||||
headers = {"accept": "*/*", "Content-Type": "application/json", "x-api-key": api_key}
|
||||
|
||||
create = requests.post(
|
||||
f"{base}/api/v1/projects/",
|
||||
f"{base}/v1/projects/",
|
||||
headers=headers,
|
||||
json={
|
||||
"name": "docs-example-delete-me",
|
||||
@@ -21,6 +21,6 @@ create = requests.post(
|
||||
create.raise_for_status()
|
||||
project_id = create.json()["id"]
|
||||
|
||||
delete = requests.delete(f"{base}/api/v1/projects/{project_id}", headers=headers, timeout=30)
|
||||
delete = requests.delete(f"{base}/v1/projects/{project_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/projects/download/{os.getenv('PROJECT_ID', '')}"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/projects/download/{os.getenv('PROJECT_ID', '')}"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import_path = Path(os.environ.get("PROJECT_IMPORT_JSON", str(default_json)))
|
||||
headers = {"accept": "application/json", "x-api-key": api_key}
|
||||
|
||||
files = {"file": (import_path.name, import_path.read_bytes(), "application/json")}
|
||||
response = requests.post(f"{base}/api/v1/projects/upload/", headers=headers, files=files, timeout=60)
|
||||
response = requests.post(f"{base}/v1/projects/upload/", headers=headers, files=files, timeout=60)
|
||||
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('FLOW_URL', '')}/api/v1/projects/{os.getenv('PROJECT_ID', '')}"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/projects/{os.getenv('PROJECT_ID', '')}"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('FLOW_URL', '')}/api/v1/projects/"
|
||||
url = f"{os.getenv('FLOW_URL', '')}/v1/projects/"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
|
||||
+1
-1
@@ -14,6 +14,6 @@ payload = {
|
||||
"description": "Updated via API docs Python example",
|
||||
}
|
||||
|
||||
response = requests.patch(f"{base}/api/v1/projects/{project_id}", headers=headers, json=payload, timeout=30)
|
||||
response = requests.patch(f"{base}/v1/projects/{project_id}", headers=headers, json=payload, timeout=30)
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
|
||||
Reference in New Issue
Block a user