API Docs for: 2.6
Show:

plugin_rest_callernote Class

Module: plugins_rest
Parent Module: com_caller_note_rest

REST plugin that provides caller note functions through the following REST API:

GET requests

  1. callernote/get_allbynum/:num

callernote/get_allbynum/:num

Gets all the created caller notes by the user and the publics by the others for the specified phone number.

Example JSON response:

[
    {
       "creationdate": "11/06/2014"
       "creationtime": "14:26:12"
       "expirationdate": "12/06/2014"
       "expirationtime": "10:30:00"
       "id": 5
       "public": 1
       "reservation": 0
       "number": "609"
       "creator": "alessandro"
       "text": "test"
    }
]

POST requests

  1. callernote/create
  2. callernote/modify
  3. callernote/delete

callernote/create

The client cretes a new caller note. The request must contains the following parameters:

  • text: the message
  • number: the phone number to associate the note
  • visibility: ("public" | "private") If it's private only the user can view it, otherwise all other users can do it
  • expirationDate: the expiration date of the note. Together with expirationTime, after that the note remains stored but isn't more showed up. It must be espressed in the format YYYYMMDD. e.g. to express the date of "12 june 2013" you must use "20130612"
  • expirationTime: the expiration time of the note. It must be espressed in the format HHmmss. e.g. to express the time of "21:00:45" you must use "210045"
  • reservation: (true | false) if the user want to booking the next call from the specified number

Example JSON request parameters:

{ "text": "some text", "number": "123456", "visibility": "public", "expirationDate": "20131001", "expirationTime": "210045", "reservation": "true" }

callernote/modify

The client modify his caller note. The request must contains the following parameters:

  • id: the caller note identifier in the NethCTI caller note database
  • [text]: the message
  • [number]: the phone number to associate the note
  • [visibility]: ("public" | "private") If it's private only the user can view it, otherwise all other users can do it
  • [expirationDate]: the expiration date of the note. Together with expirationTime, after that the note remains stored but isn't more showed up. It must be espressed in the format YYYYMMDD. e.g. to express the date of "12 june 2013" you must use "20130612". It requires the expirationTime
  • [expirationTime]: the expiration time of the note. It must be espressed in the format HHmmss. e.g. to express the time of "21:00:45" you must use "210045". It requires the expirationDate
  • [reservation]: (true | false) if the user want to booking the next call from the specified number

Example JSON request parameters:

{ "id": "71", "text": "some text" }

callernote/delete

The client delete his caller note. The request must contains the following parameters:

  • id: the caller note identifier in the NethCTI caller note database

Example JSON request parameters:

{ "id": "71" }

Methods

create

(
  • req
  • res
  • next
)

Gets all the created caller notes by the user and the publics by the others for the specified phone number, using the following REST API:

get_allbynum

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

create

(
  • req
  • res
  • next
)

Create a new caller note by the following REST API:

create

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

delete

(
  • req
  • res
  • next
)

Delete a caller note by the following REST API:

delete

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

getFilteredCallerNotes

(
  • username
  • callerIdentity
)
Array private

Returns the caller notes filtered by user authorizations. Returned caller notes are those all of the user and the publics of the others. Phonebook contacts returned is the one created by the user in the cti phonebook, or one from the centralized phonebook or a public contact created by other users in the cti address book.

Parameters:

  • username String

    The username

  • callerIdentity Object

    The identity of the caller to br filtered

Returns:

Array:

The filtered caller notes.

modify

(
  • req
  • res
  • next
)

Modify a caller note of the user by the following REST API:

modify

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

setCompAuthorization

(
  • comp
)

Sets the authorization architect component.

Parameters:

  • comp Object

    The authorization architect component.

setCompCallerNote

(
  • cn
)

Set caller note architect component used by caller note functions.

Parameters:

  • cn Object

    The caller note 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.

Properties

compAuthorization

Object private

The architect component to be used for authorization.

compCallerNote

Object private

The caller note architect component used for caller note functions.

compUtil

Object private

The utility architect component.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • get_allbynum/:num String

    To gets all the created caller notes for the specified phone number

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/callernote]

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:

  • create String

    To create a new caller note

  • modify String

    To modify a caller note of the user

  • delete String

    To delete a caller note of the user