API Docs for: 2.6
Show:

plugin_rest_configmanager Class

Module: plugins_rest
Parent Module: com_config_manager_rest

REST plugin that provides configuration manager functions through the following REST API:

GET requests

  1. configmanager/userconf
  2. configmanager/usernames
  3. configmanager/remote_sites
  4. configmanager/remote_usernames
  5. configmanager/chatserver
  6. configmanager/userendpoints
  7. configmanager/queue_autologin
  8. configmanager/queue_autologout
  9. configmanager/alluserendpoints
  10. configmanager/remote_alluserendpoints
  11. configmanager/auto_dndon_logout
  12. configmanager/auto_dndoff_login
  13. configmanager/default_extension

configmanager/userconf

Returns the configurations of the user.

Example JSON response:

{
    "click2call": {
         "type": "manual",
         "automatic": {
             "user": "admin",
             "password": "admin"
         }
    },
    "notifications": {
         "postit": {
             "sms": {
                 "when": "never",
                 "to": "0123456789"
             },
             "email": {
                 "when": "never",
                 "to": "ale@nethesis.it"
             }
         },
         "voicemail": {
             "sms": {
                 "when": "never",
                 "to": "0123456789"
             },
             "email": {
                 "when": "never",
                 "to": "ale@nethesis.it"
             }
         }
    },
    "queue_auto_login": false,
    "queue_auto_logout": false,
    "auto_dndon_logout": false,
    "auto_dndoff_login": false,
    "default_extension": "614"
}

configmanager/usernames

Returns the list of all the usernames, each of one with its name and surname.

Example JSON response:

{
    "giovanni": {
         "name": "User 1",
         "surname": "Surname 1"
    },
    "alessandro": {
         "name": "User 2",
         "surname": "Surname 2"
    }
}

configmanager/remote_sites

Returns the list of all the remote sites with their staus data.

Example JSON response:

{
    "nethesis": {
        "connected": true
    },
    "ranocchi": {
        "connected": false
    }
}

configmanager/remote_usernames

Returns the list of all the usernames of all remote sites, each of one with its name and surname.

Example JSON response:

{
    "nethesis": {
        "giovanni": {
             "name": "User 1",
             "surname": "Surname 1"
        },
        "alessandro": {
             "name": "User 2",
             "surname": "Surname 2"
        }
    },
    "ranocchi": {
        "user3": {
             "name": "User 3",
             "surname": "Surname 3"
        },
        "user4": {
             "name": "User 4",
             "surname": "Surname 4"
        }
    }
}

configmanager/chatserver

Returns the server chat parameters.

Example JSON response:

{
    "url": "https://ale-nethvoice.mycompany.local/http-bind",
    "domain": "mycompany.local"
}

configmanager/userendpoints

Returns the endpoints of the current user.

Example JSON response:

{
    "email": {
         "ale@nethesis.it": {
             "id": "ale@nethesis.it"
         }
    },
    "jabber": {
         "alessandro@mycompany.local": {
             "id": "alessandro@mycompany.local"
         }
    },
    "nethcti": {
         "mobile": {
             "id": "mobile",
             "status": "offline"
         },
         "desktop": {
             "id": "desktop",
             "status": "online"
         }
    },
    "calendar": {},
    "extension": {
         "611": {
             "id": "611"
         },
         "614": {
             "id": "614"
         }
    },
    "cellphone": {
         "0123456789": {
             "id": "0123456789"
         }
    },
    "voicemail": {
         "614": {
             "id": "614"
         }
    }
}

configmanager/remote_alluserendpoints

Returns the endpoints of all users of all remote sites.

Example JSON response:

{
    "nethesis": {
        "alessandro": {
             "email": {
                 "ale@nethesis.it": {
                     "id": "ale@nethesis.it"
                 }
             },
             "jabber": {
                 "alessandro@mycompany.local": {
                     "id": "alessandro@mycompany.local"
                 }
             },
             ...
        }
        "andrea": {
             "email": {
                 "andrea@mycompany.local": {
                     "id": "andrea@mycompany.local"
                 }
             },
             ...
        }
    },
    "ranocchi": {
        "user3": {
             "email": {
                 "ale@nethesis.it": {
                     "id": "ale@nethesis.it"
                 }
             },
             "jabber": {
                 "alessandro@mycompany.local": {
                     "id": "alessandro@mycompany.local"
                 }
             },
             ...
        }
        "user4": {
             "email": {
                 "andrea@mycompany.local": {
                     "id": "andrea@mycompany.local"
                 }
             },
             ...
        }
    }
}

configmanager/alluserendpoints

Returns the endpoints of all users.

Example JSON response:

{
    "alessandro": {
         "email": {
             "ale@nethesis.it": {
                 "id": "ale@nethesis.it"
             }
         },
         "jabber": {
             "alessandro@mycompany.local": {
                 "id": "alessandro@mycompany.local"
             }
         },
         "nethcti": {
             "mobile": {
                 "id": "mobile",
                 "status": "offline"
             },
             "desktop": {
                 "id": "desktop",
                 "status": "online"
             }
         },
         "calendar": {},
         "extension": {
             "611": {
                 "id": "611"
             },
             "614": {
                 "id": "614"
             }
         },
         "cellphone": {
             "0123456789": {
                 "id": "0123456789"
             }
         },
         "voicemail": {
             "614": {
                 "id": "614"
             }
         }
    }
    "andrea": {
         "email": {
             "andrea@mycompany.local": {
                 "id": "andrea@mycompany.local"
             }
         },
         "jabber": {
             "andrea@mycompany.local": {
                 "id": "andrea@mycompany.local"
             }
         },
         "nethcti": {
             "mobile": {
                 "id": "mobile",
                 "status": "offline"
             },
             "desktop": {
                 "id": "desktop",
                 "status": "offline"
             }
         },
         "calendar": {},
         "extension": {
             "605": {
                 "id": "605"
             }
         },
         "cellphone": {
             "555-5555": {
                 "id": "555-5555"
             }
         },
         "voicemail": {
             "605": {
                 "id": "605"
             }
         }
    }
}

configmanager/queue_autologin

Returns the automatic queue login of the user.

Example JSON response:

{ "queue_autologin": true }

configmanager/queue_autologout

Returns the automatica queue logout of the user.

Example JSON response:

{ "queue_autologout": true }

configmanager/default_extension

Returns the default extension of the user.

Example JSON response:

{
    "default_extension": "614"
}

configmanager/auto_dndon_logout

Returns the automatic dnd ON status on logout of the user.

Example JSON response:

{ "auto_dndon_logout": true }

configmanager/auto_dndoff_login

Returns the automatic dnd OFF status on login of the user.

Example JSON response:

{ "auto_dndoff_login": true }

POST requests

  1. configmanager/click2call
  2. configmanager/notification
  3. configmanager/presence
  4. configmanager/queue_autologin
  5. configmanager/queue_autologout
  6. configmanager/default_extension
  7. configmanager/auto_dndon_logout
  8. configmanager/auto_dndoff_login

configmanager/click2call

Saves the user configuration of the click to call. The request must contain the following parameters:

  • type: ("manual" | "automatic") the click2call type
  • [user]: the device username. It's needed with automatic type
  • [password]: the device password. It's needed with automatic type

Example JSON request parameters:

{ "type": "manual" }
{ "type": "automatic", "user": "admin", "password": "admin" }

configmanager/notification

Saves a user notification configuration. The request must contain the following parameters:

  • type: ("voicemail" | "postit") the notification type
  • method: ("email" | "sms") the delivery method
  • when: ("always" | "never" | "offline") the value to be set for the specified key

Example JSON request parameters:

{ "type": "voicemail", "method": "email", "when": "offline" }

configmanager/presence

Sets the specified presence of the user. The request must contain the following parameters:

  • type: ("nethcti") the type of the presence to set
  • status: ("online" | "offline" | "busy" | "away") the nethcti presence status
  • device_type: ["desktop" | "mobile"] the device type used by the user for nethcti. It's needed when type is equal to "nethcti"

Example JSON request parameters:

{ "type": "nethcti", "device_type": "desktop", "status": "online" }

configmanager/default_extension

Sets the default extension of the user. The request must contain the following parameters:

  • extenId: the extension identifier

Example JSON request parameters:

{ "extenId": "614" }

configmanager/queue_autologin

Sets the automatic login of the user in all its dynamic queues when login to cti. The request must contains the following parameters:

  • enable: ("true" | "false") true if the automatic login is to be activated

Example JSON request parameters:

{ "enable": "true" }

configmanager/queue_autologout

Sets the automatic logout of the user from all its dynamic queues when logout from cti. The request must contains the following parameters:

  • enable: ("true" | "false") true if the automatic logout is to be activated

Example JSON request parameters:

{ "enable": "true" }

configmanager/auto_dndon_logout

Sets the automatic dnd ON status when user logout from cti. The request must contains the following parameters:

  • enable: ("true" | "false") true if the automatic dnd ON on logout is to be activated

Example JSON request parameters:

{ "enable": "true" }

configmanager/auto_dndoff_login

Sets the automatic dnd OFF status when user login to cti. The request must contains the following parameters:

  • enable: ("true" | "false") true if the automatic dnd OFF on login is to be activated

Example JSON request parameters:

{ "enable": "true" }

Methods

alluserendpoints

(
  • req
  • res
  • next
)

Returns the endpoints of all users by the following REST API:

alluserendpoints

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

auto_dndoff_login

(
  • req
  • res
  • next
)

Manages both GET and POST requests to get/set the auto_dndoff_login of the user with the following REST API:

GET  auto_dndoff_login
POST auto_dndoff_login

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

auto_dndon_logout

(
  • req
  • res
  • next
)

Manages both GET and POST requests to get/set the auto_dndon_logout of the user with the following REST API:

GET  auto_dndon_logout
POST auto_dndon_logout

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

autoDndOffLoginGet

(
  • req
  • res
  • next
)

Gets the automatic dnd OFF status when user login to cti.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

autoDndOffLoginSet

(
  • req
  • res
  • next
)

Sets the automatic dnd OFF status when user login to cti.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

