Account login

POST /account/credentials/verify
This API is used to verify the validity of user's credential. It returns HTTP 200 message code and access_token for the successful authentication of a certain PBX account; and a 400 error code and an error message if failed.

Request

Placeholders
  • username

    string

    required

    Username for admin, tenant or extension account. When executing verification against extension's account, it must be in the format of extension_number@sipdomain, e.g. 101@yourcompany.com.
  • password

    string

    required

    By default, password for admin user is admin. For extension, the password should be the "Web Access Password" of extension instead of extension's SIP password.

Sample Request

{
    "username": "admin",
    "password": "admin"
}

Response

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • expires

    integer

    required

    Time interval for access token expiration, in seconds. If the access token is not refreshed before the expiry, the token will become invalid.
  • role

    string

    required

    User type. It could be "administrator", "tenant" or "extension".
  • api_version

    string

    required

    API version number.

Sample Response

{
    "access_token": "196ACE20C6F34027895F7F95402BB164",
    "expires": 600,
    "role": "tenant",
    "api_version": "2.0.0"
}

Account login by email

POST /account/email/verify
This API is used to verify the validity of user's credential. It returns HTTP 200 message code and access_token for the successful authentication of a certain PBX account; and a 400 error code and an error message if failed.

Request

Placeholders
  • email

    string

    required

    Email for Extension.
  • password

    string

    required

    "Web Access Password" of extension instead of extension's SIP password.

Sample Request

{
    "email": "sample@sample.com",
    "password": "sample access password"
}

Response

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • expires

    integer

    required

    Time interval for access token expiration, in seconds. If the access token is not refreshed before the expiry, the token will become invalid.
  • role

    string

    required

    User type. It could be "administrator", "tenant" or "extension".
  • api_version

    string

    required

    API version number.
  • extension_number

    string

    required

    Extension's extension number.
  • extension_password

    string

    required

    Extension's sip password.
  • domain

    string

    required

    Tenant's domain.
  • transports

    array

    required

    Collection of call session objects.
    Show child attributes

Sample Response

{
    "access_token": "196ACE20C6F34027895F7F95402BB164",
    "expires": 600,
    "role": "tenant",
    "api_version": "2.0.0",
    "extension_number": 10001,
    "extension_password": 123456,
    "domain": "sampledomain.com",
    "transports": [
        {
            "protocol": "UDP",
            "port": 5060
        }
    ]
}

Create account

POST /account/create
Note: A maximum of five tenant users could be created. This feature is available to admin user only.

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • username

    string

    required

    The name of tenant or admin user. It's used for logging into PortSIP PBX.
  • domain

    string

    required

    Tenant's domain.
  • password

    string

    required

    The password for new user.
  • enabled

    boolean

    required

    Indicates if it has been enabled for the new user.
  • profile

    object

    required

    Profile settings for tenant.
    Show child attributes
  • office_hours

    object

    required

    Office hours settings for tenant.
    Show child attributes
  • capability

    object

    required

    Capability settings for tenant.
    Show child attributes
  • smtp

    object

    required

    SMTP settings for tenant.
    Show child attributes
  • quota

    object

    required

    Quota settings for tenant.
    Show child attributes
  • cdr

    object

    required

    CDR event settings for tenant.
    Show child attributes
  • extension_event

    object

    required

    Extension event settings for tenant.
    Show child attributes
  • sms

    object

    required

    SMS settings for tenant.
    Show child attributes

Sample Request

{
    "access_token": "196ACE20C6F34027895F7F95402BB164",
    "username": "tenant",
    "domain": "example.com",
    "password": "Aasd21123",
    "enabled": true,
    "profile": {
        "first_name": "first name",
        "last_name": "last name",
        "email": "example@example.com",
        "company_name": "example company name",
        "company_website": "example website",
        "region": "China",
        "timezone": "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
        "currency": "USD",
        "billing_for_outbound_calls": false,
        "billing_for_inbound_calls": false,
        "enable_extension_change_password": true,
        "enable_extension_video_recording": false,
        "enable_extension_audio_recording": false
    },
    "office_hours": {
        "monday_from": "09:00",
        "monday_to": "17:00",
        "tuesday_from": "09:00",
        "tuesday_to": "17:00",
        "wednesday_from": "09:00",
        "wednesday_to": "17:00",
        "thursday_from": "09:00",
        "thursday_to": "17:00",
        "friday_from": "09:00",
        "friday_to": "17:00",
        "saturday_from": "09:00",
        "saturday_to": "17:00",
        "sunday_from": "09:00",
        "sunday_to": "17:00"
    },
    "capability": {
        "max_extensions": -1,
        "max_concurrent_calls": -1,
        "max_ring_groups": -1,
        "max_virtual_receptionists": -1,
        "max_call_queues": -1,
        "max_conference_rooms": -1
    },
    "smtp": {
        "smtp_server": "sample.com",
        "smtp_server_port": 12345,
        "smtp_reply_addr": "sample@sample.com",
        "smtp_username": "sample name",
        "smtp_passwd": "sample password",
        "smtp_security_type": "NO_SECURITY"
    },
    "quota": {
        "max_recordings_quota": 0,
        "max_voicemail_quota": 0,
        "max_call_report_quota": 0,
        "auto_clean_recordings_days": 7,
        "auto_clean_voicemail_days": 7,
        "auto_clean_call_reports_days": 7
    },
    "cdr": {
        "enabled": true,
        "authentication_method": "GET",
        "username": "username",
        "password": "password",
        "cdr_url": "http://www.cdr-url.com"
    },
    "extension_event": {
        "enabled": true,
        "auth_method": "GET",
        "username": "username",
        "password": "password",
        "event_url": "http://www.extension-event-url.com"
    },
    "sms": {
        "enabled": true,
        "provider": "clickatell",
        "token": "example token"
    }
}

