Authentication and Usage

You will need authentification to try out and use any of the API links. For the authentication a basic access authentication is used. Below you will find an example username and password, which can be used for the first steps. However, these example credentials may be subject to correction, therefore we do not guarantee them to be operational. To get your own login, please contact the mailo IT team.
Username: 3vjh9dv5tk1drha2ac5sik8rbb
Password: 1phe7tiap8volpfe8dp7r8erk5e3mgd10k7a9mjvfu4dn5n3kbl2

Usage via Swagger

You will find a detailed documentation with all routes, how to authenticate and how to use here: https://app.swaggerhub.com/apis/mailo-AG/mailo-test-api/1.0.1 This is the link to the testsystem to get started. Please see below („environments“) for the production system.
 

Quick Start with CURL

First, authorize via the /auth route with the following header:
Authorization: Basic <base64(Username:Password)>
The received token is valid for 60 minutes and should be placed in the header:
Authorization: Bearer
With this token, all other links of the API can be accessed.
#!/bin/bash
CLIENT_ID=3vjh9dv5tk1drha2ac5sik8rbb
CLIENT_SECRET=1phe7tiap8volpfe8dp7r8erk5e3mgd10k7a9mjvfu4dn5n3kbl2
AUTH_URL=https://api.testmailo.de/auth
API_PRODUCTS_URL=https://api.testmailo.de/v1/products

# Missing Authorization header; will return a 401
curl -D - ${API_PRODUCTS_URL}

# get access token (ttl 60min)
TOKEN=$(curl -X POST --user $CLIENT_ID:$CLIENT_SECRET "${AUTH_URL}" -H 'Content-Type: application/x-www-form-urlencoded' | jq -r '.access_token')

# get all available products (this time with valid token)
curl -D - -H "Authorization: Bearer ${TOKEN}" ${API_PRODUCTS_URL}

# get properties for rechstanwaelte
API_PROPERTY_URL=https://api.testmailo.de/v1/products/rechtsanwaelte/properties

curl -D - -H "Authorization: Bearer ${TOKEN}" ${API_PROPERTY_URL}

# get premium for rechtsanwaelte
API_PRICE_URL=https://api.testmailo.de/v1/products/rechtsanwaelte/premium

curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d "{\"rechtsanwaelte\":{\"haft_vsh_deckungssumme\":\"500000\"}}" ${API_PRICE_URL}    

Deviations from standard conventions

Where possible, mailo tries to obey the openAPI 3.0 and general rest standard conventions. The biggest deviation from the standard convention is, that we are using a post request to get a premium (/products/{productId}/premium). The reason for this is, that at least one, but at maximum approx. 15 properties are needed to determine a premium. We decided to put this into a post request, instead of having all the properties as params in the url.
 

Environments

Production

api.mailo.de (https://app.swaggerhub.com/apis/mailo-AG/mailo-api) is the link to the production system. It is most stable and will deliver the best performance. This should be used for integration.

Test

api.testmailo.de (https://app.swaggerhub.com/apis/mailo-AG/mailo-test-api) links to the mailo test system. To try the API out, and for testing purposes, this link should be used

Menü schließen