Skip to content
English
  • There are no suggestions because the search field is empty.

Pisano External API - Files - Pisano File Uploading Service

Upload File

Uploads a file to an existing Pisano file service directory. The directory must be created first and its directory_id must be used in this request.

POST /v2/file_service/directory/:directory_id/files

Authentication

Authentication Method Token token="API_TOKEN"

Request

Path Parameters

Parameter Type Required Description Example
directory_id string Yes ID of the target file service directory. <directory_id>

Headers

Header Required Description Example
Accept Expected response format. application/json
Authorization Pisano API token. Token token="API_TOKEN"
Content-Type Multipart form request content type. multipart/form-data

Request Body

file=@"<FILE_PATH>"
filename="<FILE_NAME>"

multipart/form-data

Request Body Fields

Field Type Required Description Example
file file Yes File to upload. <FILE_PATH>
filename string Yes Name used for the uploaded file entry. <FILE_NAME>

Request Example

cURL Request Example
curl --location --request POST \
'http://API_HOST/v2/file_service/directory/<directory_id>/files' \
--header 'accept: application/json' \
--header 'authorization: Token token="API_TOKEN"' \
--header 'content-type: multipart/form-data' \
--form 'file=@"<FILE_PATH>"' \
--form 'filename="<FILE_NAME>"'

Responses

Returns the created file service entry.

Response Schema

object string
└── url string
data object
├── id string
├── object string
├── filename string
├── url string
├── proxy_url string
├── directory string
├── directory_id string
├── user_id string
├── created_at datetime
└── expired_at datetime / null

Response Fields

Field Type Required Description Example
object string Response object type. file_service::file
url string File service endpoint path. /v2/file_service/directory/<directory_id>/files
data.id string File entry ID. <file_entry_id>
data.filename string Uploaded file name. <FILE_NAME>
data.url string File URL. http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>
data.proxy_url string Proxy file URL. http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>
data.directory string Directory name. <DIRECTORY_NAME>
data.directory_id string Directory ID. <directory_id>
data.user_id string User identifier associated with the entry. <user_id>
data.created_at datetime Creation timestamp. 2024-05-03T14:12:12.789+03:00
data.expired_at datetime / null Expiration timestamp; null before expiry. null

Response Example

JSON Response Example
{
  "object": "file_service::file",
  "url": "/v2/file_service/directory/<directory_id>/files",
  "data": {
    "id": "<file_entry_id>",
    "object": "file_service::file",
    "filename": "<FILE_NAME>",
    "url": "http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>",
    "proxy_url": "http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>",
    "directory": "<DIRECTORY_NAME>",
    "directory_id": "<directory_id>",
    "user_id": "<user_id>",
    "created_at": "2024-05-03T14:12:12.789+03:00",
    "expired_at": null
  }
}

Additional Information

Notes A directory must exist before file upload. If files with the same name are transferred in workflows, the latest unprocessed data is processed. If there is no unprocessed data, the workflow does not run. File expiration is enabled. By default, files are removed from file storage after 7 days and the file entry expired_at timestamp is updated after expiry. Directory names must be unique when creating a directory.

Related APIs

Create File Directory

POST /v2/file_service/:account_id/directories

Authentication

Authentication Method Token token="API_TOKEN"

Path Parameters

Parameter Required Description Example
account_id Yes Account ID. <account_id>

Validations

Directory name must be unique.

Request

{
  "name": "Directory Name"
}

Response

{
  "object": "file_service::directory",
  "url": "/v2/file_service/<account_id>",
  "data": {
    "id": "<directory_id>",
    "object": "file_service::directory",
    "name": "Directory Name",
    "created_at": "2024-05-03T13:56:15.185+03:00"
  }
}

List Directories

GET /v2/file_service/:account_id/directories

Authentication

Authentication Method Token token="API_TOKEN"

Path Parameters

Parameter Required Description Example
account_id Yes Account ID. <account_id>

Response

{
  "object": "collection",
  "url": "/v2/file_service/<account_id>/directories",
  "data": [
    {
      "id": "<directory_id>",
      "object": "file_service::directory",
      "name": "<DIRECTORY_NAME>",
      "created_at": "2024-05-03T14:03:54.846+03:00"
    }
  ]
}

List Files

GET /v2/file_service/directory/:directory_id/files

Authentication

Authentication Method Token token="API_TOKEN"

Path Parameters

Parameter Required Description Example
directory_id Yes Directory ID. <directory_id>

Response

{
  "object": "collection",
  "url": "/v2/file_service/directory/<directory_id>/files",
  "data": [
    {
      "id": "<file_entry_id>",
      "object": "file_service::file",
      "filename": "<FILE_NAME>",
      "url": "http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>",
      "proxy_url": "http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>",
      "directory": "<DIRECTORY_NAME>",
      "directory_id": "<directory_id>",
      "user_id": "<user_id>",
      "created_at": "2024-05-03T14:12:12.789+03:00",
      "expired_at": null
    }
  ]
}

View File Detail

GET /v2/file_service/directory/:directory_id/files/:file_entry_id

Authentication

Authentication Method Token token="API_TOKEN"

Path Parameters

Parameter Required Description Example
directory_id Yes Directory ID. <directory_id>
file_entry_id Yes File entry ID. <file_entry_id>

Response

{
  "object": "file_service::file",
  "url": "/v2/file_service/directory/<directory_id>/files",
  "data": {
    "id": "<file_entry_id>",
    "object": "file_service::file",
    "filename": "<FILE_NAME>",
    "url": "http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>",
    "proxy_url": "http://<API_HOST>/public/v2/storage/blobs/<blob_token>/<FILE_NAME>",
    "directory": "<DIRECTORY_NAME>",
    "directory_id": "<directory_id>",
    "user_id": "<user_id>",
    "created_at": "2024-05-03T14:12:12.789+03:00",
    "expired_at": null
  }
}

Delete File

DELETE /v2/file_service/directory/:directory_id/files/:file_entry_id

Authentication

Authentication Method Token token="API_TOKEN"

Path Parameters

Parameter Required Description Example
directory_id Yes Directory ID. <directory_id>
file_entry_id Yes File entry ID. <file_entry_id>