Hello,
I’m currently trying to create a GPT with an action that should call an API endpoint and upload a file provided by the user. Here’s the OpenAPI schema I’m using:
openapi: 3.1.0
info:
title: DOCX to PDF
description: API for converting DOCX to PDF files
version: 1.0.0
servers:
- url: https://v2.convertapi.com
paths:
/convert/docx/to/pdf:
post:
operationId: convertDocxToPdf
summary: Uploads file in multipart/form-data
description: Uploads file and converts DOCX to a PDF file
tags:
- Conversion
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
responses:
"200":
content:
application/pdf:
schema:
type: string
format: binary
However, when this action is called, the API is being hit with a JSON payload instead of a proper multipart/form-data request, and the file upload fails.
Could you please advise how to properly handle the file upload in this context, so the user-provided file is sent correctly as multipart/form-data?
Thank you in advance for your help!