MWP Api documentation

Welcome to the documentation page of this API. This API provides access to all the KPN Modern Workplace entities using Azure Active Directory authentication. To acquire access to this API you will need to complete the following steps:

  • Create an application registration in your own tenant
    • Fill in a name for your app-registration
    • Leave all settings to default: Accounts in this organizational directory only (Your tenant only - Single tenant)
    • Click Register
    • Copy the Application (client) ID
    • Create a secret to be able to request an access token
  • Send the AppID of the application registration to your KPN Modern Workplace contact
  • Acquire an access token for the API using the Azure AD token endpoint (see example below)
  • Send request to the API with the access token and the required version

Acquiring an access token:

For authentication you should get at token from Azure AD using an application registration credentials from your Azure AD Tenant. To retrieve a token for the API see the example below.

URL: https://login.microsoftonline.com/{Your_Tenant}/oauth2/v2.0/token/

Method: POST

HEADERS: ["content-type":"application/x-www-form-urlencoded"]

BODY:

{
    "grant_type": "client_credentials", 
    "client_id" : "{application_id}",
    "client_secret" : "{client_secret}",
    "scope" : "https://kpnwp.onmicrosoft.com/kpnmwp{d|t|p}mwpapi/.default"
}
                            

Making a call to the MWP API:

With the access token from the last step you can now call any API call defined in the documentation below. For every call you should specify which version you want to use in the header "Mwp-Api-Version". For example the current version you are looking at is v1.0 so the header value should be "1.0". See the example below to get a user:

URL: https://mwpapi.kpnwerkplek.com/api/users/{objectid_user}

METHOD: GET

HEADERS:

[
    "Authorization": "Bearer {access_token}"
    "content-type": "application/json",
    "Mwp-Api-Version": "{version_number}"
]
                            

Important notes:

PagedResultFilterOptions request is used on almost all collections to filter said collection. It is important to know that not all options are always supported on each collection. Please check the documentation above the endpoint to see which are supported.

When querying a collection for which the count is to large for one response there will also be a NextLink property returned. Pass this value into the SkipToken to the next request to get the next page. If there is no NextLink returned there is no next page.