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 and configuring the prompt, scorer, and voice agent, refer to the Voice Agent Tutorial.

Before You Get Started

In order to set up and run a Hamming voice agent programmatically, you need to have your Dataset ID and Agent ID ready.

Step-by-Step Tutorial

1

Initiate Agent Test Run

This initiates a series of parallel calls, referred to as a Voice Experiment.

POST https://app.hamming.ai/api/rest/voice-agent/{agent_id}/run

Request Body:
{ "to_number": "+12063991234", "dataset_id": "{dataset_id}"}

Response:
{ "voice_experiment_id" }

2

Obtain Voice Experiment Status

This endpoint can be used to check the status of the Voice Experiment.

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.

GET https://app.hamming.ai/api/rest/voice-experiment/{voice_experiment_id}/calls

Response:
{
    "calls": [
       // Array of calls that were run as part of the voice experiment
       // Each call object will include the scoring status.
    ]
}