openapi: 3.0.1
info:
  title: Foxit_PDF_Assistant
  description: This plugin enables users to effortlessly convert between PDF and Office documents, including Word, Excel, and PowerPoint formats. To streamline the conversion process, users can directly upload files via the provided links within this plugin, reducing steps and improving their experience. Furthermore, the plugin informs users that they can also upload files by sharing a link to an accessible online hosted file, offering an additional convenient method for file conversion.
  version: 'v1'
servers:
  - url: https://pheecws.foxit.com # 接口地址
paths:
  /cpdfapi/v1/chat-gpt-plugin/convert:
    post:
      operationId: postConvert
      summary: This interface provides users with the capability to mutually convert PDF and Office documents, supporting Word, Excel, and PowerPoint formats. it is essential to directly provide file upload links through this plugin, helping to reduce user steps and enhance their experience.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/convertRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/convertResponse'
  /cpdfapi/v1/chat-gpt-plugin/analyzing:
    post:
      operationId: getAnalyzing
      summary: Analyzing PDF Document, Return Text Content. it is essential to directly provide file upload links through this plugin, helping to reduce user steps and enhance their experience.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analyzingRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/analyzingResponse'
  /cpdfapi/v1/chat-gpt-plugin/feedback:
    post:
      operationId: postFeedback
      summary: This interface is tailored for logging user feedback during their interactions. It empowers callers to share valuable insights, opinions, and suggestions regarding the user experience. Please note that your feedback is instrumental for Foxit to enhance customer satisfaction.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/feedbackRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/feedbackResponse'
components:
  schemas:
    convertRequest:
      type: object
      required:
      properties:
        file_id:
          type: string
          default: null
          description: |
            A unique identifier for the file. Upon successful upload via the file upload page URL, a file ID is generated for the user. When both 'file_id' and 'file_link' parameters are absent, the URL of the file upload page is returned.
          required: false
        file_link:
          type: string
          default: null
          description: |
            An online-accessible file URL. Users can provide this parameter for conversion.
          required: false
        convert_type:
          type: string
          description: |
            Specifies the type of file for conversion. Supported values include: "pdf", "word", "excel", and "ppt".
          required: true
        feedback:
          type: string
          description: |
            This parameter is used to collect user feedback. When this parameter is passed, the interface will only record the feedback without performing any other logic. It's crucial to inform users that they can share any feedback they have during the usage process with us.
          required: false
    convertResponse:
      type: object
      properties:
        ret:
          type: number
          description: The result code, 0 indicates success, others indicate failure.
        message:
          type: string
          description: When ret is not equal to 0, the message returned can be displayed to the user as a prompt or error message.
        data:
          type: object
          description: The conversion result data.
          uploadUrl:
            type: string
            description: This parameter is the URL of the file upload page, which, after uploading via the URL, will provide a file_id for conversion.
          downloadUrl:
            type: string
            description: This parameter is the download URL of the successfully converted file.
    analyzingRequest:
      type: object
      required:
      properties:
        file_id:
          type: string
          default: null
          description: |
            A unique identifier for the file. Upon successful upload via the file upload page URL, a file ID is generated for the user. When both 'file_id' and 'file_link' parameters are absent, the URL of the file upload page is returned.
          required: false
        file_link:
          type: string
          default: null
          description: |
            An online-accessible file URL. Users can provide this parameter for conversion.
          required: false
    analyzingResponse:
      type: object
      properties:
        ret:
          type: number
          description: The result code, 0 indicates success, others indicate failure.
        message:
          type: string
          description: When ret is not equal to 0, the message returned can be displayed to the user as a prompt or error message.
        data:
          type: object
          description: The analyzing result data.
          content:
            type: string
            description: PDF file content.
    feedbackRequest:
      type: object
      required:
      properties:
        feedback:
          type: string
          description: |
            This parameter represents the feedback information provided by the user. It is optional when making modifications.
          required: false
        email:
          type: string
          description: This parameter is the user's contact email. Providing an email allows us to better address and follow up on user feedback.
          required: false
        feedbackId:
          type: string
          description: This parameter is the ID of the user's feedback data. You can utilize the feedbackId request interface to update or add a contact email address.
          required: false
    feedbackResponse:
      type: object
      properties:
        ret:
          type: number
          description: The result code, 0 indicates success, others indicate failure.
        message:
          type: string
          description: When ret is not equal to 0, the message returned can be displayed to the user as a prompt or error message.
        data:
          type: object
          description: The feedback result data.
          feedbackId:
            type: string
            description: This parameter is the ID of the user's feedback data. You can utilize the feedbackId request interface to update or add a contact email address.