Header Not Updating
# support
e
curl -X PATCH https://api.vapi.ai/tool/92f27658-0710-4c4d-90f4-21e01b86389e \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "function": { "name": "abcdder" }, "server": { "url": "https://users.dedyn.io:8000/update-redis", "headers": { "X-HTTP-Method-Override": "PUT" } } }' WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. INFO: 49.36.144.230:60180 - "GET /get-redis/username HTTP/1.1" 200 OK INFO: 49.36.144.230:60181 - "GET /get-redis/name HTTP/1.1" 404 Not Found INFO: 49.36.144.230:60187 - "GET /get-redis/key HTTP/1.1" 404 Not Found WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. WARNING: Invalid HTTP request received. ubuntu@Vapi-tester:~$
Attaching code as well from fastapi import FastAPI, HTTPException from pydantic import BaseModel import redis import os from dotenv import load_dotenv # Load environment variables load_dotenv() # Initialize FastAPI app = FastAPI() # Connect to Redis REDIS_HOST = os.getenv("REDIS_HOST", "localhost") REDIS_PORT = int(os.getenv("REDIS_PORT", 6379)) redis_client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, decode_responses=True) # Request model class RedisUpdateRequest(BaseModel): key: str value: str @app.post("/update-redis") async def update_redis(data: RedisUpdateRequest): "" Updates or adds a key-value pair in Redis. """ try: redis_client.set(data.key, data.value) return {"message": "Data stored successfully", "key": data.key, "value": data.value} except Exception as e: raise HTTPException(status_code=500, detail=f"Redis Error: {str(e)}" Doing tis to test assisant tool integration @Vapi @Shubham Bajaj
v
It looks like you're encountering multiple "Invalid HTTP request received" warnings when trying to make a PATCH request to the Vapi API. Here are some common reasons for this issue and how you can troubleshoot it: 1. **Authorization Header**: It seems that your
Authorization
header is missing the actual API key. Make sure to include your API key in the format:
Bearer YOUR_VAPI_API_KEY
. 2. **Endpoint URL**: Double-check that the endpoint URL (
https://api.vapi.ai/tool/92f27658-0710-4c4d-90f4-21e01b86389e
) is correct and that the resource exists. If the resource ID is incorrect or the endpoint has changed, it could lead to errors. 3. **Request Body Format**: Ensure that the JSON structure in your request body is correct. The body should match the expected format as per the Vapi API documentation. For example, make sure that all required fields are included and properly formatted. 4. **Network Issues**: Sometimes, network configurations or firewalls can interfere with API requests. Ensure that your network allows outgoing requests to the Vapi API. 5. **Check API Documentation**: Always refer to the official Vapi API documentation for any specific requirements regarding PATCH requests, including headers and body structure. If you continue to face issues, consider checking server logs for more detailed error messages or reaching out to Vapi support for further assistance. Let me know if you need help with anything else! 😊 Sources: - [Common Reasons for Receiving "Invalid HTTP request received" Warnings with Vapi API](https://discord.com/channels/1211482211119796234/1211483291191083018/1328923059905630238) - [Detailed Report on Making PATCH Requests to the Vapi API](https://discord.com/channels/1211482211119796234/1211483291191083018/1341692740454584331)
e
{"id":"3915ad95-b9ef-4db7-a306-ce9c74146146","createdAt":"2025-03-04T00:31:19.777Z","updatedAt":"2025-03-04T00:31:19.777Z","type":"function","function":{"name":"updaters","description":"Stores or updates a value in Redis.","parameters":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"messages":[{"type":"request-start","content":"Updating Redis data..."},{"type":"request-complete","content":"Redis updated successfully!"},{"type":"request-failed","content":"Failed to update Redis."}],"orgId":"adeacfd3-6364-4943-825f-b24433b25ed4","server":{"url":"https://users.dedyn.io:8000/update-redis","timeoutSeconds":20,"headers":{"Content-Type":"application/json","X-HTTP-Method-Override":"POST"}},"async":true}%
@Shubham @Sahil @Vapi redis/Vishal {"detail":"Key not found in Redis"}% rishabhbhanot@Rishabhs-MacBook-Pro ~ % curl -X GET http://206.1.53.26:8000/get-redis/Rishab {"detail":"Key not found in Redis"}% rishabhbhanot@Rishabhs-MacBook-Pro ~ % { "role": "tool_calls", "time": 1741048963301, "message": "", "toolCalls": [ { "id": "call_p8ny", "type": "function", "function": { "name": "updaterds", "arguments": "{"key": "Rishab", "value": "Thing"}" } } ], "secondsFromStart": 52.269 }
@Sahil
Why am I getting GET request instead of POST request
@Shubham Bajaj
7:23:37:224 [ERROR] tool-calls Server URL Error: write EPROTO C08CB588527F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354: getting this in the logs
Its solved please close the ticket
k
Marking this ticket as Solved ✅