Admin sessions

This endpoint is used to access the Customers User Interface as an Administrator (staff). The created admin session will not interrupt active customer sessions.

Warning

In case when both the Customer and Admin are accessing the UI at the same time, some changes made by one of the parties can not be automatically reflected for the other party. It is therefore recommended not to initiate both sessions simultaneously in order to to avoid an unsatisfactory user experience for the customer.

The following HTTP method is available:

Creating an admin session

Use the HTTP POST method to create a new admin session:

POST

/api/rest/public/operator/customer_admin_sessions

Request and Response examples:

http

POST /api/rest/public/operator/customer_admin_sessions HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

{
  "data": {
    "type": "customer_admin_sessions",
    "relationships": {
      "customer": {
        "data": {
          "id": "123",
          "type": "customers"
        }
      }
    }
  }
}

curl

curl -i -X POST https://api.telecom.center/api/rest/public/operator/customer_admin_sessions -H 'Content-Type: application/vnd.api+json' --data-raw '{"data": {"relationships": {"customer": {"data": {"id": "123", "type": "customers"}}}, "type": "customer_admin_sessions"}}' --user username:password

response

HTTP/2 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "sessions",
    "attributes": {
      "uri": "https://custom.phone.systems?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQzNzEsImV4cCI6MTU5ODYxNzQyMX0._l5wIR74Cm8rku7vk9ZHCP-AhDMu2ESAb732irl18YM"
    }
  }
}

The uri attribute in the response body contains a full URL with an included token for redirecting to the UI.

Example URL: https://phone.systems/ui/index.html?x-admin-token=trZdERpmNSJWTrnpOzeXDqTaWwDRJSnp

Redirect the admin to the provided URL. As a result, the admin is automatically logged in to the phone.systems™ User Interface and can make modifications to the customer’s PBX account.