Skip to content

Chatting

Borbuev Beksultan edited this page May 16, 2024 · 2 revisions

Chunk File Upload API

Upload Chunk

Uploads a chunk of a file to the server.

  • URL

    /api/v1/attachments/uploadLarge

  • Method

    POST

  • Request Headers

    • Content-Type: application/octet-stream
    • X-File-Name: Name of the file being uploaded.
    • X-Chunk-Index: Index of the current chunk (starting from 0).
    • X-Total-Chunks: Total number of chunks.
  • Request Body

    Binary data representing the file chunk.

  • Success Response

  • Success Response

    • Code: 200 OK
    • Content:
      {
        "file_id": "example123",
        "chunk_id": 2
      }
  • Error Responses

    • Code: 400 Bad Request
      • Content: Invalid request parameters
    • Code: 500 Internal Server Error
      • Content: Server error occurred

Regular File Upload API

Upload File

Uploads a file to the server.

  • URL

    /api/v1/attachments/upload

  • Method

    POST

  • Request Headers

    • Content-Type: multipart/form-data
  • Request Body

    • file: The file to be uploaded.
  • Success Response

  • Success Response

    • Code: 200 OK
    • Content:
      {
        "file_id": "example123"
      }
  • Error Responses

    • Code: 400 Bad Request
      • Content: Invalid request parameters
    • Code: 500 Internal Server Error
      • Content: Server error occurred
Clone this wiki locally