File links

Use the File Links resource to share the contents of a File object with your customers.‌

You can create a file link when you want to share the contents of a File object with a customer. A file link contains a URL that you can use to share the contents of a file with an unauthenticated user.‌

The File Links resource allows you to:

Create a file link

To create a file link, send a POST request to https://api.digitalriver.com/file-links.

Request header example
Request header example
POST https://files.digitalriver.com/file-links
Authorization:[bearer {secret key}]
Accept:[application/json]

‌Include the file link information in the body like this:

Request body example
Request body example
{
"fileId": "file_b9bb0bce-c20e-4519-945e-45983a1b239b",
"expiresTime": "2020-04-25T20:36:00Z"
}

‌ A successful request returns the FileLink object:

FileLink object example
FileLink object example
{
"id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
"createdTime": "2018-04-25T20:36:00Z",
"expired": false,
"expiresTime": "2020-04-25T20:36:00Z",
"fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
"liveMode": false,
"url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
}

Update a file link

To update a file link, send a POST request to https://api.digitalriver.com/file-links and provide the file link identifier.

Request header example
Request header example
POST https://api.digitalriver.com/file-links/:{id}
Authorization:[bearer {secret key}]
Accept:[application/json]

‌Include the file link information in the body like this:

Request body example
Request body example
{
"expiresTime": "2020-04-25T20:36:00Z"
}

‌A successful request returns the FileLink object:

FileLink object example
FileLink object example
{
"id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
"createdTime": "2018-04-25T20:36:00Z",
"expired": false,
"expiresTime": "2020-04-25T20:36:00Z",
"fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
"liveMode": false,
"url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
"updatedTime": "2018-05-25T20:36:00Z",
}

Retreive a file link

To retrieve a file link, send a GET request to https://api.digitalriver.com/file-links and provide the file link identifier.

Request header example
Request header example
POST https://files.digitalriver.com/file-links/:id
Authorization:[bearer {secret key}]
Accept:[application/json]

‌A successful request returns the FileLink object:

FileLink object example
FileLink object example
{
"id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
"createdTime": "2018-04-25T20:36:00Z",
"expired": false,
"expiresTime": "2020-04-25T20:36:00Z",
"fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
"liveMode": false,
"url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
}

Return a list of all file links

To retrieve a list of all file links, send a GET request to https://api.digitalriver.com/file-links and provide the file link identifier.

Request header example
Request header example
POST https://files.digitalriver.com/file-links/:id
Authorization:[bearer {secret key}]
Accept:[application/json]

‌A successful request returns the FileLink object:

FileLink object example
FileLink object example
{
"hasMore": true,
"data":
[
{
"id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
"createdTime": "2018-04-25T20:36:00Z",
"expired": false,
"expiresTime": "2020-04-25T20:36:00Z",
"fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
"liveMode": false,
"url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
},
{
"id": "link_d992b05c-31d3-485e-b1f7-7b95f06cbfe8",
"createdTime": "2018-04-25T20:36:00Z",
"expired": false,
"expiresTime": "2020-04-25T20:36:00Z",
"fileId": "file_09e2464f-9b4f-482b-ae89-732183c705be",
"liveMode": false,
"url": "https://files.digitalriver.com/links/fl_29a093a2-8989-4def-a50c-d8950d1436d4"
}
]
}