Secure messaging for your business

The messaging solution for secure communication


Quick start

Make sure you’ve read Getting Started.

About

Use this API for your chat solution. It enables a secure communication between your agent/bot desktop and client website/mobile app.

How it works

To get started and test the API from your local workstation you can use Postman or our API Reference (powered by SwaggerHub) or cURL as an HTTP client. If you use the Postman collection or API Reference, make sure you update the environment settings with your credentials in order to authenticate.

 

 

 

 

 

Connect to the API

To start testing the API you need to get authorization credentials. Log in to your account and create a developer app on the My Apps page. The steps to create a developer app are briefly discussed under 'Support' 🡆 'Frequently Asked Questions'.

Get access token

Copy your app's credentials and replace APP_CONSUMER_KEY and APP_CONSUMER_SECRET with the copied values, then execute the below cURL command to receive an access token.

You can use same token to make multiple 'API' calls, provided the token is active. If the token expires then you can repeat this step.


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 authorization service returns a JSON message that contains the access token field.

{
    "refresh_token_expires_in": "0",
    "api_product_list": "[Messenger - Parley]",
    "api_product_list_json": [
        "KPN-v1-Demo"
    ],
    "organization_name": "kpn",
    "developer.email": "demo123@kpn.com",
    "token_type": "BearerToken",
    "issued_at": "1521039195424",
    "client_id": "2Xvp2YLhEeT8w4cXQWvKuOpMoHQQ9zGx",
    "access_token": "haf2SDl07E9N7RluNQ4kJ1TkGgso",
    "application_name": "6e38ed2d-48b1-4362-97d6-04254065d79c",
    "scope": "",
    "expires_in": "3599",
    "refresh_count": "0",
    "status": "approved"
}

To sign the API request use the access_token from the last step and add it to the HTTP header.


Authorization: Bearer access_token