Menu Close

peoplefone CONNECTOR API (REST API)

Terminology

Client is used to identify peoplefone customer or partner that does the integration with the peoplefone CONNECTOR

Phone lookup service is used to identify the client’s service that exposes the current interface for the peoplefone CONNECTOR to acquire data.

When can the peoplefone CONNECTOR API be used?

If the client’s CRM is not supported by peoplefone, we ask the client to provide a phone lookup service.

Overview

The API covers multiple use-cases:

  1. Data lookup for notification purpose
    When a phone call is performed (incoming or outgoing) the peoplefone HOSTED will notify the peoplefone CONNECTOR which will lookup for data using the REST API described in this article.
  2. Business workflow interaction
    When the peoplefone CONNECTOR user click on one of the business workflow, the peoplefone CONNECTOR will transfer the request to the phone lookup service for treatment. Business workflow could be anything like creating a ticket or a call flow in the CRM.

Part 1 – data lookup

Request

URL

<root-url>/Lookup (example: https://my-company.com/services/Lookup)
The <root-url> is defined by the Client in the peoplefone CUSTOMER-PORTAL to allow peoplefone CONNECTOR to reach the phone lookup service. This URL does NOT contains any private data required for the lookup, those data are provided via HTTP Headers. The name of the end-point for the lookup capabilities must be called Lookup.

Query parameters

peoplefone CONNECTOR will not provide query parameters

HTTP Headers

For authentication, peoplefone CONNECTOR shall provide the token via the following HTTP Header:
Key: X-Execution-Token
Value: jlvlkdshvövdjhwgjwogjhwg
The header(s) key and value are configurable though the peoplefone CUSTOMER-PORTAL page regarding peoplefone CONNECTOR

Body

The body of the request is contains the phone number for which the lookup is required:

  {
    "inputs": {
        "phoneNumber":"41215522000"
    }
}

Response

Sample of body

[
   {
      "name": "Alexa Holiday",
      "company": "White Cross Co",
      "contactUri": "https://...",
      "companyUri": "https://...",
      "id": "Crm Identification Number",
      "crmName": "Sugar CRM",
      "crmLogo": "https://...",
      "customData": {
         "title1": "Data1", 
         "title2": "Data2"
      }
   },
   {
      ...
   }
]

Layer 1: the list

The expected result is an array of object. It is recommended to return only a very small number of results. The value of maximum 5 results is the most suitable for a good balance between performance and precision. However increasing this value could end with a lot of delay and performance issue at all stage of the system.

If the query does return no value, it is expected by peoplefone CONNECTOR to receive an empty array with a 200 status code. It is NOT expected to receive a 404 status code in that case, the 404 status code will means the Phone lookup service is not accessible.

Layer 2: the object

The objects composing the list represent one entry found for the given phone number in (one of) the integrated CRM. This object contains few fields required for peoplefone CONNECTOR to display properly the entry as well as a list of key-value pairs for any specific data our customer want to add.

Field NameDescription
nameThe full name of the found contact. This is used in the user interface to display the name of the contact.
companyThe name of the company on which the contact is linked to. This is used in the user interface to display the name of the company.
contactUriThe URI to access the contact page on the CRM. This is used in the user interface to add a link to the contact.
companyUriThe URI to access the company page on the CRM. This is used in the user interface to add a linke to the company.
idThe Id of the contact in the CRM. This value is not displayed.
crmNameThe name of the CRM. This value, if provided, is used to add a tooltip on the CRM logo.
crmLogoThe URL of the logo of the CRM. This value, if provided, is used to add a logo on the contact card for this entry. This is optional if the customer integrate only with one CRM. However it become useful if the customer has multiple CRM integration.
customFieldsThe object CustomFields is a set of key-value pairs the customer can use to carry any data he needs for the integration. Those data, if present, will be displayed in the peoplefone CONNECTOR user interface. It could be for instance the e-mail address of the contact or the language spoken by the contact or anything else.

Part 2 – Business workflow

Request

URL

<root-url>/<workflow-name>
The <root-url> is the same value than for the lookup (see part 1). The <workflow-name> is the name given back by the lookup in the CrmActions array.

The <workflow-name> is relatively free to use, however the value is used to two other places outside the peoplefone CONNECTOR API definition:

  1. To display the business workflow in the peoplefone CONNECTOR web page. For some predefined values it will be translated, otherwise it will be displayed AS-IS.
  2. For automatic business workflow configuration. At the moment only business workflow called “CallFlow” can be configured in the peoplefone CUSTOMER-PORTAL to be set automatic, all other cases will be manual only.

Query parameters

peoplefone CONNECTOR will provide no query parameters

HTTP Headers

For authentication, peoplefone CONNECTOR will provide the same headers than for the lookup, as configured in the peoplefone CUSTOMER-PORTAL page.

Body

The body of the request contains all required information for the business workflow to be executed. This payload could be extended in the future. It is an “inputs” field containing a simple JSON object with the following fields:

Field NameDescription
contactCrmIdThe ID of the contact in the CRM (as retrieved from the lookup)
userCrmIdThe ID of the user linked to the current SIP user (as configured in the CUSTOMER-PORTAL page)
originatorNumberThe phone number that initiated the call.
originatorNameWhen available the name of the person who initiated the call.
destinationNumberThe phone number composed by the caller.
destinationNameWhen available the name of the person which answer the call.
directionThe direction of the call, either ‘incoming’ or ‘outgoing’.
startedTimeThe date/time when the call was started (ringing).
answeredTimeThe date/time when the call was answered, this value is empty if the call was not answered.
endedTimeThe date/time when the call was ended.
declinedTimeThe date/time when the call was aborted, this value is empty if the call was answered.
{
    "inputs": {
        "contactCrmId":"...",
        "userCrmId":"...",
        ...
    }
}

Response

The response expected by peoplefone CONNECTOR is a simple JSON object with two fields, the whole response, as well as each fields, are optional. The purpose of the url would be to optionally open the CRM page directly after the workflow is ended.

Field NameDescription
idThe ID of the object created by the business workflow
urlThe URL to access the object created by the business workflow
{
    "id":"...",
    "url":"..."
}