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:Header | Description | Example |
---|---|---|
X-Customer-Id | The ID of the customer which submits the form | cst_123abc456def |
X-Form-Id | The ID of the form which is submitted | frm_123abc456def |
GET
method, the request will be query parameters. An example:
Your form:
Field name | Field value |
---|---|
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 aGET
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:
Header | Description | Example |
---|---|---|
Accept | MijnKlantportaal always expects a JSON-object | application/json |
X-Customer-Id | The ID of the customer the data is for | cst_123abc456def |
X-Form-Id | The ID of the form to fill | frm_123abc456def |
Field name |
---|
name |
sex |
age |
JSON