Authentication
Log in to the system and log out from the system. For more details, please refer to: https://support.portsip.com/development-portsip/developer-guide/rest-apis/authentication.
Retrieve system metadata information.
If the optional domain
query parameter is specified,
the relevant tenant metadata information will be returned together.
System metadata:
web_domain
private_ipv4
public_ipv4
enable_ipv6
private_ipv6
public_ipv6
primary_dns_server
secondary_dns_server
Tenant metadata:name
domain
website
avatar_url
enable_ms365_integration
ms365_authorization_endpoint
Use the domain
query parameter to retrieve just a subset of a collection.
GET /api/info HTTP/1.1
Host: hostname:8887
Accept: */*
{
"web_domain": "example.com",
"private_ipv4": "127.0.0.1",
"public_ipv4": "127.0.0.1",
"enable_ipv6": false,
"private_ipv6": "::1",
"public_ipv6": "::1",
"primary_dns_server": "127.0.0.1",
"secondary_dns_server": "127.0.0.1",
"name": "example",
"domain": "example.com",
"website": "example.com",
"avatar_url": "avatar.com/avatar",
"enable_ms365_integration": false,
"ms365_authorization_endpoint": "/ms365"
}
Sign in with credentials
false
The user's account name.
Only letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).
Username cannot start or end with period (.).
admin
, system
, administrator
, and root
are reserved names for system admin only with case ignored.
The password of user.
The SIP domain of tenant.
It is usually a fully qualified domain name (FQDN).
If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.
The SIP domain name is only used for SIP message authentication and does not require analysis.
POST /api/auth/sign_in HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 53
{
"username": "text",
"password": "text",
"domain": "text"
}
{
"two_factor_enabled": true,
"token": "text"
}
Sign in with social account
The name of IdP provider. Currently only supports microsoft.
The SIP domain of tenant.
It is usually a fully qualified domain name (FQDN).
If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.
The SIP domain name is only used for SIP message authentication and does not require analysis.
The callback url for authentication flow.
POST /api/auth/sign_in/{provider} HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 39
{
"domain": "text",
"callback_url": "text"
}
{
"url": "text"
}
Request to verify OTP from email.
The session token in authentication flow.
The OTP code in authentication flow.
POST /api/auth/verify_otp HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 30
{
"token": "text",
"code": "text"
}
No content
Initiate authentication forget password flow.
The SIP domain of tenant.
It is usually a fully qualified domain name (FQDN).
If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.
The SIP domain name is only used for SIP message authentication and does not require analysis.
The user's account name.
Only letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).
Username cannot start or end with period (.).
admin
, system
, administrator
, and root
are reserved names for system admin only with case ignored.
The callback url for authentication flow.
POST /api/auth/forget_password HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 57
{
"domain": "text",
"username": "text",
"callback_url": "text"
}
No content
Reset password with session token.
The session token in authentication flow.
The password of user.
POST /api/auth/reset_password HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"token": "text",
"new_password": "text"
}
No content
Refresh the access token.
The refresh token.
POST /api/auth/refresh_token HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"refresh_token": "text"
}
{
"token_type": "text",
"access_token": "text",
"refresh_token": "text",
"expires_in": 1
}
Get the authentication information of the logged-in user.
GET /api/auth/user HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"role": "User",
"password_verified": true,
"password_force_reset": false
}
Get login status of current session.
GET /api/login HTTP/1.1
Host: hostname:8887
Accept: */*
{
"access_token": "4DFCF1D4C30B4D798ECE3AE43769F008.",
"expires_at": "2017-07-21T17:32:28Z",
"expires_in": 1800,
"role": "User"
}
Login with username and password.
The user's account name.
Only letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).
Username cannot start or end with period (.).
admin
, system
, administrator
, and root
are reserved names for system admin only with case ignored.
The password of user.
The SIP domain of tenant.
It is usually a fully qualified domain name (FQDN).
If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.
The SIP domain name is only used for SIP message authentication and does not require analysis.
POST /api/login HTTP/1.1
Host: hostname:8887
Content-Type: application/json
Accept: */*
Content-Length: 53
{
"username": "text",
"password": "text",
"domain": "text"
}
No content
login with Microsoft Identity Provider by Authorization Code Flow.
The SIP domain of tenant.
It is usually a fully qualified domain name (FQDN).
If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.
The SIP domain name is only used for SIP message authentication and does not require analysis.
POST /api/login/by_microsoft HTTP/1.1
Host: hostname:8887
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 17
"domain='text'"
No content