Actions in gpt Builider *POST

I am trying to implement actions from gpt Builider, the Get actions work correctly, however the post actions do not recognize the EndPoint.

In tests using the cmd console in windows if both the get and post actions work, but from YamL, it tells me that the EndPoint has not been found.

What I need to do is to update the field from a json file called name, I repeat the get if it works to retrieve that name.

openapi: 3.0.3
info:
  title: Actualizar Nombre de Usuario
  version: 1.0.0
servers:
  - url: https://api.*****.ia
    description: Servidor de OpenAI
paths:
  /api.php/?getUserName:
    get:
      summary: Obtener el nombre de usuario
      operationId: getUserName
      responses:
        '200':
          description: Nombre de usuario obtenido correctamente
          content:
            application/json:
              schema:
                type: object
                properties:
                  Nombre:
                    type: string
                    example: John
  /api.php/?setUserName:
    post:
      summary: Cambiar el nombre de usuario
      operationId: setUserName
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                Nombre:
                  type: string
                  description: El nuevo nombre de usuario a asignar
                  example: NuevoNombrePorDefecto
      responses:
        '200':
          description: Nombre de usuario actualizado correctamente

I appreciate the help on this.

At the first sight, the URLs in your specs are not correct - there should be no question marks in the slug e.g. ? in /api.php/?setUserName. The question mark is reserved for marking query parameters.

I’d suggest to sue the swagger editor first to fix the errors in the specification. In your case it throws the semantic error…

1 Like


Hi, thanks for replying, I can tell you that it works in the editor without any problem, however the chat bot can not run the api, it says it can not update the data, that the endpoint is not foun.

However, the getUserName and ping endpoints do work correctly.

Nothing, it doesn’t work, so I do a test on gptBuilider and they say that I have already used up my forty messages in three hours, a real nightmare.

openapi: 3.1.0
info:
  title: API de Ejemplo
  version: 1.0.0
servers:
  - url: https://serverapi
paths:
  /Web.php/?setUserName:
    post:
      summary: Cambiar el valor del campo Nombre (como formulario)
      operationId: setUserName
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                setUserName:
                  type: string
      responses:
        '200':
          description: Nombre de usuario actualizado con éxito
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  newUser:
                    type: string
        '400':
          description: Solicitud incorrecta
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '500':
          description: Error interno del servidor
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string