This documentation applies to WeSeeDo Direct version 2 of the API. This is a beta version.


Introduction

The WeSeeDo Direct API helps you to implement a one-way or two-way, safe and live visual connection in your existing software packages. It enables you to watch and assist customers during a telephone conversation, while the telephone connection remains.

You can integrate the WeSeeDo Direct API within your existing company processes and your own applications using OAuth2, but Single Sign-On integrations such as ADFS are possible as well. WeSeeDo Direct does not store any data other than the metadata you provide for the meetings.

Note: This the API documentation for is version 2 of the API. To see the API documentation for version 1, go to Documentation v1.


API specification

Test the API on SwaggerHub


Base URL

https://api-prd.kpn.com/communication/weseedo/weseedodirect


Conceptual model

WeSeeDo Direct Conceptual Model


Definitions

Agent

A person working for an agency or company that deals with customer queries.

Participant

A person or customer who reports incidents to the agent.


API workflow

WeSeeDo Direct API Workflow


Automatic agent login workflow

WeSeeDo Direct Agent auto login workflow


Requirements

Participant

A mobile device with:

  • A camera.
  • An adequate internet connection, minimum 3G or wifi.
  • A WebRTC supported browser.

Agent

  • A WebRTC supported browser, preferably Google Chrome.
  • A camera is required when using bi-directional video.


Features

  • One-way or two-way visual connection.
  • Direct image of location/situation on site.
  • Existing telephone calls will continue to work.
  • Agents can take pictures of location or situation on-site in the web browser (optional).
  • Agents can chat with participants (optional).


Getting started

The API follows the KPN Store API Authentication Standard to secure the API. It includes the use of OAuth 2.0 client_id and client_secret to receive an access token.

Go to the Authentication tab to find out how to:

  • Authenticate to an API using cURL.
  • Authenticate to an API on Swaggerhub.
  • Import Open API Specifications (OAS), also called Swagger files into Postman.


The following section shows a selection of API requests. Go to the API specification to see all requests.

How to...

Note: You must send the version of the API in the request header: "api-version: v2".


Create new users

This endpoint allows you to create new agent users. Send a request to the POST /management/users endpoint with the details of the user.

You will receive the user credentials (Gebruikersnaam/Wachtwoord) for the sandbox and production environments by e-mail:

Note:

  • If you set a password, users will be able to log in directly to WeSeeDo sandbox using the e-mail address and password.
  • If you don't set a password, users will receive an e-mail at the specified e-mail address with a link to set a password themselves.
  • The password must have at least 8 characters, including 1 lower case character, 1 uppercase character and 1 number.


Request

POST /management/users


^^Request body example^^
{
  "first_name": "John",
  "last_name": "Doe",
  "password": "Password12344321",
  "role": "agent",
  "email": "John.Doe@email.nl",
  "locale": "nl"
}


Response

^^Response example^^
{
  "success": true,
  "result": {
    "id": "5f807e28ac0c2a2958f14d99",
    "first_name": "John",
    "last_name": "Doe",
    "name": "John Doe",
    "email": "John.Doe@email.nl",
    "photo": null,
    "locale": "nl",
    "role": "agent",
    "created_at": "2020-10-09T15:13:44.167Z",
    "sites": [],
    "entity": {
      "type": "company",
      "id": "5f6e1cbd70d9e4667019b299",
      "name": "Company",
      "package": {
        "id": "5d8b63a192975c6fab79ef99",
        "name": "WeSeeDo Direct | Pay as you Go | KPN",
        "features": [
        ]
      }
    },
    "suspended": false
  }
}

Note: The id of the newly created agent user is the user id of the agent that you will use in subsequent requests.


Retrieve user details

Retrieves the details of a specific user.


Request

GET /management/users/{id}

For example:

^^cURL request example^^
 curl -X GET "https://api-prd.kpn.com/communication/weseedo/weseedodirect/management/users/5f807e28ac0c2a2958f14d99?user_status=true" -H  "accept: application/json" -H  "api-version: v2" -H  "Authorization: Bearer 12345nwY3A4CJelyg8OgEAJ12345"


Parameters

Field Description
api-version Header parameter: Add v2 to make a request to version 2 of the API. Example: "api-version: v2"
id Path parameter: Replace {id} with the user id. Example: /users/5f807e28ac0c2a2958f14d99
user_status Query parameter (optional): Select true if you want to include the user status into the response. Select false if you don't. Status can be online or offline. Example: user_status=true


Response

The server will provide a response similar to the response below:

^^Response excerpt^^
{
  "success": true,
  "result": {
    "id": "5f807e28ac0c2a2958f14d99",
    "first_name": "John",
    "last_name": "Doe",
    "name": "John Doe",
    "email": "John.Doe@email.nl",
    "photo": null,
    "locale": "nl",
    "role": "agent",
    "created_at": "2020-09-25T16:51:31.816Z",
    "sites": [],
    "entity": {
      "type": "company",
      "id": "5f6e1cbd70d9e4667019b2a0",
      "name": "Company",
      "package": {
        "id": "5d8b63a192975c6fab79ef33",
        "name": "WeSeeDo Direct | Pay as you Go | KPN",
        "features": [
           ...
        ]
      }
    },
    "suspended": false
  }
}


