Skip to main content
With Forms, you can bring your own interacting form to your customer portal. You can build whatever you want as long as it can be formatted as a submittable form, like a settings page for hosting settings. To let your form interact with your API, you should know how we call your APIs to send and (optional) retrieve data.

Always respond with a 2xx status code

If your endpoint does not response with a status code in the 200-range, MijnKlantportaal will consider the request, both sending and retrieving, as failed and so showing your customer an error message.

Sending data

When your customer submits the form, we call your API endpoint with the HTTP method which you set yourself. The request will always contain the following headers:
HeaderDescriptionExample
X-Customer-IdThe ID of the customer which submits the formcst_123abc456def
X-Form-IdThe ID of the form which is submittedfrm_123abc456def
The body will contain JSON with your field names and the value entered by your customer. In case of a GET method, the request will be query parameters. An example: Your form:
Field nameField value
nameJohn Doe
age20
sexmale
The request body or query parameters to your endpoint:
{
    "name": "John Doe",
    "age": 20,
    "sex": "male"
}

Retrieving data

You can pre-fill your form by setting a retrieving data endpoint. You can choose between a GET or POST method. The endpoint should return a JSON-object with the fields which you have specified. Any missing fields in your response will be considered as null and so left empty. Any extra fields which are not corresponding with any of your form fields, will be discarded. The request will always contain the following headers:
HeaderDescriptionExample
AcceptMijnKlantportaal always expects a JSON-objectapplication/json
X-Customer-IdThe ID of the customer the data is forcst_123abc456def
X-Form-IdThe ID of the form to fillfrm_123abc456def
Your form:
Field name
name
sex
age
The response body:
JSON
{
  "name": "John Doe",
  "nationality": "Dutch", // Will be ignored since field 'nationality' does not exist
  "sex": "male"
  // 'age' will be left empty in the form, since no data is returned for that field
}
I