Test Suite - Test Server Url
# support
g
How do i configure a test case for my server url?
v
Hi there! 👋 I don't have specific information about your particular server implementation, but I can definitely help with how to configure a test case for a server URL in Vapi generally. Here's how you can configure a test case for your server URL: ## 1. Create a Test Suite First, you'll need to create a test suite: - Navigate to the Test tab and select Test Suites - Click the Create Test Suite button - Alternatively, use the API endpoint:
POST /test-suite
with your authentication token
Copy code
bash
curl -X POST https://api.vapi.ai/test-suite \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{"name": "Your Test Suite Name"}'
## 2. Add a Test Case After creating your test suite: - Click "Add Test" to add a new test case - Or use the API endpoint:
POST /test-suite/:testSuiteId/test
Copy code
bash
curl -X POST https://api.vapi.ai/test-suite/testSuiteId/test \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "type": "voice",
  "scorers": [
    {
      "type": "ai",
      "rubric": "rubric"
    }
  ],
  "script": "script"
}'
## 3. Configure Server URL You can configure your server URL at different levels in Vapi, with the following order of precedence: 1. Function level (highest priority) 2. Assistant level 3. Phone Number level 4. Account-wide level (lowest priority) According to the [server URL documentation](https://docs.vapi.ai/server-url/setting-server-urls), you can set these URLs in the dashboard or via API. ## 4. Server Configuration Parameters When configuring your server, you can set these parameters:
Copy code
json
"server": {
    "url": "https://your-server-url.com/endpoint",
    "headers": {
      "Authorization": "Bearer your_token"
    },
    "timeoutSeconds": 30
}
## 5. Testing Your Server URL For testing, you can: - Use [ngrok](https://docs.vapi.ai/server-url/developing-locally) to expose your local server: ```bash
ngrok http 8080 # Replace with your port
Copy code
Then use the forwarding URL as your server URL in Vapi

- Test with cURL to send requests directly to your endpoint:
  ```bash
  curl -X POST https://your-server-url.com/endpoint \
       -H "Content-Type: application/json" \
       -d '{"your": "payload"}'
- Inspect API endpoints and review logs to identify any issues Is there anything specific about configuring your server URL test case that you'd like me to elaborate on? Sources: - [Server URL documentation](https://docs.vapi.ai/server-url/setting-server-urls) - [Server URL developing locally](https://docs.vapi.ai/server-url/developing-locally) - [Test Suite API documentation](https://docs.vapi.ai/api-reference/test-suite-tests/test-suite-test-controller-create)
v
checking if this is resolved/solved for you?
g
No I wasn't able to set my server url on the test case
v
You can raise an feature request for it over here: https://roadmap.vapi.ai