Automated file upload via SV‑FTN‑API
SV‑FTN‑API is a REST application that can be used to automate the upload of files to the Swedish Fund Selection Agency (for example the quarterly portfolio data file).
Overview
Endpoint
POST https://www.ftn.se/rest-api/sv-ftn-api/uploadFiles
Authentication
- Supply your username and password with each request (-u username:password in curl examples below).
- The credentials must be configured by the Swedish Fund Selection Agency in advance.
Upload methods
You can upload a file in three different ways:
- As a regular file using multipart/form-data
- As Base64‑encoded content
- By providing a URL from which the file can be fetched
For methods 2 and 3 you must always provide both filename and either fileBase64 or fileUrl.
- Multipart/form‑data (recommended for simple integrations)
Send the file directly as part of the request body.
Example (curl):
curl -X POST "https://www.ftn.se/rest-api/sv-ftn-api/uploadFiles" \
-u username:password \
-F "file=@your-file-name.xlsx"
Use this method if your integration tool or script already supports file uploads as multipart/form‑data.
- Base64‑encoded file
Send the file content as a Base64‑encoded string together with the filename.
Required parameters:
- fileBase64 – the Base64‑encoded file content
- filename – the file name including extension
Example (curl using form data):
curl -X POST "https://www.ftn.se/rest-api/sv-ftn-api/uploadFiles" \
-u username:password \
-d "fileBase64=LnN2LX...&filename=your-file-name.xlsx"
These parameters can be sent either as query parameters in the URL or in the request body (form data). Choose the option that best matches your integration platform.
- File URL
Provide a public URL from which the file can be downloaded, together with the filename that should be used when storing the file.
Required parameters:
- fileUrl – URL to the file
- filename – the file name including extension
Example (curl using query parameters):
curl -X POST \
"https://www.ftn.se/rest-api/sv-ftn-api/uploadFiles?filename=your-file-name.xlsx&fileUrl=https://examplefile.com/document/1-mb-pdf" \
-u username:password
As with the Base64 option, filename and fileUrl can be provided either in the query string or in the request body as form data.
Response codes
The endpoint returns standard HTTP status codes together with a short message. The most common responses are:
- 200 OK – the file has been uploaded successfully.
- 400 Bad Request – the request is invalid, for example:
- No file was sent
- filename and fileUrl are missing (for method 3)
- filename and fileBase64 are missing (for method 2)
- 403 Forbidden – authorisation problem:
- The user is not correctly configured
- The user has no write permission on any page
- The user has permissions on more than one page (ambiguous target)
- 409 Conflict – a file with the same filename already exists.
- 415 Unsupported Media Type – the file type or the file extension is not allowed.
- 500 Internal Server Error – an unexpected server‑side error occurred.
In case of an error, adjust the request according to the message returned and try again.