Account login
Request
usernamestring
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.passwordstring
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
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.expiresinteger
required
Time interval for access token expiration, in seconds. If the access token is not refreshed before the expiry, the token will become invalid.rolestring
required
User type. It could be "administrator", "tenant" or "extension".api_versionstring
required
API version number.
Sample Response
{
"access_token": "196ACE20C6F34027895F7F95402BB164",
"expires": 600,
"role": "tenant",
"api_version": "2.0.0"
}
Account login by email
Request
emailstring
required
Email for Extension.passwordstring
required
"Web Access Password" of extension instead of extension's SIP password.
Sample Request
{
"email": "sample@sample.com",
"password": "sample access password"
}
Response
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.expiresinteger
required
Time interval for access token expiration, in seconds. If the access token is not refreshed before the expiry, the token will become invalid.rolestring
required
User type. It could be "administrator", "tenant" or "extension".api_versionstring
required
API version number.extension_numberstring
required
Extension's extension number.extension_passwordstring
required
Extension's sip password.domainstring
required
Tenant's domain.transportsarray
required
Show child attributesCollection of call session objects.
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
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.usernamestring
required
The name of tenant or admin user. It's used for logging into PortSIP PBX.domainstring
required
Tenant's domain.passwordstring
required
The password for new user.enabledboolean
required
Indicates if it has been enabled for the new user.profileobject
required
Show child attributesProfile settings for tenant.office_hoursobject
required
Show child attributesOffice hours settings for tenant.capabilityobject
required
Show child attributesCapability settings for tenant.smtpobject
required
Show child attributesSMTP settings for tenant.quotaobject
required
Show child attributesQuota settings for tenant.cdrobject
required
Show child attributesCDR event settings for tenant.extension_eventobject
required
Show child attributesExtension event settings for tenant.smsobject
required
Show child attributesSMS settings for tenant.
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
Sample Response
List accounts
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.paginationinteger
required
The pagination of paging.pagesizeinteger
optional
The size of paging.sort_byenum
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
paginationinteger
required
The pagination of paging.pagesizeinteger
optional
The size of paging.sort_byenum
optional
Values include "DEFAULT" and "Optional". Default value will be used when user does not specify value for this field.page_countinteger
required
The total count of pages.countinteger
required
Current pagesize.tenantsarray
required
Show child attributesAPI version.
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
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.usernamestring
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
usernamestring
required
The name of tenant or admin user. It's used for logging into PortSIP PBX.domainstring
required
The domain of tenant or admin user.enabledboolean
required
Indicates if it has been enabled for the new user.profileobject
required
Show child attributesProfile settings for tenant.office_hoursobject
required
Show child attributesOffice hours settings for tenant.capabilityobject
required
Show child attributesCapability settings for tenant.mail_serverobject
required
Show child attributesSMTP settings for tenant.quotaobject
required
Show child attributesQuota for tenant.cdrobject
required
Show child attributesCDR settings for tenant.extension_eventobject
required
Show child attributesExtension event for tenant.smsobject
required
Show child attributesSMS for tenant.
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
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.usernamestring
required
The name of tenant or admin user. It's used for logging into PortSIP PBX.domainstring
required
The domain of tenant or admin user.enabledboolean
required
Indicates if it has been enabled for the new user.profileobject
required
Show child attributesProfile settings for tenant.office_hoursobject
required
Show child attributesOffice hours settings for tenant.capabilityobject
required
Show child attributesCapability settings for tenant.mail_serverobject
required
Show child attributesSMTP settings for tenant.quotaobject
required
Show child attributesQuota for tenant.cdrobject
required
Show child attributesCDR settings for tenant.extension_eventobject
required
Show child attributesExtension event for tenant.smsobject
required
Show child attributesSMS for tenant.
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
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.usernamestring
required
The username of the tenant to be deleted.
Sample Request
{
"access_token": "196ACE20C6F34027895F7F95402BB164",
"username": "tenant"
}
Response
Sample Response
Account sign out
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.
Sample Request
{
"access_token": "196ACE20C6F34027895F7F95402BB164"
}
Response
Sample Response
Periodic refreshment of access token
Request
access_tokenstring
required
Access token is a 32-byte string with validity of 30 seconds.
Sample Request
{
"access_token": "196ACE20C6F34027895F7F95402BB164"
}
Response
expiresinteger
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
}