1. S3 Files
  • Introduction
  • Getting Started
  • Authentication
  • Error Handling
  • Contact Support
  • Modaltrans API
    • Get Auth Token
      • Get Bearer Token
    • Accounting
      • Invoices
        • Retrieve an Invoice
        • List all Invoices
    • Customs
      • NCTS Declarations
        • List all NCTS Declarations
        • Retrieve an NCTS Declaration
        • Create an NCTS Declaration with XML Data
        • Create an Ens Declaration from JSON
        • Update an NCTS Declaration
        • Download an NCTS Declaration
        • List Timelines of NCTS Declaration
        • List Messages of NCTS Decalaration
      • Customs Declarations
        • List all Customs Declarations
        • Retrieve a Custom Declaration
        • Create a Customs Declaration
        • Update a Custom Declaration
        • Delete a Custom Declaration
        • Retrieve a Declaration History
        • Retrieve an MRN Status of Declaration
      • Declaration Requests
        • List all Declaration Orders
        • Retrieve a Declaration Request
        • Create a Declaration Request
        • Update a Declaration Request
        • Delete a Declaration Request
    • Logistics
      • Bookings
        • Retrieve a Booking
        • List all Bookings
        • Create a Booking
        • Update a Booking
      • Locations
        • List all Locations
        • Retrieve a Location
      • Positions
        • Update a Transport
      • Tracking
        • Available Shipping Lines
        • Retrieve a Tracking Data
        • Subscribe to Tracking
      • Shipments
        • Retrieve a Shipment
        • List All Shipments
        • Retrieve Financials of Shipment
        • List Contacts of the Shipment
        • Create a Shipment
        • Update a Shipment
    • Depot
      • Orders
        • Retrieve an Order
        • List all Orders
        • Create an Order
        • Update an Order
      • Products
        • Retrieve a Product
        • List all Products
        • Create a Product
        • Update a Product
        • List Product Stocks
      • Inventories
        • List all Inventories
    • Fleet Management
      • Drivers
        • Retrieve a Driver
        • Retrieve a Driver's Vehicle
        • List Driver Positions
        • Update a Driver
      • Vehicles
        • Retrieve a Vehicle
        • Update a Vehicle
      • Gps Service Controller
        • Create Gps Responses
      • Service Logs
        • List all Service Logs
        • Retrieve a Service Log
        • Create a Service Log
        • Delete a Service Log
        • Update a Service Log
      • Periodic Documents
        • Retrieve a Periodic Document
        • Update a Periodic Document
        • Create a Periodic Document
    • CRM
      • Companies
        • List all Companies
        • Retrieve a Company
        • Create a Company
        • Update a Company
        • Delete a Company
    • Timelines
      • Retrieve a Timeline
      • List Timelines
      • Create a Timeline
    • S3 Files
      • List all S3Files
        GET
      • Create an S3File
        POST
      • Delete an S3File
        DELETE
    • Notifications
      • List all Notifications
      • Update a Notification Status
    • User Details
      • List User Details
      • Update User Details
  1. S3 Files

Create an S3File

Developing
Testing Env
https://demo.modaltrans.com
Testing Env
https://demo.modaltrans.com
POST
/api/v1/s3files
Creates S3File for the related record.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params multipart/form-data
parent_type
enum<string> 
required
The type of the record to which the file is being associated. This should be a string representing the model class name.
Allowed values:
Depot::MotionDepot::CwhMotionDepot::FreeMotionDepot::WarehouseDepot::OrderFleet::DriverFleet::PeriodocFleet::PartFleet::GateActionFleet::VehicleFleet::ServicelogFleet::ExpenseFormNetwork::LeadNetwork::CompanyNetwork::NoticeNetwork::ContractNetwork::TenderCustoms::GvmsManifestoCustoms::EawbCustoms::ManifestoCustoms::TraderdecCustoms::UetdNimbos::CommentNimbos::GroupNimbos::PatronLogistics::IncidentLogistics::PlaceLogistics::LoadingLogistics::PositionFinancor::FindocFinancor::GldocFinancor::PayTermFinancor::BankLetterFinancor::InvoiceHr::PayrollPeriodHr::PersonAssetim::WareHelpdesk::Todo
Example:
Logistics::Loading
parent_id
string 
required
The UUID of the record to which the file is being associated.
Example:
9093ab21-1926-409e-a82f-3a6b1d7a4921
s3file[file]
file 
required
The file to be uploaded and associated with the related record. This parameter should contain the actual file data, which will be processed and stored according to the specified settings in your application.
s3file[name]
string 
optional
Name of the file you want to send
Example:
ExampleName
s3file[file_class]
enum<string> 
optional
The file class of the file being uploaded, specifying its role or purpose.
Allowed values:
cmrpodinvoicecommercial_invoicehblmblwaybilltransitcimtir_carnetquotecontractordercustoms_attachmentexport_declarationimport_declarationatrpacking_listinstructionreceiptother
Example:
other
s3file[file_type]
enum<string> 
optional
The type of the file being uploaded. You can specify it for search purposes.
Allowed values:
image/jpegimage/pngapplication/pdfapplication/xslt+xmlapplication/zipapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Example:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
s3file[auth_code]
enum<integer> 
optional
Defines the access level for the file.
Allowed values:
01
Default:
1
Example:
0

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://demo.modaltrans.com/api/v1/s3files' \
--form 'parent_type="Logistics::Loading"' \
--form 'parent_id="9093ab21-1926-409e-a82f-3a6b1d7a4921"' \
--form 's3file[file]=@""' \
--form 's3file[name]="ExampleName"' \
--form 's3file[file_class]="other"' \
--form 's3file[file_type]="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"' \
--form 's3file[auth_code]="0"'

Responses

🟢200OK
application/json
Body
array of:
id
integer 
required
ID of the document
name
string 
required
Name of the document
file_data
string 
required
Data of the file
size
string 
required
Size of the document data
file_type
string 
required
Type of the file(.txt .xlsx e.g.)
created_at
string <date-time>
required
Timestamp of the created document
parent_type
string 
required
Type of the parent object to which the document is related
parent_id
integer 
required
The UUID of the parent object.(Booking e.g.)
document_url
string 
required
Url of the document
user_id
integer 
required
ID of the user created the document
user_name
string 
required
Name of the user created the document
file_class
string 
required
Class of the file
Example
{
    "id": 3723780,
    "name": "ExampleName",
    "file_data": "{\"id\":\"a0ee6447f492eaf7f3b84461f48e6538.xlsx\",\"storage\":\"store\",\"metadata\":{\"filename\":\"DEMODENEM.xlsx\",\"size\":6600,\"mime_type\":\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"}}",
    "size": null,
    "file_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    "created_at": "2024-08-27T11:32:07.815+03:00",
    "parent_type": "Logistics::Loading",
    "parent_id": 1850495,
    "document_url": "https://patronfiles.s3.eu-central-1.amazonaws.com/store/a0ee6447f492eaf7f3b84461f48e6538.xlsx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA4QUYXP6RPX77AVCX%2F20240827%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240827T083207Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=3e2436b406dcc9e9a0ff4c7e04e95150274900f8ed76a95049dde07f9eb65ed6",
    "user_id": 8091,
    "user_name": "Muhammet Demirhan",
    "file_class": "other"
}
🟠400Bad Request
🟠403Forbidden
🟠404Record Not Found
🟠422Unprocessable Entity
Modified at 2024-09-10 12:14:37
Previous
List all S3Files
Next
Delete an S3File
Built with