Data Types

ProcessFileAndSave

To process files and save the results:

  1. Create a transformation URL (see ProcessFile docs).

  2. Test the transformation URL (with GET).

  3. Add /save to the URL (after your account ID).

  4. Submit a POST request to the URL (with the request body described below).

Tip: you can use ProcessFile to use GET requests instead. You can leverage Upload's permanent caching to ensure each URL is only processed once, no matter how many times it is requested.

POST https://upcdn.io/{accountId}/save/{transformation}/{filePath}{?params}
cURL
1curl "https://upcdn.io/{accountId}/save/{transformation}/{filePath}{?params}" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d @- << EOF
5 {
6 "destination": {
7 "fileName": "example-{UNIQUE_DIGITS_4}{ORIGINAL_FILE_EXT}"
8 }
9 }
10EOF
Response (200)
1{
2 "accountId": "YOUR_ACCOUNT_ID",
3 "basePath": "/example-path",
4 "baseUrl": "https://upcdn.io/A623uY2/raw/example-path",
5 "summary": {
6 "exampleArtifact": "/example-artifact.txt"
7 }
8}

Request Body

Response Body

URL Parameters

accountId

Your account ID.

This is visible on the settings page:

https://upload.io/dashboard/settings

Example: A623uY2

Type: String

Length: 7

In: Path

Required: Yes

filePath

Absolute path to a file. Begins with a /.

Example: /uploads/image.jpg

Type: String

Min Length: 1

Max Length: 512

In: Path

Required: Yes

transformation

The transformation preset (created in the Upload Dashboard) or transformation API to use:

Archive Processing API: archive

Image Processing API: image

When using transformation APIs: please refer to the documentation for the additional querystring parameters required by that API.

Example: thumbnail

Type: String

Min Length: 1

Max Length: 100

In: Path

Required: Yes

Request Headers

Authorization

Add one of these Authorization header values to your request:

Option 1: prefix "Bearer " to your API key. The result is your Authorization header value.

Option 2: use HTTP basic authorization, specifying apikey as your username, and your API key as your password.

Type: String

In: Header

Required: Yes

Content-Type

This endpoints requires a JSON request body.

Type: String

Value: "application/json"

In: Header

Required: Yes

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: