Click to call

Click to call is commonly implemented in CRM systems so that it is possible to just click on a contacts phone number to call out.

Authentication

Needed: A Puzzel customer number and user

Curl

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "customerKey": "12345", \ 
   "userName": "username", \ 
   "password": "password", \ 
   "clientName": "myCRM", \ 
   "clientVersion": "1.0" \ 
 }' 'https://auth.puzzel.com/api/Authenticate/LogIn'

Request URL

https://auth.puzzel.com/api/Authenticate/LogIn

Sample Auth response:

{
  "accessToken": "eyJh...",
  "refreshToken": {
    "customerKey": "99206",
    "sessionId": "12345...",
    "expiryDate": "2024-08-12T21:26:50.51"
  },
  "languageCode": "EN",
  "twoFactorRequired": false,
  "twoFactor": null,
  "logoutFromExternalIdentityProvider": false
}

Get user ID of current user

https://api.puzzel.com/ContactCentre5/accesstokeninformation
{
  "result": {
    "customerKey": "string",
    "customerId": 0,
    "userGroupId": 0,
    "userId": 0,
    "languageId": 0,
    "languageCode": "string",
    "passwordValidDaysLeft": 0,
    "accessTokenExpiry": "2024-08-12T07:51:50.162Z"
  },
  "code": 0,
  "id": "string",
  "message": "string"
}

Check state of current user

https://api.puzzel.com/ContactCentre5/12345/users/1231234

Sample response

{
  "result": {
    "userGroupName": "string",
    "profileName": "string",
    "chatState": "Undefined",
    "currentProfileId": 0,
    "contactCentreStatus": "LoggedOn",
    "sessionTime": "2024-08-12T07:54:35.289Z",
    "joined": true,
    "userStatus": "Available",
    "pauseTypeId": 0,
    "languageId": 0,
    "profiles": [
      {
        "id": 0,
        "number": 0,
        "lastPhoneNumber": "string",
        "phoneNumber": "string",
        "phoneType": "None",
        "name": "string",
        "groupProfile": true,
        "qualities": [
          {
            "id": 0,
            "number": 0,
            "description": "string",
            "serviceId": 0,
            "elements": [
              {
                "id": 0,
                "name": "string",
                "userLevel": 0
              }
            ]
          }
        ]
      }
    ],
    "chatCapacityMaxParallel": 0,
    "chatPhoneThreshold": 0,
    "chatConnected": 0,
    "chatConnecting": true,
    "eMail": "string",
    "mobilePhone": "string",
    "id": 0,
    "groupId": 0,
    "number": "string",
    "firstName": "string",
    "lastName": "string",
    "name": "string",
    "userName": "string"
  },
  "code": 0,
  "id": "string",
  "message": "string"
}       

As we can see the user is "LoggedOn" and "Available". Now we can order the callout itself.

Request Url

https://api.puzzel.com/ContactCentre5/12345/users/1231234/callout

Sample request

{
  "destination": "string",
  "alternateSource": "string",
  "userPhoneType": "None",
  "accessPoint": "string",
  "countryCode": "string",
  "queueKey": "string",
  "maxAttempts": 0,
  "secondsBetweenAttempts": 0,
  "listName": "string",
  "listValue": "string",
  "serviceSystemVariables": {
    "name": "string",
    "resolve": true,
    "type": "string",
    "value": "string"
  },
  "ciqType": "Undefined",
  "maxOneRequestForPreferredAgent": true,
  "preferredAgentWaitTimeSeconds": 0,
  "reservedAgentWaitTimeSeconds": 0,
  "vipScore": 0,
  "agentId": 0,
  "scheduledDateTime": "2024-08-12T07:58:21.874Z",
  "reservedUserId": 0,
  "disableReserved": true,
  "requestCategory": "string",
  "requestDescription": "string"
}

Refer to https://developer.puzzel.com/#/Request/CallOutAdd for more details on the payload.

 

 

Published

Last updated

8
-7