Suomi.fi for Service Developers
Go directly to contents.

POST API

The POST API enables directing and storing forms that end users have filled in your organisation's e-service to Suomi.fi Messages. By doing so your organisation can supplement its form service without the need for an e-service that can store forms. At the same time, submitting forms becomes more secure.

The POST API functions according to the following:

  1. The end user must have Suomi.fi Messages enabled, or they must activate the service before submitting the form.
  2. The end user fills in the form you have defined in your e-service.
  3. Submitting the form requires strong identification. If a person who does not have Suomi.fi Messages enabled attempts to submit the form, the submission will fail and they will receive an error message.
  4. The form submitted by the end user is delivered to Suomi.fi Messages using the POST API.
  5. The content of the form that is visible to the end user is stored in the end user’s electronic mailbox in Suomi.fi Messages.
  6. The content of the form is then forwarded from Suomi.fi Messages to your organisation via the interface that supports the reply functionality you have enabled.

Please note that like the last point of the above list describes, the POST API must always be used alongside another interface that supports two-way messaging. This enables the delivery of the form's content to your organisation. The POST API is only used for directing the form to Suomi.fi Messages.

Due to the identification requirement an end user may not send forms on behalf of another party.

Using the POST API

The POST API is called by a POST call, for example an HTML form. The action parameter of the form is the address of the POST interface to be used. The actual data fields required by Suomi.fi Messages are fields inside the form, usually of the "hidden input" type. They are listed in Table 2.

The form also contains HTML form fields that are visible to the end user. Their type and other properties can be selected freely, as long as their names are not the same as the fields used by Suomi.fi Messages. The JavaScript code at the end of this article exports the contents of the visible HTML fields as an attachment that is sent along with the form.

The example in this instruction (at the bottom of the page) uses both a PDF and an XML attachment. If necessary, the attachment type could also be something else, such as DOC. The visibility of the attachment to the end user is configured in the TiedostoPiilotettu field. The attachment will always be delivered to your organisation even if it is not displayed to the end user.

The sent message must always contain at least one attachment. The maximum number of attachments is 10 and their combined maximum size is 10 Mb

Table 1 lists the action addresses of the POST API in the testing and production environment. If the addresses require a separate identification, your organisation will be provided with the necessary credentials.

Environment

Address

The testing environment

https://viestilomake.qa.suomi.fi/form

The production environment

https://viestilomake.suomi.fi/form

Table 1. The action addresses of the POST interface.

POST form fields

Table 2 lists the POST form fields that are used in Suomi.fi Messages. 

Field

Explanation

Type

ViranomaisTunnus

The ID used to identify your organisation, for example viranomainen_ws. The ID is given by Suomi.fi Messages. 

string

PalveluTunnus

The ID used to identify your organisation's service, for example viranomainen_ws_palvelu. The ID is given by Suomi.fi Messages. 

string

Nimeke

Form title

string

Kuvausteksti

A textual description of the content of the form. The actual content will be delivered as an attachment.

string

Paluuosoite

The URL address that serves as the return address of the POST API. Suomi.fi Messages adds a piece of information as a parameter to the URL return address. The parameter indicates whether the end user has sent the message or interrupted the sending at some point (Delivered=1 or 0).

string

PalaaAutomaattisesti

If the value of this flag is 1, the system will return automatically to the return address (if any) after the form has been sent

bit (0 or 1)

ViranomaisenEmail

The email address of your organisation to which the message can be routed. In use when the return channel is based on the SMTP API. 

string

TiedostoNimi_1

Name of attachment 1

string

TiedostoSisalto_1

Contents of attachment 1 as a Base64 encoded string

string

TiedostoMuoto_1

MIME type of attachment 1

string

TiedostoPiilotettu_1

If the value of this flag is 1, attachment 1 is not shown to the end user in Suomi.fi Messages (for example the data of the form in xml format)

bit (0 or 1)

As above for possible attachments 2 – 9

-

TiedostoNimi_10

Name of attachment 10

string

TiedostoSisalto_10

Contents of attachment 10 as a Base64 encoded string

string

TiedostoMuoto_10

MIME type of attachment 10

string

TiedostoPiilotettu_10

If the value of this flag is 1, attachment 10 is not shown to the end user in Suomi.fi Messages (for example the data of the form in xml format)

bit (0 or 1)

Table 2. POST form fields used by Suomi.fi Messages.


Updated: 2/1/2026

Are you satisfied with the content on this page?