Update user details

Updates the details of a specific user. If you want to update the user details partially use PATCH, if you want to update them completely use PUT.


Request

PUT/management/users/{id} or PATCH/management/users/{id}


Parameters

Field Description
api-version Header parameter: Add v2 to make a request to version 2 of the API. Example: "api-version: v2"
id Path parameter: Replace {id} with the user id. Example: /users/5f807e28ac0c2a2958f14d99
user_status Query parameter (optional): Select true if you want to include the user status into the response. Select false if you don't. Status can be online or offline. Example: user_status=true


Request

^^Request body example^^
{
  "first_name": "string",
  "last_name": "string",
  "locale": "string"
}

Response

^^Response example^^
{
  "success": true,
  "result": [
    {
      "id": "58..82",
      "first_name": "Testfirstname",
      "last_name": "Testlastname",
      "name": "Testfirstname Testlastname",
      "email": "agent1@weseedo.nl",
      "locale": "nl",
      "role": "agent",
      "created_at": "2017-11-17T12:07:56.308Z",
      "company": {
        "id": "58..82",
        "name": "WeSeeDo B.V."
      }
    }
  ]
}


Delete users

This endpoint allows you to delete individual users.


Request

DELETE/management/users/{id}


Parameters

Field Description
api-version Header parameter: Add v2 to make a request to version 2 of the API. Example: "api-version: v2"
id Path parameter: Replace {id} with the user id. Example: /users/5f807e28ac0c2a2958f14d99
user_status Query parameter (optional): Select true if you want to include the user status into the response. Select false if you don't. Status can be online or offline. Example: ?user_status=true"


Response

^^Response example^^
{
  "success": true,
  "result": {
    "id": "5a..82"
  }
}


Create a new meeting

This endpoint creates a new meeting.

Use an internationally formatted phone number (for example, +31612345678). Dutch formats 0612345678 and 12345678 are automatically converted to their international format +31612345678.

  • If you wish to have a one-way video stream (from participant to agent), specify stream_camera_two_way as false.
  • If you wish to have a two-way video stream, specify stream_camera_two_way as true.
  • If you have your own notification system in place for sending out text messages, and do not wish to use the WeSeeDo Direct SMS service, specify send_sms as false.


Request

POST/direct/meetings

^^Request body example^^
{  
  "agent": "58f6ee406a2308a38ca39dec",
  "phone": "+31612312312",
  "stream_camera_two_way": true,
  "invitation_sms": "Click on the link to join.",
  "send_sms": true
}


Response

^^Response example^^
{
  "success": true,
  "result": {
    "id": "6bbf64a9e13844d1d140d6e2",
    "company": {
      "id": "58h6aa8a0e14a4c24df20760",
      "name": "Company 1",
      "contact": {
        "id": "784d061c0856dc4c97774da7",
        "first_name": "Firstname",
        "last_name": "Lastname",
        "email": "contact1@weseedo.nl",
        "phone": "+31612345678",
        "language": "nl"
      }
    },
    "room_id": "9Pusrq3Do43DAEQnOG9aCtLFfl2FoURd",
    "room_password": "O0p48P2TuMavG0EAtMSdpy4PbkO2h2",
    "stream_camera_two_way": true,
    "duration": 0,
    "room_created": "2020-03-27T18:43:07.000Z",
    "room_available_from": "2020-03-27T18:43:07.000Z",
    "room_available_till": "2020-04-03T18:43:07.000Z",
    "created_by": {
      "id": "58f6ee406a2308a38ca39dec",
      "name": "Firstname Lastname"
    },
    "participants": [
      {
        "username": "agent.89f6aa406a2307a38da39a4r",
        "name": "Agent 1",
        "id": "5aedbd02e138231a7c1d7719",
        "user": "58f6ee406a2308a38ca39dec",
        "email": "agent1@weseedo.nl",
        "initial_participant": true,
        "sessions": [
          "sessions"
        ],
        "hash": "qj7OqoxSt2zK6S16my8VZ28N1IigzvNl_jMz42wlA8Dj59DKV0G8zAc6PJ8LvWiHx",
        "url": "https://login-direct.weseedo.nl/meeting/qj7OqoxSt2zK6S16my8VZ28N1IigzvNl_jMz42wlA8Dj59DKV0G8zAc6PJ8LvWiHx"
      },
      {
        "username": "visitor.Cxo9uuYVYFAJDW47",
        "phone": "+3112312312",
        "id": "5aedbd02e138231a7c1d7820",
        "initial_participant": true,
        "sessions": [
          "sessions"
        ],
        "hash": "wCPjvYM7yf7KBwGVU0OsFG6DVBAGqZ5s_6PFMcsoR0GBeKIF8AhkngSqUy9UXBubA",
        "url": "https://login-direct.weseedo.nl/meeting/wCPjvYM7yf7KBwGVU0OsFG6DVBAGqZ5s_6PFMcsoR0GBeKIF8AhkngSqUy9UXBubA"
      }
    ]
  }
}

