File links

File Links provide a secure and convenient way to share the contents of a File object with customers by generating a unique URL. This URL allows customers to access the file's content without requiring authentication. File Links are particularly useful for sharing documents, invoices, or other files associated with order management, enhancing the customer experience by simplifying access to important information.

Gets all the file links specified in the request.

get

/file-links

Authorizations
Query parameters
createdTimestring · date-time

A filter on the list based on the createdTime field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options:

  • gt—return values where the createdTime field is after this timestamp
  • gte—return values where the createdTime field is after or equal to this timestamp
  • lt—return values where the createdTime field is before this timestamp
  • lte—return values where the createdTime field is before or equal to this timestamp
endingBeforestring

A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list.

startingAfterstring

A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list.

limitinteger · min: 1 · max: 100

A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.

idsstring[]

Only return objects with these IDs.

fileIdstring

Only return links with this file identifier.

expiredboolean

Filter links by expired state. By default, all links are returned.

Responses
curl -L \
  --url 'https://api.digitalriver.com/file-links' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "hasMore": true,
  "data": [
    {
      "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
      "createdTime": "2025-02-23T03:37:29.683Z",
      "expired": false,
      "expiresTime": "2025-02-23T03:37:29.683Z",
      "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
      "liveMode": false,
      "metadata": {
        "coupon": "iOS"
      },
      "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
    }
  ]
}

Creates a new file link object.

post

/file-links

Authorizations
Body
fileIdstringrequired

The identifier of the file to create a link to.

Example: file_b9bb0bce-c20e-4519-945e-45983a1b239b
expiresTimestring · date-timerequired

A future timestamp, after which the link will no longer be usable.

metadataMetadata

Key-value pairs used to store additional data. Value can be string, boolean or integer types.

Example: {"coupon":"iOS"}
Responses
curl -L \
  --request POST \
  --url 'https://api.digitalriver.com/file-links' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"fileId":"file_b9bb0bce-c20e-4519-945e-45983a1b239b","expiresTime":"2025-02-23T03:37:29.683Z","metadata":{"coupon":"iOS"}}'
{
  "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
  "createdTime": "2025-02-23T03:37:29.683Z",
  "expired": false,
  "expiresTime": "2025-02-23T03:37:29.683Z",
  "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
  "liveMode": false,
  "metadata": {
    "coupon": "iOS"
  },
  "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
}

Retrieves the details of a file link. You must supply the unique identifier of the file link.

get

/file-links/{id}

Authorizations
Path parameters
idstringrequired

The identifier of the file link to be retrieved.

Responses
curl -L \
  --url 'https://api.digitalriver.com/file-links/{id}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
  "createdTime": "2025-02-23T03:37:29.683Z",
  "expired": false,
  "expiresTime": "2025-02-23T03:37:29.683Z",
  "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
  "liveMode": false,
  "metadata": {
    "coupon": "iOS"
  },
  "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
}

Updates an existing file link. Expired links can no longer be updated.

post

/file-links/{id}

Authorizations
Path parameters
idstringrequired

The identifier of the file link to be updated.

Body
expiresTimestring · date-timerequired

A future timestamp, after which the link will no longer be usable.

metadataMetadata

Key-value pairs used to store additional data. Value can be string, boolean or integer types.

Example: {"coupon":"iOS"}
Responses
curl -L \
  --request POST \
  --url 'https://api.digitalriver.com/file-links/{id}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"expiresTime":"2025-02-23T03:37:29.683Z","metadata":{"coupon":"iOS"}}'
{
  "id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
  "createdTime": "2025-02-23T03:37:29.683Z",
  "expired": false,
  "expiresTime": "2025-02-23T03:37:29.683Z",
  "fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
  "liveMode": false,
  "metadata": {
    "coupon": "iOS"
  },
  "url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
}

Permanently deletes a file link. Supply the unique identifier of the file link.

delete

/file-links/{id}

Authorizations
Path parameters
idstringrequired

FileLink ID

Responses
curl -L \
  --request DELETE \
  --url 'https://api.digitalriver.com/file-links/{id}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

No body

Last updated