Learn how to run a Hamming Test Agent Programmatically
Important: Before running your Hamming test agent using the API, ensure your test agent is properly set up. For a detailed, step-by-step guide on creating a dataset of scenarios and configuring the prompt, scorer, and voice agent, refer to the Voice Agent Tutorial.
In order to set up and run a Hamming voice agent programmatically, you need to have your Dataset ID and Agent ID ready.
Finding Your Dataset ID
To locate your Dataset ID, visit hamming.ai/datasets
On the right side of the dataset, select “Copy ID” to retrieve your ID.
Finding Your Agent ID
To find your Agent ID, go to hamming.ai/voice-agents
and select the name of the voice agent. Your Agent ID is located in the URL immediately following “voice-agents/”.For example, cm1rb0m3600ybxzwm69d7fvst represents the Agent ID.
This initiates a series of parallel calls, referred to as a Voice Experiment.
Copy
Ask AI
POST https://app.hamming.ai/api/rest/voice-agent/{agent_id}/runRequest Body:{ "to_number": "+12063991234", "dataset_id": "{dataset_id}"} // Use your Dataset ID here for the scenario collectionResponse:{ "voice_experiment_id" }
2
Obtain Voice Experiment Status
This endpoint can be used to check the status of the Voice Experiment.
Copy
Ask AI
GET https://app.hamming.ai/api/rest/voice-experiment/{voice_experiment_id}Response:{ "id": "voice_experiment_id", "status": "FINISHED" }
3
Obtain Voice Experiment Calls
After the experiment is FINISHED, you can retrieve the score results for the experiment.
Copy
Ask AI
GET https://app.hamming.ai/api/rest/voice-experiment/{voice_experiment_id}/callsResponse:{ "calls": [ // Array of calls that were run as part of the voice experiment // Each call object will include the scoring status. ]}
4
Direct Agent Connections (Without Telephony)
For direct agent-to-agent connections without traditional telephony integration, you can use the createLivekitRooms API: