TABLE OF CONTENTS [Document Version - 1.8]




Usage

This API is designed as an Agent Remote Control. The API commands will control an already existing agent that is currently logged into the system.




Authentication


An authentication token is required to access this API. A token can be requested from the token service using the Token API.



Tokens API


All API methods require a security token to use the system. This token is stored in the HTTP cookie to allow multiple API calls from one authentication request.

A token is requested by authenticating with a user and password combination. The Token service API will return a token on success.


Token URL

https://[CUSTOMER].maxcontact.com/webservices/services/apitoken/login/{login}


Password

The password needs to be sent in the authorization header of the request; the password needs to be converted to Base64 with ASCII encoding to get the bytes[] from the password string.


Steps

  1. Make a request to the token Uri
  2. Store token key for any subsequent requests
  3. Make request to the Callbacks API

Recommendations

  • It is recommended that you keep track of the Token Key and its expiry as making a request every time can slow down the import process.
  • Login should be plain text.

When a successful API call is made to the API Token service, it will return a json/xml object A token key must be passed to each API endpoint along with the request.




Common API Parameters


The following is a list of common parameters that are used by a significant number of the API methods, along with details of what each parameter represents.

  • Call Id – The unique integer id of particular call, these Ids are maintained in- memory within the system, with values starting at 1,000 each time the system starts up.
  • Campaign Id – The unique identifier of a particular campaign as recorded in the correspondingly named table in the system’s database.
  • CLI (Caller ID) – for inbound calls this is the number that the customer is dialling from (if supplied).
  • Lead Id – Unique id of a particular campaign as recorded in the correspondingly named table in the database.
  • Lead Phone Id – Unique id for each phone linked to a particular lead, these values can be found in the database.
  • List Id – When leads are imported into the system they are grouped together into lists this is the unique id of a particular list as recorded in the database.
  • Reference Id – When importing leads into the system it is possible to supply an external reference number (e.g. a customer Id from an external CRM system etc). Reference Id parameters allow the caller to supply one of these external reference numbers in place of other parameters (e.g. lead Id or Phone Number etc.).
  • Result Code – When an agent completes a call with a customer they are required to select a result code that outlines the outcome of the call. A list of the result codes included by default with the system is available in the appendix, but it is worth noting that it is possible to configure this list of the result codes to meet the needs of your business.
  • User Id – Unique id of a particular user (often representing an agent) as recorded in the corresponding table in the database.




Responses

The API by default will return an XML response, but Accept and Content-Type headers with values of application/json can be supplied in your requests if desired and this will result in the API returning JSON formatted responses.




CallActionResponse


All methods will return a CallActionResponse object. The “data” property will be a different type dependent on the method used.


{
Success: Bool,
Data: This type is dependent on the method used, entities are described below
ResponseCode: int,
ResponseDetail: string
}


Notes

See the appendix for a list of the various response codes that the API returns.




Entities


Call

Returned by /dial, and an array of these is returned by /getcalls, this represents an active call.


{
CallId: int,
CallStartTime: dateTime,
CallState: int,
CallStatus: int,
CustomerName: string,
CustomerName2: string,
PhoneNumber: string,
RecordingState: int
CauseValue: int
}

Notes

  • Consult the appendix for a list of the various call states, call statuses, recording states and cause values that may be returned by the API.


Agent Name ID Pair

An array of these is returned by /users


{
FullName: string,
ID: int
}


Lead Phone

This object is returned by /leadphones


{
LeadId: int64,
PhoneNumber: string,
RecordType: string,
RecordTypeId: int
}


Notes

  • RecordTypeId and RecordType are used to identify what type of phone number or contact information the lead phone relates to (e.g. work, home, mobile etc.). Consult the appendix for a full list of phone/record types.


Campaign


Returned by /campaigns


{
CampaignID: int
CampaignName: string
Type: string
Active: boolean
AlwaysRun: boolean
AutoRecord: boolean
BlackoutDates: string array
MaxLines: int
CallerID: string
...


ACD (Skill) Queue

An array of this type is returned by /acdqueues


{
AbandonThreshold: int
AcceptableQueueTime: int
AcdIcon: string
AcdName: string
Active: boolean
DefaultTimeout: int
DefaultTimeoutIvr: int
ID: int
…
}


Result Code

An array of this type is returned by /resultcodes. A list of the default result codes is available in the appendix.


{
Code: string
Description: string
IsAgentViewable: boolean
IsCallAgain: boolean
IsCallback: boolean
IsSuccess: boolean
…
}




Methods


It is worth noting that a number of the following API methods send instructions to the live CCaaS system (e.g. GoReady, Dial etc.). A successful response from these API methods simply indicates that the instruction has been relayed to the system but, this does not indicate that the requested action was necessarily successful. For instance, if an instruction is sent for a certain user to GoReady when that user is not logged into the system or they are already talking to a customer then the instruction from the API will be ignored by the system.


Log In

API call to log the agent into the system


POST
/webservices/services/telephony/login
Body:
{
UserId: int
CampaignId: int
Extension: string
}
Returns:
CallActionResponse containing integer result code


Log Out

API call to log the agent out of the system


POST
/webservices/services/telephony/logout
Body:
{
UserId: int
CampaignId: int
}
Returns:
CallActionResponse containing integer result code


Get Calls

Returns the current active calls for the specified user.


GET
/webservices/services/telephony/getcalls/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing an array of Calls


Go Ready

Puts the specified user into the ready status for the campaign they are logged into


GET
/webservices/services/telephony/goready/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing integer result code


Go Not Ready

Puts the specified user into the not ready status for the campaign they are logged into.


PATCH
/webservices/services/telephony/gonotready/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing integer result code


Request Break

Requests to put the specified user into break status with the type of break specified by the Break Id.


PATCH
/webservices/services/telephony/gotobreak/user/{userId}
Params:
userId: int
Body:
{
BreakId: int
}
Returns:
CallActionResponse containing integer result code


Notes

  • The appendix contains a list of the default break types and the associated Id values however, it is possible to configure the list of break types in order to meet the needs of your business.


Dial

Initiates a manual dial for the specified user to the given phone number. A lead Id and campaign Id can optionally be specified however, by default, the number will be matched to the newest lead. If there is no match, a new lead will be created.


GET
/webservices/services/telephony/dial/user/{userId}/phone/{PhoneNum}?leadid
={leadId}&campaignId={campaignId}
Params:
userId: int
phoneNum: string
leadId: long
campaignId: int
Returns:
CallActionResponse containing Call data


Dial Ext

Initiates a manual dial for the specified user to the given phone number. The user Id and phone number are mandatory parameters but all of the other parameters are optional.

When performing a manual dial we will attempt to match to a lead by using a phone number, reference Id and list Id if provided. This can be used when the same phone number has multiple leads. If a campaign Id is supplied then the call will be linked to the supplied campaign rather than the campaign that the agent is currently on.



POST
/webservices/services/telephony/dialext
Body:
{
UserId: int
PhoneNum: string
CampaignId: int
CLI: string
LeadId: long
ListId: int
ReferenceId: string
UniqueRef: string
AdvancedLeadLookUp: Boolean
}
Returns:
CallActionResponse containing Call data


Dial Preview

When the user is assigned a Preview Dial this endpoint can be used to trigger the dialling of the preview call. The call Id parameter value should be the integer Id of the call that the agent is currently previewing.


PATCH
/webservices/services/telephony/placepreviewdial/user/{userId}/call/{callId}
Params:
userId: int
callId: int
Returns:
CallActionResponse containing integer result code


Shotgun Dial

Initiates dials for the specified user to the given phone numbers simultaneously. A Lead Id,ReferenceId, List Id and Caller Id (CLI) or Unique Reference can optionally be specified.


POST
/webservices/services/telephony/shotgun-dial
Body:
{
UserId: int
PhoneNumbers: string[] – max 5 numbers
LeadId: long
ReferenceId: string
ListId: int
CampaignId: int
CLI: string
UniqueRef: string
}
Returns:
CallActionResponse containing an array of CallIds


Lead Lookup Logic

  • If Lead Id is provided, lead will be searched by Lead Id
    • If List Id is also provided, lead will be searched by Lead Id and List Id
  • If lead was not found by Lead Id and Reference Id was provided, lead will be searched by Reference Id
    • If List Id is also provided, lead will be searched by Reference Id and List Id
  • If lead was not found, it will be searched for by phone number ordered by importedDate
  • If lead was not found, it will be created. For that step, a List Id is required


Hangup

Hangs up the specified call and places the agent in the wrapping status


GET
/webservices/services/telephony/hangup/user/{userId}/call/{callId}
Params:
userId: int
callId: int
Returns:
CallActionResponse containing integer result code


Dispose

This method will disposition the specified call with a chosen result code. The call will also be hung up if it has not already.


GET
/webservices/services/telephony/dispose/user/{userId}/call/{callId}?resultCod
e={resultCode}
Params:
userId: int
callId: int
resultCode: string
Returns:
CallActionResponse containing integer result code


Notes

  • A list of the default result codes is available in the appendix.


Hold

Places the specified call on hold.


GET
/webservices/services/telephony/hold/user/{userId}/call/{callId}
Params:
userId: int
callId: int
Returns:
CallActionResponse containing integer result code


Retrieve

Retrieves the specified call on hold.


GET
/webservices/services/telephony/retrieve/user/{userId}/call/{callId}
Params:
userId: int
callId: int
Returns:
CallActionResponse containing integer result code


Start Recording

This method will start or continue the recording for the specified call.


GET
/webservices/services/telephony/startrecord/user/{userId}/call/{callId}
Params:
userId: int
callId: int
Returns:
CallActionResponse containing an array of Calls


Stop Recording

This method will stop the recording of the specified call. This is useful for preventing any sensitive information such as bank details being recorded.


GET
/webservices/services/telephony/stoprecord/user/{userId}/call/{callId}
Params:
userId: int
callId: int
Returns:
CallActionResponse containing an array of Calls


Campaigns

Gets an object containing all the campaigns in the system


GET
/webservices/services/telephony/campaigns/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing an array of Campaigns


Users

Gets an object containing the names and ids of all users.


GET
/webservices/services/telephony/users/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing an array of agent names and ids


Notes

  • The userId parameter is not mandatory and it is possible to call this method and passing a value of zero for this parameter.


Result Codes

Gets an array of all the available result codes.


GET
/webservices/services/telephony/resultcodes/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing an array of result codes

Notes

  • The userId parameter is not mandatory and it is possible to call this method and passing a value of zero for this parameter.
  • A list of the default result codes is available in the appendix.


ACD Queues

Returns a list of ACD queues in the system. These are also known as skill queues.


GET
/webservices/services/telephony/acdqueues/user/{userId}
Params:
userId: int
Returns:
CallActionResponse containing an array of ACD queues


Notes

  • The userId parameter is not mandatory and it is possible to call this method and passing a value of zero for this parameter.


Lead Phones

Returns the lead phones associated to the supplied lead Id.


GET
/webservices/services/telephony/leadphones/user/{userId}/lead/{leadId}
Params:
userId: int
leadId: long
Returns:
CallActionResponse containing an array lead phones


Notes

  • The userId parameter is not mandatory and it is possible to call this method and passing a value of zero for this parameter.


Change Lead Phone

This method will change the lead of a call that is in progress. A lead phone Id is supplied, and the call will be associated to the lead phone’s corresponding lead.


GET
/webservices/services/telephony/changelead/user/{userId}/call/{callId}/leadp
hone/{leadPhoneId}
Params:
userId: int
callId: int
leadPhoneId: int64
Returns:
CallActionResponse containing integer result code


Notes

  • The userId parameter is not mandatory and it is possible to call this method and passing a value of zero for this parameter.


Create New Lead

This method will create a new lead with the phone number specified, then assign the new lead to the call specified.


GET
/webservices/services/telephony/createnewlead/user/{userId}/call/{callId}/ph
one/{phoneNum}
Params:
userId: int
callId: int
phoneNum: string
Returns:
CallActionResponse containing integer result code


Notes

  • The userId parameter is not mandatory and it is possible to call this method and passing a value of zero for this parameter.


Connect Calls

This method allows two calls that are currently in progress to be bridged together. This is useful to perform a warm transfer to a 3rd party or external DDI. You can also specify a success count and any notes relating to the call. The result codes and call id’s are required, however the notes and number of successes are optional parameters. A list of the default result codes is available in the appendix.


GET
/webservices/services/telephony/connectcalls/user/{userId}?call1={call1Id}&cal
l2={call2Id}&resultcode1={resultCode1}&resultcode2={resultCode2}&notes1={no
tes1}&notes2={notes2}&numsales1={numSales1}&numsales2={numSales2}
Params Required:
userId: int
call1Id: int
call2Id: int
resultCode1: string
resultCode2: string
Params Optional:
notes1: string
notes2: string
numSales1: int
numSales2: int


Transfer To User

Begin the transfer of an existing call from one agent to another.


POST
/webservices/services/telephony/transfertouser
Body:
{
SendingUserId: int
ReceivingUserId: int
CallId: int
IsAttended: boolean
ResultCode: string
}
Returns:
CallActionResponse containing integer result code


Notes

  • A list of the default result codes is available in the appendix.


Complete Transfer

Complete the transfer of an existing call from one agent to another.


POST
/webservices/services/telephony/transfertouser
Body:
{
SendingUserId: int
ReceivingUserId: int
CallId: int
IsAttended: boolean
ResultCode: string
}
Returns:
CallActionResponse containing integer result code


Notes

  • A list of the default result codes is available in the appendix.




Appendix


Appendix 1: Response Codes

The following table contains a list of the response codes that are returned by the API methods:


ID

Description

-3Error
-2Command Timeout
-1Connection Failed
0Success
1General Failure
2Invalid Parameters
3Call No Longer Exists



Appendix 2: Record/Phone Types

The following table contains a list of the available phone types as recorded against each record in the lead phone table. This value is used to identify what type of contact details the lead phone record relates to.


ID

Description

0Home
1Work
2Mobile
3Home Email
4Work Email
5Messenger


Appendix 3: Recording States

The following table contains a list of the recording states that the system supports:


ID

Description

0NotRecording,
1PendingStart,
2CancelPendingStart,
3Recording,
4PendingStop

Appendix 4: Break Codes

The following table contains details of the default break types that come with the system as standard. It is worth noting that this list can be amended within the Manager Portal application.


ID

Name

Description

1
BreakStandard 10 minute break.
2Lunch30 minute break for meals.
3MeetingBreak for a meeting.
4BioBreak to take care of biological needs.
5OtherA break that does not fit other categories.



Appendix 5: Result Codes

Result codes are used to record the outcome of an interaction between an agent and an end customer (e.g. ‘Sale’, ‘Callback’, ‘No Answer’ etc.). The following table contains a list of the result codes that are set up in the system when it is shipped. It is worth noting that it is possible to edit this list within the Manager Portal application in order to meet the

requirements of your business.


Result Code

Description

ABANDONAbandoned Queue
ANSMACHAnswer Machine
BADBad Phone Number
BLACKLISTInbound call was blocked
BRIDGEBridge Call (Internal)
BRIDGE_WARMBridge Call (Warm Transfer) (Internal)
BUSYBusy
CALLBACKPrivate Callback
CANCELCancel - Third Party
DEADAIRDead Air
DNCDo Not Call
HKT
Hot Key Transfer
HKT_BRIDGEHot Key Transfer (Internal)
HKT_CANCELHKT Cancel - Third Party
HKT_WARMHot Key Transfer (Warm Transfer) (Internal)
IABANDONEDInteraction abandoned
IBRANCHEDInteraction branched
ICUSTOMERTIMEOUTInteraction customer timeout
IDUPLICATETERMINATEDuplicate Terminate Interaction
INBOUNDInbound
IRATEIrate
IRECEIVEDInteraction received
ISENTInteraction sent
ITERMINATEDInteraction terminated
ITIMEOUTInteraction timed out
ITXMOVEDInteraction Session Was Moved
ITXUSERDISCONNECTA User Disconnected before handling the interaction
KICKBARGEKicked and Retransferred
LIVEANSLive Answer (Person)
MAXTOMaximum Timeout Reached
NINot Interested
NOANSWERNo Answer
NOCARRIERNo Carrier
NOCPANo CPA (System)
OB-ABANOutbound Abandon
OPERATOROperator/Could Not Reach
REDIALRedial
SKIPPEDSkipped Record
SYSANSMACHAnswering Machine (System)
SYSBUSYBusy (System)
SYSDROPDropped Call (System)
SYSFAXFax/Modem (System)
SYSNOANSNo Answer (System)
SYSOIOperator Intercept (System)
UNCONTACTUncontacted
USERAgent Nail-Up
WRAP_TOTimed-Out Wrapping
WRONGWrong Number
XFERTransferred
YANKYanked



Appendix 6: Call Statuses

During their lifetime calls can typically through a number of statuses, the following table provides a list of the these call statuses.


ID

Name

0Uncontacted
1NoCarrier
2Person
3NoAnswer
4Busy
5Operator
6Dropped
7AnswerMachine
8Transferring
9FaxModem
10DisconnectNoCpa
11DisconnectTimeout
12BadRecord
13Skipped
14DoNotCall
15Yanked
16Callback
17Ringing
18WrongNumber
19NotInterested
20Inbound
21Abandoned
22User
23Irate
24OutboundAbanoned
25InteractionSent
26InteractionTerminated
27InteractionAbandoned
28InteractionTimeout
29InteractionReceived
30InteractionBranched
31InteractionTerminateDuplicate
32InteractionMoved
33ItxUserDisconnect
34InteractionCustomerTimeout



Appendix 7: Call States

During their lifetime calls can typically through a number of state, the following table provides a list of these call states.


ID

Name

0Unknown
1InBuffer
2PreviewQueue
3Previewing
4WaitingForLine
5Placing
6Ringing
7CpaAnalysis
8InDropQueue
9Transferring
10InIvr
11InExtension
12InQueue
13InConference
14Bridged
15OnHold
16PreviewOnHold
17WithAgent
18Wrapping
19Terminated
20History
21InVirtualQueue


Appendix 8: Cause Values

The following table contains a list of the various cause values supported by the system


ID

Name

-1Unknown
0Normal
1Busy
2NoAnswer
3Unobtainable
4NumberChanged
5OutOfOrder
6IncomingBarred
7Rejected
8Failed
9ChannelBusy
10NoChannels
11Congestion
12TcpConnectFailed
13SslError
14SslPeerCertNotTrusted
15SslPeerCertInvalid