API Docs for: 2.6
Show:

plugin_rest_custcard Class

Module: plugins_rest
Parent Module: com_customer_card_rest

REST plugin that provides customer card functions through the following REST API:

GET requests

  1. custcard/getbynum/:number/:format

custcard/getbynum/:number/:format

The client receive all customer cards by number for which he has the permission. The data key contains the customer card in the specified format. The parameters are:

  • number: the number to use to search the customer cards data
  • format: ("json" | "html") the format of the received data

Example JSON response:

{
    "20": {
         "name": "calls",
         "data": "\n\t<div id='cdr' class='...",
         "number": "0721405516"
    },
    "00": {
         "name": "identity",
         "data": "\n\n\t<div class=\"contactsVCard\">\n\t<div class='contactsVCardHeader'>...",
         "number": "0721405516"
    }
}

Methods

getbynum

(
  • req
  • res
  • next
)

Searches the customer cards by number with the following REST API:

getbynum/:number/:format

Parameters:

  • req Object

    The client request.

  • res Object

    The client response.

  • next Function

    Function to run the next handler in the chain.

setCompCustomerCard

(
  • cc
)

Set customer card architect component used by customer card functions.

Parameters:

  • cc Object

    The customer card 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

compCustomerCard

Object private

The customer card architect component used for customer card functions.

compUtil

Object private

The utility architect component.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • getbynum/:number/:format String

    To get the customer card by specified number and format

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/custcard]

logger

Object private

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

Default: console