Endpoint: GET /v2/task/{task_id}
This endpoint allows you to retrieve the current status of a specific task. This is useful for tracking the progress of ongoing tasks or retrieving the results once a task is completed. The task ID is required to fetch the corresponding task details.
Parameters
The unique identifier of the task.
curl -X GET "https://agent.api.lyzr.app/v2/task/{task_id}" \
-H "accept: application/json"\
-H "x-api-key: your_Lyzr_API_Key_Here"
import requests
# Define the task ID
task_id = "91b97d32-0e60-4e75-89xxxxxx"
# Define the API URL
url = f"https://agent.api.lyzr.app/v2/task/{task_id}"
# Define the headers
headers = {
"Accept": "application/json",
"x-api-key": "your_Lyzr_API_Key_Here"
}
response = requests.get(url, headers=headers)
{
"task_id": "91b97d32-0e60-4e75-89xxxxxx",
"status": "completed",
"result": {
"response": "I'm here to assist you with property recommendations! Please provide me with your requirements or preferences for the type of property you're looking for, and I'll recommend the best options for you."
}
}
Response Parameters
The unique identifier of the task.
The current status of the task (e.g., “pending”, “completed”)
The result of the task, if completed.
The agent’s response to the task.