KPN

Disturbance Check - KPN

KPN

Check for network disturbance for any address in the Netherlands

Fast and reliable network disturbance information

  • Network

API reference on SwaggerHub

Introduction

This API allows you to check whether there are any network disturbances for any address in the Netherlands.

Conceptual model

Conceptual model

API workflow

Sequence diagram

Getting started

Authentication

To authenticate you'll need to request an access token. Use your API Store app's credentials (Consumer Key and Consumer Secret) to make an authentication request. The authorization service returns a JSON message that contains the access_token field.

Use one of the following 3 options:

cURL

Execute below cURL command to receive an access token. Replace APP_CONSUMER_KEY and APP_CONSUMER_SECRET with your app's credentials.

curl -X POST \
 'https://api-prd.kpn.com/oauth/client_credential/accesstoken?grant_type=client_credentials' \
 -H 'content-type: application/x-www-form-urlencoded' \
 -d 'client_id=APP_CONSUMER_KEY&client_secret=APP_CONSUMER_SECRET'

If you are using cURL for Windows, please use the command below instead.

curl -X POST "https://api-prd.kpn.com/oauth/client_credential/accesstoken?grant_type=client_credentials" -H "content-type: application/x-www-form-urlencoded" -d "client_id=APP_CONSUMER_KEY&client_secret=APP_CONSUMER_SECRET"

The authentication service returns a JSON message that contains the access token field.

{
    "refresh_token_expires_in": "0",
    "api_product_list": "[xxxxxxx]",
    "api_product_list_json": [
        " xxxxxxx"
    ],
    "organization_name": "kpn",
    "developer_email": "demo123@kpn.com",
    "token_type": "Bearer",
    "issued_at": "1521039195424",
    "client_id": "APP_CONSUMER_KEY",
    "access_token": "haf2SDl07E9N7RluNQ4kJ1TkGgso",
    "application_name": "6e38edxxxxxxxxxxxxxxxx4065d79c",
    "scope": "",
    "expires_in": "3599",
    "refresh_count": "0",
    "status": "approved"
}

SwaggerHub

  1. Click on the Authorize button on the top right.
  2. In the form, fill in client_id and client_secret, using your app's credentials.
  3. Click Authorize.

Postman

When using Postman, you will have to import the Swagger file into a Postman collection as follows:

  1. Open the API reference on SwaggerHub.
  2. On the top right, click Export, click Download API and click 'YAML Unresolved'.
  3. In Postman from the menu click File and click Import... Choose the YAML file you downloaded in the previous step. A new collection will be added.
  4. Select Get Access Token from the collection.
  5. Make sure the right environment is selected, corresponding to the API.
  6. Edit the environment variables client_id and client_secret, using your app's credentials.
  7. Check the response code and message.
  8. Press the Send button to get an access token.

Note: Request variables are no longer linked to an environment, but to the collection.

How to...

Check network disturbances for an address

SwaggerHub:

  1. Check disturbance GET /address.
  2. Click Try it out.
  3. Supply zip_code and house_number.
  4. Click Execute.
  5. Check the response code and message.

Postman:

  1. GET (CheckDisturbance).
  2. Supply zip_code and house_number.
  3. Click Send.
  4. Check the response code and message.

If it's a valid address, the result of the call will look like the following:

{
    "broadband": [
        {
            "id": 2068,
            "affected_elements_count": 1,
            "affected_customers_count": 316,
            "communicated_customers_sms_count": 147,
            "communicated_customers_email_count": 150,
            "type": "geographical-broadband",
            "cause": "disturbance",
            "source": "gui",
            "service": null,
            "state": "open",
            "start_date": "2018-11-14T14:18:00Z",
            "end_date": "2018-11-15T18:18:00Z",
            "region": "HOOGEZAND",
            "description": null,
            "long_description": "<p>Door een storing ervaar je mogelijk verminderde dienstverlening van internet, bellen, tv-kijken of pinnen op je vaste aansluiting. Onze excuses hiervoor. Wij stellen alles in het werk om de storing zo spoedig mogelijk op te lossen.</p>\r\n\r\n<p><b>Storing opgelost</b><br>\r\nMaar werkt het toch nog niet goed? Schakel dan je modem uit en weer aan. Schakel na 10 minuten ook je tv-ontvanger uit en weer aan. Binnen 15 minuten werken de diensten weer.</p>",
            "serviceguard_ticket_id": null,
            "created_at": "2018-11-14T14:20:03.581084Z",
            "communication_type": null,
            "user": null
        }
    ],
    "fixed": [],
    "mobile": [],
    "generic": [
        {
            "id": 1419,
            "affected_elements_count": 0,
            "affected_customers_count": 0,
            "communicated_customers_sms_count": 0,
            "communicated_customers_email_count": 0,
            "type": "generic",
            "cause": "disturbance",
            "source": "gui",
            "service": "Webmail",
            "state": "open",
            "start_date": "2018-03-26T13:27:34Z",
            "end_date": "2018-08-31T21:59:00Z",
            "region": null,
            "description": "Webmail niet beschikbaar",
            "long_description": "",
            "serviceguard_ticket_id": "webmail",
            "created_at": "2017-07-31T12:52:51.495004Z",
            "communication_type": null,
            "user": 8
        },
        {
            "id": 1438,
            "affected_elements_count": 0,
            "affected_customers_count": 0,
            "communicated_customers_sms_count": 0,
            "communicated_customers_email_count": 0,
            "type": "generic",
            "cause": "disturbance",
            "source": "gui",
            "service": "Other",
            "state": "open",
            "start_date": "2018-03-26T13:26:36Z",
            "end_date": "2018-04-26T13:26:49Z",
            "region": null,
            "description": "Prepaid opwaarderen niet mogelijk",
            "long_description": "Tijdelijk is het niet mogelijk om u prepaid tegoed op te waarderen.",
            "serviceguard_ticket_id": "prepaid",
            "created_at": "2017-08-16T09:56:33.942384Z",
            "communication_type": null,
            "user": 8
        }
    ]
}

Return codes

Code   Description
200   Success
201   Created
202   Accepted
302   Found. Link in location header
400   Bad request
401   Unauthorized
403   Forbidden
404   Not found
405   Method not allowed
412   Precondition failed
429   Too many requests
500   Internal server error
502   Bad gateway
503   Service unavailable