Code Examples
This page provides practical examples for interacting with the Model Results API using both Python and PHP. The Model Results API allows you to retrieve paginated outputs from your Graphite Note model
Python code example
import requests
# Replace {model-code} with your specific model code
url = "https://test-app.graphite-note.com/api/model/fetch-result/{model-code}"
# Insert your Graphite Note tenant token
headers = {
"Authorization": "Bearer YOUR-TENANT-TOKEN",
"Content-Type": "application/json"
}
# Request payload
payload = {
"page": 1,
"page-size": 10000
}
try:
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status() # Raises an exception for 4XX/5XX errors
# Parse JSON response
data = response.json()
print("Request successful!")
print("Response Data:", data)
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")PHP Code Example
Tips & Best Practices
Last updated
Was this helpful?