Response

Placeholders.

Sample Response

List accounts

GET /account/list
NOTE: Only available to admin user.

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • pagination

    integer

    required

    The pagination of paging.
  • pagesize

    integer

    optional

    The size of paging.
  • sort_by

    enum

    optional

    Values include "DEFAULT" and "Optional". Default value will be used when user does not specify value for this field.

Sample Request

https://example.com/api/account/list?access_token=196ACE20C6F34027895F7F95402BB164&pagesize=100&pagination=1&sort_by=DEFAULT

Response

Placeholders
  • pagination

    integer

    required

    The pagination of paging.
  • pagesize

    integer

    optional

    The size of paging.
  • sort_by

    enum

    optional

    Values include "DEFAULT" and "Optional". Default value will be used when user does not specify value for this field.
  • page_count

    integer

    required

    The total count of pages.
  • count

    integer

    required

    Current pagesize.
  • tenants

    array

    required

    API version.
    Show child attributes

Sample Response

{
    "pagination": 1,
    "pagesize": 100,
    "sort_by": "DEFAULT",
    "page_count": 100,
    "count": 100,
    "tenants": [
        {
            "username": "tenant",
            "first_name": "Sample name",
            "last_name": "Sample name",
            "company_name": "Sample name",
            "domain": "sample.com",
            "max_extensions": 100,
            "max_concurrent_calls": 100,
            "enabled": true
        }
    ]
}

Show account details

GET /account/show

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • username

    string

    required

    The username of the tenant or admin user. Admin user has access to details for his account and other tenant users', whilst tenant user has access to his account info only.

Sample Request

Response

Placeholders
  • username

    string

    required

    The name of tenant or admin user. It's used for logging into PortSIP PBX.
  • domain

    string

    required

    The domain of tenant or admin user.
  • enabled

    boolean

    required

    Indicates if it has been enabled for the new user.
  • profile

    object

    required

    Profile settings for tenant.
    Show child attributes
  • office_hours

    object

    required

    Office hours settings for tenant.
    Show child attributes
  • capability

    object

    required

    Capability settings for tenant.
    Show child attributes
  • mail_server

    object

    required

    SMTP settings for tenant.
    Show child attributes
  • quota

    object

    required

    Quota for tenant.
    Show child attributes
  • cdr

    object

    required

    CDR settings for tenant.
    Show child attributes
  • extension_event

    object

    required

    Extension event for tenant.
    Show child attributes
  • sms

    object

    required

    SMS for tenant.
    Show child attributes

Sample Response

{
    "username": "tenant",
    "domain": "example.com",
    "enabled": true,
    "profile": {
        "first_name": "first name",
        "last_name": "last name",
        "email": "example@example.com",
        "company_name": "example company name",
        "company_website": "example website",
        "region": "China",
        "timezone": "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
        "currency": "USD",
        "billing_for_outbound_calls": false,
        "billing_for_inbound_calls": false,
        "enable_extension_change_password": true,
        "enable_extension_video_recording": false,
        "enable_extension_audio_recording": false
    },
    "office_hours": {
        "monday_from": "09:00",
        "monday_to": "17:00",
        "tuesday_from": "09:00",
        "tuesday_to": "17:00",
        "wednesday_from": "09:00",
        "wednesday_to": "17:00",
        "thursday_from": "09:00",
        "thursday_to": "17:00",
        "friday_from": "09:00",
        "friday_to": "17:00",
        "saturday_from": "09:00",
        "saturday_to": "17:00",
        "sunday_from": "09:00",
        "sunday_to": "17:00"
    },
    "capability": {
        "max_extensions": -1,
        "max_concurrent_calls": -1,
        "max_ring_groups": -1,
        "max_virtual_receptionists": -1,
        "max_call_queues": -1,
        "max_conference_rooms": -1
    },
    "mail_server": {
        "smtp_server": "sample.com",
        "smtp_server_port": 12345,
        "smtp_reply_addr": "sample@sample.com",
        "smtp_username": "sample name",
        "smtp_passwd": "sample password",
        "smtp_security_type": "NO_SECURITY"
    },
    "quota": {
        "max_recordings_quota": 0,
        "max_voicemail_quota": 0,
        "max_call_report_quota": 0,
        "auto_clean_recordings_days": 7,
        "auto_clean_voicemail_days": 7,
        "auto_clean_call_reports_days": 7,
        "used_recordings_quota": 100,
        "used_voicemail_quota": 100,
        "used_call_report_quota": 100
    },
    "cdr": {
        "enabled": true,
        "authentication_method": "GET",
        "username": "username",
        "password": "password",
        "cdr_url": "http://www.cdr-url.com"
    },
    "extension_event": {
        "enabled": true,
        "auth_method": "GET",
        "username": "username",
        "password": "password",
        "event_url": "http://www.extension-event-url.com"
    },
    "sms": {
        "enabled": true,
        "provider": "clickatell",
        "token": "example token"
    }
}

Update account

POST /account/update

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • username

    string

    required

    The name of tenant or admin user. It's used for logging into PortSIP PBX.
  • domain

    string

    required

    The domain of tenant or admin user.
  • enabled

    boolean

    required

    Indicates if it has been enabled for the new user.
  • profile

    object

    required

    Profile settings for tenant.
    Show child attributes
  • office_hours

    object

    required

    Office hours settings for tenant.
    Show child attributes
  • capability

    object

    required

    Capability settings for tenant.
    Show child attributes
  • mail_server

    object

    required

    SMTP settings for tenant.
    Show child attributes
  • quota

    object

    required

    Quota for tenant.
    Show child attributes
  • cdr

    object

    required

    CDR settings for tenant.
    Show child attributes
  • extension_event

    object

    required

    Extension event for tenant.
    Show child attributes
  • sms

    object

    required

    SMS for tenant.
    Show child attributes

Sample Request

{
    "access_token": "196ACE20C6F34027895F7F95402BB164",
    "username": "tenant",
    "domain": "example.com",
    "enabled": true,
    "profile": {
        "first_name": "first name",
        "last_name": "last name",
        "email": "example@example.com",
        "company_name": "example company name",
        "company_website": "example website",
        "region": "China",
        "timezone": "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
        "currency": "USD",
        "billing_for_outbound_calls": false,
        "billing_for_inbound_calls": false,
        "enable_extension_change_password": true,
        "enable_extension_video_recording": false,
        "enable_extension_audio_recording": false
    },
    "office_hours": {
        "monday_from": "09:00",
        "monday_to": "17:00",
        "tuesday_from": "09:00",
        "tuesday_to": "17:00",
        "wednesday_from": "09:00",
        "wednesday_to": "17:00",
        "thursday_from": "09:00",
        "thursday_to": "17:00",
        "friday_from": "09:00",
        "friday_to": "17:00",
        "saturday_from": "09:00",
        "saturday_to": "17:00",
        "sunday_from": "09:00",
        "sunday_to": "17:00"
    },
    "capability": {
        "max_extensions": -1,
        "max_concurrent_calls": -1,
        "max_ring_groups": -1,
        "max_virtual_receptionists": -1,
        "max_call_queues": -1,
        "max_conference_rooms": -1
    },
    "mail_server": {
        "smtp_server": "sample.com",
        "smtp_server_port": 12345,
        "smtp_reply_addr": "sample@sample.com",
        "smtp_username": "sample name",
        "smtp_passwd": "sample password",
        "smtp_security_type": "NO_SECURITY"
    },
    "quota": {
        "max_recordings_quota": 0,
        "max_voicemail_quota": 0,
        "max_call_report_quota": 0,
        "auto_clean_recordings_days": 7,
        "auto_clean_voicemail_days": 7,
        "auto_clean_call_reports_days": 7
    },
    "cdr": {
        "enabled": true,
        "authentication_method": "GET",
        "username": "username",
        "password": "password",
        "cdr_url": "http://www.cdr-url.com"
    },
    "extension_event": {
        "enabled": true,
        "auth_method": "GET",
        "username": "username",
        "password": "password",
        "event_url": "http://www.extension-event-url.com"
    },
    "sms": {
        "enabled": true,
        "provider": "clickatell",
        "token": "example token"
    }
}

Response

Sample Response

Delete account

POST /account/destroy
NOTE: This feature is available for the admin user only.

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.
  • username

    string

    required

    The username of the tenant to be deleted.

Sample Request

{
    "access_token": "196ACE20C6F34027895F7F95402BB164",
    "username": "tenant"
}

Response

Placeholders

Sample Response

Account sign out

POST /account/sign_out
Use this method to sign out current account.

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.

Sample Request

{
    "access_token": "196ACE20C6F34027895F7F95402BB164"
}

Response

Placeholders

Sample Response

Periodic refreshment of access token

POST /account/token/refresh
Periodic refreshment of access token. It is recommended to refresh the access token before its expiry. It returns 400 error code and an error message for validation failure (due to invalid access token or timeout). User needs to call account/credentials/verify to obtain new access token.

Request

Placeholders
  • access_token

    string

    required

    Access token is a 32-byte string with validity of 30 seconds.

Sample Request

{
    "access_token": "196ACE20C6F34027895F7F95402BB164"
}

Response

Placeholders
  • expires

    integer

    required

    Time interval for access token expiration, in seconds. The access token will be invalid if it is not refreshed before the expiration.

Sample Response

{
    "expires": 600
}