πŸ“€ File Upload

File Upload

Upload files to attach to your RFQ services. Files must be uploaded before creating your RFQ.

Complete File Upload Workflow

Step 1: Request Presigned URL
POST /api/files/upload/presigned-url
{
  "filename": "document.pdf",
  "sizeBytes": 1024000,
  "mimeType": "application/pdf",
  "entityType": "rfq"
}
β†’ Response: { fileId: "67eb9e88-...", presignedUrl: "...", ... }

Step 2: Upload File to Presigned URL
PUT <presignedUrl>
Content-Type: <uploadInstructions.contentType>
[File binary data]
β†’ Response: 200 OK

Step 3: Use fileId in RFQ
POST /api/public/v1/rfqs
{
  "services": [{
    "serviceId": "...",
    "type": "NON_LINGUISTICS",
    "targetMarketIds": ["..."],
    "assetFileIds": ["67eb9e88-7962-41a1-9695-f2051a968728"]
  }]
}

When to Upload Files

Upload files before creating your RFQ if you want to attach them to services. The fileId you receive can be used in the assetFileIds array when creating RFQs.

File Requirements

  • Max Size: 100MB (104,857,600 bytes)

  • Allowed Types: PDF, Word, Excel, PowerPoint, Images, Videos, Audio, ZIP

  • Entity Type: Use "rfq" for RFQ-related files

Using File IDs in RFQs

Once you have a fileId from the upload endpoint, include it in your service's assetFileIds array:

Note: The fileId from the upload endpoint goes directly into the assetFileIds array. The system automatically transforms it to the internal assets format.

Get file upload endpoint details below.

πŸ“€ Upload File and Get File ID

post
/api/public/v1/files/upload/presigned-url

Upload Files for RFQ Service Assets

This endpoint allows you to upload files directly via multipart/form-data that will be attached to specific services in your RFQ.

How It Works

Direct File Upload (Multipart Only)

  • Use multipart/form-data content type

  • Select a file directly in Swagger UI or send as multipart form

  • The system automatically:

    1. Generates a presigned URL

    2. Uploads the file to GCP storage

    3. Saves file metadata

    4. Returns only the fileId (ready to use in RFQ services)

  • Response: { success: true, message: "File uploaded successfully", data: { fileId: "..." } }

  • All in one request! No need to make a separate PUT request

Complete File Upload Workflow

Important: Files are uploaded per service. Each service in your RFQ can have its own set of files.

Step 1: Upload File for a Specific Service
POST /api/public/v1/files/upload/presigned-url
Content-Type: multipart/form-data
- file: [binary file data]

β†’ Response: { success: true, data: { fileId: "91cc2de4-293b-4c37-b257-5d39cd1133da" } }

Step 2: Upload Another File for a Different Service (if needed)
POST /api/public/v1/files/upload/presigned-url
Content-Type: multipart/form-data
- file: [another binary file data]

β†’ Response: { success: true, data: { fileId: "dc68867c-beb5-46e3-b291-47978c94783b" } }

Step 3: Create or Update RFQ with fileIds in Service Objects
POST /api/public/v1/rfqs
{
  "companyId": "...",
  "projectName": "My Project",
  "services": [
    {
      "serviceId": "33cecd1e-6629-41d8-bc65-f1ad832a2bd2",
      "type": "NON_LINGUISTICS",
      "targetMarketIds": ["03b91040-5931-4c24-9310-7a33861edde2"],
      "assetFileIds": ["91cc2de4-293b-4c37-b257-5d39cd1133da"]  ← File for this service
    },
    {
      "serviceId": "7ff59ce3-d3e7-4898-ac35-63b38531c17d",
      "type": "NON_LINGUISTICS",
      "targetMarketIds": ["55247866-be7d-4dad-8cea-5e3a71a8e2a6"],
      "assetFileIds": ["dc68867c-beb5-46e3-b291-47978c94783b"]  ← Different file for this service
    }
  ]
}

OR Update an existing RFQ:
PATCH /api/public/v1/rfqs/{rfqId}
{
  "services": [
    {
      "id": "00000000-0000-0000-0000-000000000001",
      "type": "NON_LINGUISTICS",
      "serviceUUID": "33cecd1e-6629-41d8-bc65-f1ad832a2bd2",
      "targetMarkets": [{"targetMarketId": "03b91040-5931-4c24-9310-7a33861edde2"}],
      "assets": [
        {
          "type": "FILE",
          "assetType": "SOURCE",
          "fileId": "91cc2de4-293b-4c37-b257-5d39cd1133da"
        }
      ]
    }
  ]
}

File Requirements

  • Max Size: 100MB (104,857,600 bytes)

  • Allowed Types: PDF, Word, Excel, PowerPoint, Images, Videos, Audio, ZIP

Using File IDs in RFQ Services

For Creating RFQs: Include fileIds in the assetFileIds array of each service object:

For Updating RFQs: Use the internal assets format with fileId:

Note:

  • Each service can have multiple files (multiple fileIds in the assetFileIds array)

  • Files are associated with specific services, not the entire RFQ

  • The system automatically transforms assetFileIds to the internal assets format when creating RFQs

  • See the RFQs section for complete RFQ creation examples.

Authorizations
AuthorizationstringRequired

JWT access token obtained from POST /api/credentials/token

How to authenticate:

  1. Generate API credentials from the Adaptria Portal
  2. Exchange credentials for a token: POST /api/credentials/token
  3. Include the token in all requests: Authorization: Bearer <token>

Token Expiration: 1 hour (3600 seconds)

Body
filestring Β· binaryRequired

File to upload (binary). Max size: 100MB. Supported types: PDF, Word, Excel, PowerPoint, Images, Videos, Audio, ZIP

Responses
post
/api/public/v1/files/upload/presigned-url

Last updated