Get Task by ID
client.tasks.retrieve(stringtaskID, TaskRetrieveParams { relationships } query?, RequestOptionsoptions?): TaskRetrieveResponse { id, agents, cleaned_at, 7 more }
GET/tasks/{task_id}
Get Task by ID
import Agentex from 'agentex';
const client = new Agentex({
apiKey: process.env['AGENTEX_SDK_API_KEY'], // This is the default and can be omitted
});
const task = await client.tasks.retrieve('task_id');
console.log(task.id);{
"id": "id",
"agents": [
{
"id": "id",
"acp_type": "sync",
"created_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"name": "name",
"updated_at": "2019-12-27T18:11:19.117Z",
"agent_input_type": "text",
"production_deployment_id": "production_deployment_id",
"registered_at": "2019-12-27T18:11:19.117Z",
"registration_metadata": {
"foo": "bar"
},
"status": "Ready",
"status_reason": "status_reason"
}
],
"cleaned_at": "2019-12-27T18:11:19.117Z",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"params": {
"foo": "bar"
},
"status": "CANCELED",
"status_reason": "status_reason",
"task_metadata": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z"
}Returns Examples
{
"id": "id",
"agents": [
{
"id": "id",
"acp_type": "sync",
"created_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"name": "name",
"updated_at": "2019-12-27T18:11:19.117Z",
"agent_input_type": "text",
"production_deployment_id": "production_deployment_id",
"registered_at": "2019-12-27T18:11:19.117Z",
"registration_metadata": {
"foo": "bar"
},
"status": "Ready",
"status_reason": "status_reason"
}
],
"cleaned_at": "2019-12-27T18:11:19.117Z",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"params": {
"foo": "bar"
},
"status": "CANCELED",
"status_reason": "status_reason",
"task_metadata": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z"
}