How can I check the status code of an HTTP request...
# support
i
I have the following tool:
Copy code
{
      "name": "checkArea",
      "type": "tool",
      "metadata": {
        "position": {
          "x": 430.8772765739572,
          "y": -305.43863828697863
        }
      },
      "tool": {
        "type": "apiRequest",
        "function": {
          "name": "api_request_tool",
          "description": "API request tool",
          "parameters": {
            "type": "object",
            "properties": {},
            "required": []
          }
        },
        "server": null,
        "messages": [
          {
            "type": "request-start",
            "content": "Checking area",
            "blocking": false
          }
        ],
        "name": "checkArea",
        "url": "https://api:3000",
        "method": "GET",
        "credentialId": "a37ad038-eb40-4d6a-b82b-e082eba08f16",
        "variableExtractionPlan": {
          "schema": {
            "type": "object",
            "required": [
              "call_out_fee",
              "area_coverage"
            ],
            "properties": {
              "call_out_fee": {
                "type": "number",
                "description": "Callout fee in pounds"
              },
              "area_coverage": {
                "type": "boolean",
                "description": "Whether area is covered"
              }
            }
          },
          "aliases": []
        }
      }
    },
How can I check the http status returned from this endpoint?
@Vapi
this is the object returned by the API server:
Copy code
{
  "status": "Success",
  "message": "Request completed successfully",
  "data": {
    "street": "123 Main St",
    "city": "New York",
    "zip": "10001"
  }
}
t
Care to explain better? What do you mean? @ITM
c
The
status
can be accepted as a result for the tool call, but the entire object must be in a single line without line breaks. It seems like your tool call response format isn’t quite right. You’ll need to adjust it to match the expected format. You can check out the documentation and snippet below for the correct details. Hope this helps! Documentation Link: Tool Call Response Format:
Copy code
{
  "results": [
    {
      "toolCallId": "X",
      "result": "Y"
    }
  ]
}
3 Views