Query parameters aren't working

I’m trying to set up a custom GPT that uses Actions to call different aspects of our platform via API. I’m able to successfully call APIs that leverage Body parameters, but when I try to use Query parameters I’m noticing that they’re still being sent as Body parameters. Here’s the schema for one of those endpoints showing (I think) that it’s correctly set up as a Query parameter.

"/interpretation": {
      "get": {
        "description": "Get result of an interpretation/analysis from Bayse",
        "operationId": "Get analysis result",
        "parameters": [
          {
            "name": "result_id",
            "in": "query",
            "description": "The result_id provided by the \"Submit URL for Analysis\" request's response.",
            "required": true,
            "deprecated": false,
            "allowEmptyValue": false,
            "explode": false,
            "allowReserved": false,
            "schema": {
              "type": ""
            }
          }
        ],
        "deprecated": false,
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    }

Has anybody else encountered this issue, or am I doing something wrong?

1 Like

They do work for me. I have problems today with modifying the Open API JSON.
The changes won’t get saved.
I had different problem yesterday, but it got resolved and worked fine today.

I’m seeing the same issues. Here’s my YAML. I even tried to use the description to emphasize to use the query parameters, not the URL.

paths:
  /tasks:
    get:
      description: Get Tasks
      operationId: GetActiveTasks
      parameters:
      - name: filter
        in: query
        description: A filter for active tasks, see filters.pdf. PASS In THROUGH THE QUERY PARAMETERS!!!
        required: false
        schema:
          type: string
      deprecated: false

Can you share your schema?
I just tried recreating a new GPT altogether, but it’s still doing the exact same thing.

Sure, here the schema:

{
  "openapi": "3.1.0",
  "info": {
    "title": "API title",
    "description": "api desc",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://..."
    }
  ],
  "paths": {
    "/path": {
      "get": {
        "description": "endpoint desc",
        "operationId": "EndpointId",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "param desc",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {}
  }
}

The name of the param is also “query”, hope it’s not why it “just works” :wink:

I used webhook.site to test the communication and the authentication headers.

Yeah, I still can’t get this to work. I even tried throwing away everything else in my schema (since I interact with the same API differently for different functionalities), but alas, still fails. Hopefully someone from the official team will take a look at this, because I’d really like to have something working ASAP.

I can’t even get path parameters to work! Between the schema changes magically disappearing after saving having very little way to debug, I’m stuck.

I’m having a similar problem with path parameters in a custom GPT.

I’ve uploaded the openapi.json schema exported from Swagger to my custom GPT.

I can see that OpenAI calls the endpoint but does not add the query param to the path as Swagger does (see below)

This is what I get in the custom GPT debug console:

[debug] Calling HTTP endpoint
{
  "domain": "XXXXXX",
  "method": "get",
  "path": "/XXXXXX_info",
  "operation": "get_XXXXXX_info_get",
  "operation_hash": "4ffba76a6311d14cd9405830800f00731ceafd13",
  "is_consequential": false,
  "params": {
    "project_id": 4
  }
}
[debug] Response received
{}

This is the parameter declaration:

"parameters": [
    {
        "name": "project_id",
        "in": "query",
        "required": false,
        "schema": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Project Id"
        }
    },
    {
        "name": "connector_id",
        "in": "query",
        "required": false,
        "schema": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Connector Id"
        }
    },
    {
        "name": "filename",
        "in": "query",
        "required": false,
        "schema": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Filename"
        }
    },
    {
        "name": "id",
        "in": "query",
        "required": false,
        "schema": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Id"
        }
    }
]

Problem solved!
OpenAI cannot handle ‘anyOf’ in the schema declaration:

This code passes no query param in the HTTP request despite saying in the decision that it will pass a param:

"schema": {
      "anyOf": [
          {
              "type": "integer"
          },
          {
              "type": "null"
          }
      ],
      "title": "Connector Id"
  }

This works:

"schema": {
      "type": "integer"
      "title": "Connector Id"
  }