autoDndOnLogoutGet

(
  • req
  • res
  • next
)

Gets the automatic dnd ON status when user logout from cti.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

autoDndOnLogoutSet

(
  • req
  • res
  • next
)

Sets the automatic dnd ON status when user logout from cti.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

chatserver

(
  • req
  • res
  • next
)

Get all the server chat parameters by the following REST API:

chatserver

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

default_extension

(
  • req
  • res
  • next
)

Manages both GET and POST requests to get/set the default_extension of the user with the following REST API:

GET  default_extension
POST default_extension

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

defaultExtensionGet

(
  • req
  • res
  • next
)

Gets the default extension of the user.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

defaultExtensionSet

(
  • req
  • res
  • next
)

Sets the default extension of the user.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

notification

(
  • req
  • res
  • next
)

Saves a user click to call configuration with the following REST API:

click2call

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

notification

(
  • req
  • res
  • next
)

Save a user notification configuration with the following REST API:

notification

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

presence

(
  • req
  • res
  • next
)

Sets the specified presence of the user with the following REST API:

presence

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

queue_autologin

(
  • req
  • res
  • next
)

Manages both GET and POST requests to get/set the queue_autologin of the user with the following REST API:

GET  queue_autologin
POST queue_autologin

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

queue_autologout

(
  • req
  • res
  • next
)

Manages both GET and POST requests to get/set the queue_autologout of the user with the following REST API:

GET  queue_autologout
POST queue_autologout

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

queueAutoLoginGet

(
  • req
  • res
  • next
)

Gets the automatic queue login of the user.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

queueAutoLoginSet

(
  • req
  • res
  • next
)

Sets the automatic queue login when user login to cti.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

queueAutoLogoutGet

(
  • req
  • res
  • next
)

Gets the automatic queue logout of the user.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

queueAutoLogoutSet

(
  • req
  • res
  • next
)

Sets the automatic queue logout when user logout from cti.

Parameters:

  • req Object

    The request object

  • res Object

    The response object

  • next Object

remote_alluserendpoints

(
  • req
  • res
  • next
)

Returns the endpoints of all users of all remote sites by the following REST API:

remote_alluserendpoints

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

remote_sites

(
  • req
  • res
  • next
)

Gets the list of all remote sites with their status data with the following REST API:

remote_sites

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

setCompAuthorization

(
  • ca
)

Set authorization architect component.

Parameters:

  • ca Object

    The authorization architect component.

setCompComNethctiRemotes

(
  • comp
)

Set remote sites communication architect component.

Parameters:

  • comp Object

    The remote sites communication architect component.

setCompConfigManager

(
  • cm
)

Set configuration manager architect component used by configuration functions.

Parameters:

  • cm Object

    The configuration manager architect component.

setCompUser

(
  • comp
)

Set user architect component used for user functions.

Parameters:

  • comp Object

    The user architect component.

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility architect component.

setLogger

(
  • log
)
static

Set the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

userconf

(
  • req
  • res
  • next
)

Get all user configurations by the following REST API:

userconf

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

userendpoints

(
  • req
  • res
  • next
)

Get all the user endpoints by the following REST API:

userendpoints

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

userslist

(
  • req
  • res
  • next
)

Gets the list of all the username each of one with its name and surname with the following REST API:

usernames

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

userslist

(
  • req
  • res
  • next
)

Gets the list of all the username of all remote sites each of one with its name and surname with the following REST API:

remote_usernames

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

Properties

compAuthorization

Object private

The architect component to be used for authorization.

compComNethctiRemotes

Object private

The remote sites communication architect component.

compConfigManager

Object private

The configuration manager architect component used for configuration functions.

compUser

Object private

The architect component to be used for user functions.

compUtil

Object private

The utility architect component.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • userconf String

    To get all user configurations

  • usernames String

    To get the list of all the username

  • chatserver String

    To get the server chat parameters

  • remote_sites String

    To get the list of all remote sites with their status data

  • userendpoints String

    To get all the endpoints of the user

  • queue_autologin String

    To get the automatic queue login when user login into the cti

  • queue_autologout String

    To get the automatic queue logout when user logout from cti

  • remote_usernames String

    To get the list of all the username of all remote sites

  • alluserendpoints String

    To get the endpoints of all users

  • remote_alluserendpoints String

    To get the endpoints of all users of all remote sites

  • default_extension String

    To get the default extension of the user

  • auto_dndon_logout String

    To get the automatic dnd ON status when user logout from cti

  • auto_dndoff_login String

    To get the automatic dnd OFF status when user login to cti

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/configmanager]

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console

post

Array

REST API to be requested using HTTP POST request.

Sub-properties:

  • presence String

    To set a presence of the user

  • click2call String

    To save the click to call mode of the user

  • notification String

    To save a user notification setting

  • queue_autologin String

    To set the automatic queue login when user login into the cti

  • queue_autologout String

    To set the automatic queue logout when user logout from cti

  • auto_dndon_logout String

    To save the automatic dnd ON status when user logout from cti

  • auto_dndoff_login String

    To save the automatic dnd OFF status when user login to cti