Create an External Link

Create an external_link resource to share with users so they can upload files directly from their browser. For more info, see Uploading files to Finix.

Once created, you can upload the user's file to the external_link resource: Upload files to External Link

Copy
Copied
curl -X POST \
  https://finix.sandbox-payments-api.com/files/FILE_bJecqoRPasStEPVpvKHtgA/external_links \
  -u  USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
    "type": "UPLOAD",
    "duration": 15
  }'

| Example response

Copy
Copied
{
    "id": "EL_n4baDHgeidWcst61qzf1Aq",
    "created_at": "2022-02-25T16:18:47.641122-08:00",
    "url": "http://finix-file-quarantine-sb.s3.us-east-2.amazonaws.com/.../upload/FILE_bJecqoRPasStEPVpvKHtgA/...",
    "type": "UPLOAD",
    "expires_at": "2022-02-25T16:28:47.631612-08:00",
    "user_id": "USsRhsHYZGBPnQw8CByJyEQW",
    "file_id": "FILE_bJecqoRPasStEPVpvKHtgA",
    "tags": {
        "key": "value"
    },
    "expired": false
}

HTTP Request

POST https://finix.sandbox-payments-api.com/files/:FILE_ID:/external_links

URL Parameters

Parameter Description
:FILE_ID: The File ID that was created first to upload the file.

Request Arguments

Field Type Description Enum values (if relevant)
type ENUM value, required
  • Set to UPLOAD to create a link that can be used to upload files to Finix.
  • Set to DOWNLOAD to create a link where the uploaded file can be downloaded from.
  • Set to VIEW to create a link that displays the file in browser.
  • DOWNLOAD
  • UPLOAD
  • VIEW
duration integer, optional
(MINUTES)
Set how long (in minutes) the external link should be active for. The link can be active for up to 7 days in the future.
tags object, optional A custom value you can include to annotate the File object's metadata (e.g. file number)

Response

Field Type Description
id string The ID of the External Link resource.
created_at string Timestamp of when the File ID was created.
url string The URL you can share with merchants to UPLOAD or DOWNLOAD files depending on the request sent.
type string Sets if the link is for uploading or downloading files from Finix.
expires_at string The timestamp that the external link expires at.
user_id string The user ID that requested to create this link.
file_id string The File ID the External Link is related to.
tags object A custom value you can include to annotate the File object's metadata. (e.g. file number)
expired boolean
  • If TRUE the link has expired
  • If FALSE, the link is active and files can still be uploaded or downloaded from the link.