eXtendFiles API (1.0.0)

Download OpenAPI specification:

This API provides a backend service for performing eXtendFiles file uploads integrated with NetSuite. Prerequisites:

  • eXtendFiles must be fully configured in the target NetSuite account.
  • A "Public Upload" configuration must be active for the target record type(s).

File Upload

Endpoints for uploading files.

Direct File Upload (< 5MB)

Uploads a complete file in a single request. Use this method for files smaller than 5MB. The request body must be multipart/form-data. Dynamic metadata for the NetSuite record can be passed via custom headers formatted as x-{netsuite_field_id}.

Authorizations:
ApiKeyAuth
header Parameters
x-record-type
required
string
Example: customer

This is the record-type on which eXtendFiles record is being uploaded, and Public Upload is configured

x-store
required
string
Value: "s3"
Example: s3

This will the storage type used to upload file. In current scenario its value should be s3

x-total-file-size
required
integer
Example: 12582912

Total size of the file

x-filename
required
string
Example: large-dataset.zip

Filename being uploaded

x-bucket
string

Overrides the default bucket

x-folder-name
string

The destination folder path within the bucket

x-acl
string

To change ACL of the file being uploaded, you can pass valid ACL value in x-acl header

x-custrecord_extfile_so_pref
string
Example: 123

Example of a dynamic metadata header. Header name should be the NetSuite field ID.

Request Body schema: multipart/form-data
required

A multipart/form-data payload containing the file.

file
string <binary>

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "body": {
    }
}

Multi-Part File Upload (> 5MB)

Handles large file uploads by breaking them into parts. Use this method for files larger than 5MB. The process is stateful:

  1. Upload Chunks: Send each part as application/octet-stream. The first request initiates the upload and returns an uploadId and filePath. Subsequent requests must include these values.
  2. Commit Upload: After all parts are sent, make a final request with the x-commit-upload: 1 header. The body of this final request must be application/json and contain an array of the partUploadResponse objects received in the previous steps.
Authorizations:
ApiKeyAuth
header Parameters
x-record-type
required
string
Example: customer

This is the record-type on which eXtendFiles record is being uploaded, and Public Upload is configured

x-store
required
string
Value: "s3"
Example: s3

This will the storage type used to upload file. In current scenario its value should be s3

x-total-file-size
required
integer
Example: 12582912

Total size of the file

x-total-parts
integer
Example: 3

Total number of parts a file will be uploaded into (For multi-part only)

x-filename
required
string
Example: large-dataset.zip

Filename being uploaded

x-filetype
string
Example: application/zip

The MIME type of the file.

x-part-number
integer
Example: 1

This is the part number of the file which is being uploaded, and it starts with 1

x-upload-id
string

The uploadid which will be received after the first chunk is sent to server, and should be empty string in the first request

x-file-path
string

This will be the file path where the file will be uploaded, and will be received after first chunk is sent to server

x-commit-upload
string
Example: 1

Set to '1' on the final multi-part request to commit the file

x-custrecord_extfile_so_pref
string
Example: 123

Example of a dynamic metadata header. Header name should be the NetSuite field ID.

Responses

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "body": {
    }
}

File Operations

Endpoints for generating signed URLs for uploaded files.

Get a Pre-signed URL

Generates a temporary, pre-signed URL for a file in storage.

Authorizations:
ApiKeyAuth
header Parameters
x-store
required
string
Value: "s3"
Example: s3

This will the storage type used to upload file. In current scenario its value should be s3

Request Body schema: application/json
required

JSON object specifying the file for which to generate a signed URL

fileUrl
string <uri>

The full URL of the file in S3. If provided, bucket and path are ignored

bucket
string

The name of the S3 bucket. Required if fileUrl is not provided

path
string

The path or key of the file within the S3 bucket. Required if fileUrl is not provided

expiration
integer
Default: 3600

The expiration time in seconds. Defaults to 3600 (1 hour)

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}