Unique URLs are created for all participants. You can use this URL to, for example, redirect an agent to the URL for this specific meeting straight away. The generated link will only be valid for this specific meeting.

If send_sms is specified as true, a text message is sent to the participant's smartphone. The participant needs to click on the secure link and allow access to the camera of the phone. The video will start streaming immediately to the agent.


Enable auto-login

This endpoint allows users to be able to automatically log in to the WeSeeDo Direct web interface by generating a login URL. Redirect the user to the generated URL to log the user in automatically without the need to enter a username and password.

Sign in a user with role agent or agent_assistant and receive URLs to access the agent dashboard. Your client needs to have permissions for the given agent ID in the request body. In case you are already signed in as agent with OAuth2, you will still receive the URLs to access the agent dashboard.


Request

POST/auth/autologin


Parameters

Field Description
api-version Header parameter: Add v2 to make a request to version 2 of the API. Example: "api-version: v2"


^^Request body example^^
{
  "agent": "58f6ee406a2308a38ca39dec",
  "product": "direct"
}


Response

The server provides a Redirect URL, which allows the agent to log in to the portal:

^^Response Redirect URL example^^
{
  "success": true,
  "result": {
    "url": "https://login.weseedo.nl/#/conversation/adminK1TRnQ2hAErCEpfbXwtYBCtVhLepFoHTldaFN7ewTrYgpO9t3A5VZpzMxGnvrhJoRMoUG6HzYM25X2zo7MveGNO0ndlTwUzrt5zIHRwKWZSkSWsR48mQoNGbBoNmrxoRxFOYLzWiaJATWH3y5sTOV0yeI2gT7OdjoKTXk1S0iKcsqilyqy3APPDimgYAaK9G8zvFIyAlPQUm9IbhjbyUrWCf1F1tEjgZoR1pownJqRirEc2C96h7t5NAlF"
  }
}


URLs to sandbox and production site

  • WeSeeDo sandbox: https://sandbox-direct.weseedo.nl/login/REPLACE_WITH_ACCESS_TOKEN_OF_AGENT.
  • WeSeeDo production: https://login-direct.weseedo.nl/login/REPLACE_WITH_ACCESS_TOKEN_OF_AGENT.

When using the URLs mentioned above, the agent will automatically be logged in and able to use the application.

The user interface also provides the ability to create meetings. If you want to prevent the agent from creating meetings that way and only want to add the agent to a specific WeSeeDo Direct session, you can redirect the user to the url that is generated when creating a meeting.

The given URLs send the participant to a limited web interface, which only allows to:

  • Wait for a participant to click the link in the SMS.
  • Perform the video call.
  • When the call ends, the agent is redirected to a page indicating that the call has ended. The normal user interface to schedule meetings will not be accessible to the agent.


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.


HTTP response headers

The following tables display the standard response headers that are returned with each API response:


Standard response field name Description
sunset This field will be populated with the deprecation details. By default the value is n/a.
api-version Indicates the API version you have used.
quota-interval Used to specify an integer (for example, 1, 2, 5, 60, and so on) that will be paired with the quota-time-unit you specify (minute, hour, day, week, or month) to determine a time period during which the quota use is calculated.
For example, an interval of 24 with a quota-time-unit of hour means that the quota will be calculated over the course of 24 hours.
quota-limit Number of API calls an user can make within a given time period.
If this limit is exceeded, the user will be throttled and API requests will fail.
quota-reset-UTC All quota times are set to the Coordinated Universal Time (UTC) time zone.
quota-time-unit Used to specify the unit of time applicable to the quota.
For example, an interval of 24 with a quota-time-unit of hour means that the quota will be calculated over the course of 24 hours.
quota-used Number of API calls made within the quota.
strict-transport-security The HTTP Strict-Transport-Security (HSTS) response header lets a web site tell browsers that it should only be accessed using HTTPS, instead of using HTTP. All present and future subdomains will be HTTPS for a maximum of 1 year and access is blocked to pages or sub domains that can only be served over HTTP including HSTS preload lists of web browsers.
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload.

Access control field name Description
access-control-allow-credentials Tells browsers whether to expose the response to frontend JavaScript samp when the request's credentials mode (Request.credentials) is include.
When a request's credentials mode (Request.credentials) is include, browsers will only expose the response to frontend JavaScript samp if the Access-Control-Allow-Credentials value is true. Boolean.
access-control-allow-origin Indicates whether the response can be shared with requesting samp from the given origin.
access-control-allow-headers Used in response to a pre-flight request which includes the Access-Control-Request-Headers to indicate which HTTP headers can be used during the actual request.
access-control-max-age Indicates how long the results of a pre-flight request (that is the information contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers) can be cached.
access-control-allow-methods Indicates which HTTP methods are allowed on a particular endpoint for cross-origin requests.
For example: GET, PUT, POST, DELETE.
content-length The Content-Length entity header indicates the size of the entity-body, in bytes, sent to the recipient.
content-type The Content-Type entity header the client what the content type of the returned content actually is.

Mopinion feedback