Get Protégé trajectory
/v1/protege/{jobId}/trajectoryAuthorization
Send a Modaic bearer token in the Authorization header.
Path Parameters
Protégé job ID.
The response is the complete trajectory available at request time, encoded as
newline-delimited JSON with the application/x-ndjson content type. Each
nonempty line is an ACP v1 JSON-RPC record.
import json
import os
import requests
response = requests.get(
"https://modaic.dev/api/v1/protege/44444444-4444-4444-8444-444444444444/trajectory",
headers={"Authorization": f"Bearer {os.environ['MODAIC_API_KEY']}"},
)
response.raise_for_status()
trajectory = [json.loads(line) for line in response.iter_lines() if line]
While a job is running, poll this endpoint to receive all records flushed so
far. A completed job returns its complete final trajectory. Before the first
record is available, the endpoint returns 200 OK with an empty body and
X-Modaic-Trajectory-Available: false.
The response includes:
X-Modaic-Trajectory-Available: whether a trajectory snapshot exists.X-Modaic-Job-Running: whether the job is still active.ETag: the identity of the current complete snapshot. Send it inIf-None-Matchon the next request to receive304 Not Modifiedwhen the trajectory has not changed.
The caller must have access to the job's repository. Inaccessible and unknown
jobs both return 404 protege_job_not_found.