zdk.objc
Instance Methods | List of all members
<ZDKBanafoManager> Protocol Reference

Banafo Service Manager. More...

#import <ZDKBanafoManager.h>

Inheritance diagram for <ZDKBanafoManager>:
<ZDKZHandle>

Instance Methods

(id< ZDKResult >) - start:basePath:clientID:
 Set up and Start the Banafo Service. More...
 
(id< ZDKResult >) - stop
 Stops the Banafo Service. More...
 
(id< ZDKResult >) - startAuthorization
 Starts Banafo Service authorization process. More...
 
(id< ZDKResult >) - cancelAuthorization
 Cancels Banafo Service authorization process. More...
 
(id< ZDKResult >) - setTokens:refreshToken:
 Set Banafo Service authorization tokens. More...
 
(id< ZDKResult >) - cancelRequest:
 Cancels a Banafo Service request. More...
 
(id< ZDKResult >) - setCallContact:contact:
 Updates contact information to a call. More...
 
(long int) - listContacts:
 List contacts based on serch criterias. More...
 
(long int) - listIntegrations
 List CRM integrations. More...
 
(long int) - uploadRecording:filePathUtf8:
 Upload audio recording file to the Banafo server. More...
 
(id< ZDKBanafoContactSearchCriteria >) - createContactSearchCriteria:provider:search:types:phone:nationalNumber:reverseLookup:region:start:limit:pageId:
 Creates a BanafoContactSearchCriteria object. More...
 
(id< ZDKBanafoContact >) - createContact:remoteId:remoteProvider:displayName:firstName:middleName:lastName:type:url:company:emails:phones:
 Creates a BanafoContact object. More...
 
(id< ZDKBanafoCall >) - createCall:summary:title:source:origin:startedAt:acceptedAt:finishedAt:type:localPhone:remotePhone:contact:
 Creates a BanafoCall object. More...
 
(id< ZDKRecordingStream >) - createRecordingStream:type:fileName:languageCode:
 Creates a RecordingStream object. More...
 
(id< ZDKBanafoRecording >) - createRecording:startedAt:finishedAt:banafoCallId:streams:
 Creates a BanafoRecording object. More...
 
(long int) - forceCreateCallatServer:
 Force creates Banafo Call at the Banafo Service. More...
 
(long int) - forceCreateRecordingatServer:
 Force creates Banafo Recording at the Banafo Service. More...
 
(long int) - getProfile
 Get Banafo profile. More...
 
(long int) - listTranscriptLanguages
 List Banafo transcript languages. More...
 
(void) - addBanafoListener:
 Adds a new Banafo Service event listener. More...
 
(void) - dropBanafoListener:
 Removes a specific already added Banafo Service event listener. More...
 
(NSString *) - handlesDescription
 
- Instance Methods inherited from <ZDKZHandle>
(long int) - handle
 
(void) - initialize
 
(void) - releaseReference
 
(NSString *) - handlesDescription
 

Detailed Description

Banafo Service Manager.

Method Documentation

◆ addBanafoListener:

- (void) addBanafoListener: (id< ZDKBanafoEventsHandler >)  value

Adds a new Banafo Service event listener.

All added listeners will be notified for each event.

Parameters
[in]valueThe Banafo Service event listener to be added
See also
ZDKBanafoEventsHandler, dropBanafoListener()

◆ cancelAuthorization

- (id< ZDKResult >) cancelAuthorization

Cancels Banafo Service authorization process.

Cancels the Banafo Service authorization process.

To be able to cancel the authorization process the Banafo Service must be authorizing i.e. to be in 'BanafoServiceStateType::Ready' or 'BanafoServiceStateType::VerifyingAuthorizing' state.

Returns
Result of the invocation
See also
ZDKResult, BanafoServiceStateType, - cancelAuthorization

◆ cancelRequest:

- (id< ZDKResult >) cancelRequest: (long int)  requestId

Cancels a Banafo Service request.

Cancels an already running Banafo service request and discards any results that might be received. The request is destroyed.

Parameters
[in]requestIdThe Banafo Service request handler that is going to be canceled. If invalid handler is provided the function will fail with 'ResultCode::NotFound'.
Returns
Result of the invocation
See also
ZDKResult

◆ createCall:summary:title:source:origin:startedAt:acceptedAt:finishedAt:type:localPhone:remotePhone:contact:

- (id< ZDKBanafoCall >) createCall: (NSString *_Nullable)  banafoId
summary: (NSString *_Nullable)  summary
title: (NSString *_Nullable)  title
source: (NSString *)  source
origin: (ZDKOriginType)  origin
startedAt: (NSString *)  startedAt
acceptedAt: (NSString *_Nullable)  acceptedAt
finishedAt: (NSString *_Nullable)  finishedAt
type: (NSString *)  type
localPhone: (NSString *_Nullable)  localPhone
remotePhone: (NSString *_Nullable)  remotePhone
contact: (id< ZDKBanafoContact > _Nullable)  contact 

Creates a BanafoCall object.

Creates a BanafoCall object

Parameters
[in]banafoIdSee ZDKBanafoCall
[in]summarySee ZDKBanafoCall
[in]titleSee ZDKBanafoCall
[in]sourceSee ZDKBanafoCall
[in]originSee ZDKBanafoCall
[in]startedAtSee ZDKBanafoCall
[in]acceptedAtSee ZDKBanafoCall
[in]finishedAtSee ZDKBanafoCall
[in]typeSee ZDKBanafoCall
[in]localPhoneSee ZDKBanafoCall
[in]remotePhoneSee ZDKBanafoCall
[in]contactSee ZDKBanafoCall
Returns
The newly created ZDKBanafoCall object
See also
ZDKBanafoCall

◆ createContact:remoteId:remoteProvider:displayName:firstName:middleName:lastName:type:url:company:emails:phones:

- (id< ZDKBanafoContact >) createContact: (NSString *_Nullable)  banafoId
remoteId: (NSString *_Nullable)  remoteId
remoteProvider: (NSString *_Nullable)  remoteProvider
displayName: (NSString *_Nullable)  displayName
firstName: (NSString *_Nullable)  firstName
middleName: (NSString *_Nullable)  middleName
lastName: (NSString *_Nullable)  lastName
type: (ZDKContactType)  type
url: (NSString *_Nullable)  url
company: (NSString *_Nullable)  company
emails: (NSArray *_Nullable)  emails
phones: (NSArray *_Nullable)  phones 

Creates a BanafoContact object.

Creates a BanafoContact object that can be used with setCallContact()

Parameters
[in]banafoIdSee ZDKBanafoContact
[in]remoteIdSee ZDKBanafoContact
[in]remoteProviderSee ZDKBanafoContact
[in]displayNameSee ZDKBanafoContact
[in]firstNameSee ZDKBanafoContact
[in]middleNameSee ZDKBanafoContact
[in]lastNameSee ZDKBanafoContact
[in]typeSee ZDKBanafoContact
[in]urlSee ZDKBanafoContact
[in]companySee ZDKBanafoContact
[in]emailsSee ZDKBanafoContact
[in]phonesSee ZDKBanafoContact
Returns
The newly created ZDKBanafoContactSearchCriteria object
See also
ZDKBanafoContact, setCallContact()

◆ createContactSearchCriteria:provider:search:types:phone:nationalNumber:reverseLookup:region:start:limit:pageId:

- (id< ZDKBanafoContactSearchCriteria >) createContactSearchCriteria: (NSString *_Nullable)  contactId
provider: (NSString *_Nullable)  provider
search: (NSString *_Nullable)  search
types: (NSArray *_Nullable)  types
phone: (NSString *_Nullable)  phone
nationalNumber: (NSString *_Nullable)  nationalNumber
reverseLookup: (BOOL)  reverseLookup
region: (NSString *_Nullable)  region
start: (int)  start
limit: (int)  limit
pageId: (NSString *_Nullable)  pageId 

Creates a BanafoContactSearchCriteria object.

Creates a BanafoContactSearchCriteria object to be used for listContacts()

Parameters
[in]contactIdSee ZDKBanafoContactSearchCriteria
[in]providerSee ZDKBanafoContactSearchCriteria
[in]searchSee ZDKBanafoContactSearchCriteria
[in]typesSee ZDKBanafoContactSearchCriteria
[in]phoneSee ZDKBanafoContactSearchCriteria
[in]nationalNumberSee ZDKBanafoContactSearchCriteria
[in]reverseLookupSee ZDKBanafoContactSearchCriteria
[in]regionSee ZDKBanafoContactSearchCriteria
[in]startSee ZDKBanafoContactSearchCriteria
[in]limitSee ZDKBanafoContactSearchCriteria
[in]pageIdSee ZDKBanafoContactSearchCriteria
Returns
The newly created ZDKBanafoContactSearchCriteria object
See also
ZDKBanafoContactSearchCriteria, listContacts()

◆ createRecording:startedAt:finishedAt:banafoCallId:streams:

- (id< ZDKBanafoRecording >) createRecording: (NSString *_Nullable)  banafoId
startedAt: (NSString *)  startedAt
finishedAt: (NSString *_Nullable)  finishedAt
banafoCallId: (NSString *)  banafoCallId
streams: (NSArray *)  streams 

Creates a BanafoRecording object.

Creates a BanafoRecording object

Parameters
[in]banafoIdSee ZDKBanafoRecording
[in]startedAtSee ZDKBanafoRecording
[in]finishedAtSee ZDKBanafoRecording
[in]banafoCallIdSee ZDKBanafoRecording
[in]streamsSee ZDKBanafoRecording
Returns
The newly created ZDKBanafoRecording object
See also
ZDKBanafoRecording

◆ createRecordingStream:type:fileName:languageCode:

- (id< ZDKRecordingStream >) createRecordingStream: (ZDKRecordingType)  origin
type: (NSString *)  type
fileName: (NSString *)  fileName
languageCode: (NSString *_Nullable)  languageCode 

Creates a RecordingStream object.

Creates a RecordingStream object

Parameters
[in]originSee ZDKRecordingStream
[in]typeSee ZDKRecordingStream
[in]fileNameSee ZDKRecordingStream
[in]languageCodeSee ZDKRecordingStream
Returns
The newly created ZDKRecordingStream object
See also
ZDKRecordingStream

◆ dropBanafoListener:

- (void) dropBanafoListener: (id< ZDKBanafoEventsHandler >)  value

Removes a specific already added Banafo Service event listener.

All added/left listeners will be notified for each event.

Parameters
[in]valueThe Banafo Service event listener to be removed
See also
ZDKBanafoEventsHandler, addBanafoListener()

◆ forceCreateCallatServer:

- (long int) forceCreateCallatServer: (id< ZDKBanafoCall >)  call

Force creates Banafo Call at the Banafo Service.

Manually creates call on the Banafo Server. In case 'ZDKBanafoCall::BanafoId()' is set, a request to update that already existing call, instead of creating a new one, will be made.

Upon completion the 'ZDKBanafoEventsHandler::OnEventState' callback will be invoked delivering the result of the request and the 'banafo call id' when creating new calls.

The ZDKBanafoCall::Origin(), ZDKBanafoCall::Type(), ZDKBanafoCall::Source() and ZDKBanafoCall::StartedAt() fields are MANDATORY! If any of them is missing, the function will return ZDKInvalidHandle!

!!! Do not use for calls made through the ZDK as it will duplicate the calls on Banafo !!!

Parameters
[in]callThe call to be created at the Banafo Service
Returns
The Banafo Service request ID corresponding to this create request
See also
ZDKBanafoCall, ZDKBanafoEventsHandler, cancelRequest()

◆ forceCreateRecordingatServer:

- (long int) forceCreateRecordingatServer: (id< ZDKBanafoRecording >)  recording

Force creates Banafo Recording at the Banafo Service.

Manually creates call recording on the Banafo Server. In case 'ZDKBanafoRecording::BanafoId()' is set, a request to update that already existing recording, instead of creating a new one, will be made.

Upon completion the 'ZDKBanafoEventsHandler::OnEventState' callback will be invoked delivering the result of the request and the 'banafo recording id' when creating new recording. That ID can later be used to upload the actual file to the Banafo Server via uploadRecording().

The ZDKBanafoRecording::BanafoCallId() field is MANDATORY! If missing, the function will return ZDKInvalidHandle!

!!! Do not use for recordings made through the ZDK as it will duplicate them on Banafo !!!

Parameters
[in]recordingThe recording to be created at the Banafo Service
Returns
The Banafo Service request ID corresponding to this create request
See also
ZDKBanafoRecording, ZDKBanafoEventsHandler, cancelRequest(), uploadRecording()

◆ getProfile

- (long int) getProfile

Get Banafo profile.

Gets Banafo user profile information.

Upon completion the 'ZDKBanafoEventsHandler::OnProfile' callback will be invoked delivering the result of the request.

Returns
The Banafo Service request ID corresponding to this list profile retrieval
See also
ZDKBanafoEventsHandler, cancelRequest()

◆ handlesDescription

- (NSString *) handlesDescription

Reimplemented from <ZDKZHandle>.

◆ listContacts:

- (long int) listContacts: (id< ZDKBanafoContactSearchCriteria >)  criteria

List contacts based on serch criterias.

Provides a list of contacts that can come from local or external resources. In order to get local contacts the 'provider' should be set to "banafo". If no provider specified - contacts from all active external providers will be returned. By default the response will contain the maximum number of contacts as per the provider's limits per request.

For basic filtering use the search parameter, for filtering by phone number only using the 'phone' field might generate better results for depending on the providers.

In case a Reverse Lookup is desired, the ZDKBanafoContactSearchCriteria's 'ReverseLookup()' must be set to 'true', 'Region()' and 'Phone()' MUST be set while all other parameters will be discarded! In case they are empty strings, this function will fail and return 'ZDKInvalidHandle'.

Upon success, the zdkBanafoEventsHandler::OnContactList() will be invoked delivering the contacts.

Parameters
[in]criteriaThe search criteria to be used for the contact listing. This is a required parameter and if empty/NULL is provided the function will and return 'ZDKInvalidHandle'.
Returns
The Banafo Service request ID corresponding to this list contacts search
See also
ZDKBanafoContactSearchCriteria, ZDKBanafoEventsHandler, cancelRequest()

◆ listIntegrations

- (long int) listIntegrations

List CRM integrations.

Provides a list of all active integrations for the authenticated user with a provider from the list.

Upon success, the 'ZDKBanafoEventsHandler::OnIntegrationsList will be invoked delivering the integrations.

Returns
The Banafo Service request ID corresponding to this list integrations search
See also
ZDKBanafoEventsHandler, cancelRequest()

◆ listTranscriptLanguages

- (long int) listTranscriptLanguages

List Banafo transcript languages.

Lists Banafo transcript languages.

Upon completion the 'ZDKBanafoEventsHandler::OnTranscriptLanguageList' callback will be invoked delivering the result of the request.

Returns
The Banafo Service request ID corresponding to this list transcript languages request
See also
ZDKBanafoEventsHandler, cancelRequest()

◆ setCallContact:contact:

- (id< ZDKResult >) setCallContact: (NSString *)  banafoCallId
contact: (id< ZDKBanafoContact >)  contact 

Updates contact information to a call.

Updates contact information to a Banafo call.

Parameters
[in]banafoCallIdThe Banafo call identifier. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'.
[in]contactThe new contact data. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'.
Returns
Result of the invocation
See also
ZDKResult, ZDKBanafoContact

◆ setTokens:refreshToken:

- (id< ZDKResult >) setTokens: (NSString *_Nullable)  accessToken
refreshToken: (NSString *)  refreshToken 

Set Banafo Service authorization tokens.

Sets the Banafo Service authorization tokens explicitly so there will be no need of authorization process to take place for this service before it is able to be used.

To be able to set tokens the Banafo Service must be in 'BanafoServiceStateType::Ready' state.

Parameters
[in]accessTokenThe access token for the service. It can be left empty and a new access token will be obtained from the refresh token.
[in]refreshTokenThe refresh token for the service. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'.
Returns
Result of the invocation
See also
ZDKResult, BanafoServiceStateType, - startAuthorization

◆ start:basePath:clientID:

- (id< ZDKResult >) start: (NSString *)  schemeAndAuthority
basePath: (NSString *)  basePath
clientID: (NSString *)  clientID 

Set up and Start the Banafo Service.

Setup and start the Banafo Service that can be used to query data, upload files, etc to the Banafo Web Service.

Upon starting the Banafo Service it will automatically start getting its well known configuration from the Banafo Web service i.e. change state to 'BanafoServiceStateType::Configuring'.

Parameters
[in]schemeAndAuthorityThe scheme and authority where the Banafo Service is located. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'.
[in]basePathThe base path used for the Banafo Service. It doesn't change between requests. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'.
[in]clientIDThe client ID used by the Banafo Web Service to identify the application. The application must be registered in the Banafo Web service beforehand so that a client ID can be obtained. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'.
Returns
Result of the invocation
See also
ZDKResult, BanafoServiceStateType, - stop

◆ startAuthorization

- (id< ZDKResult >) startAuthorization

Starts Banafo Service authorization process.

Starts a Banafo Service authorization sequence. The authorization is done using OAuth2.0 device flow. To be able to start authorization process the Banafo Service must be in 'BanafoServiceStateType::Ready' state.

Returns
Result of the invocation
See also
ZDKResult, BanafoServiceStateType, - cancelAuthorization

◆ stop

- (id< ZDKResult >) stop

Stops the Banafo Service.

Stops the already started Banafo Service along all requests associated with it.

Returns
Result of the invocation
See also
ZDKResult, start()

◆ uploadRecording:filePathUtf8:

- (long int) uploadRecording: (NSString *)  banaforRecordingId
filePathUtf8: (NSString *)  filePathUtf8 

Upload audio recording file to the Banafo server.

Adds a multipart/form-data recording file upload as described by W3C here: https: and RFC 7578.

The advertised file name is retrieved from the passed 'filePathUtf8' by stripping the path itself.

The advertised mime type is retrieved from the passed 'filePathUtf8' by extracting the file extension. In case there is no file extension a 'audio/wav' mime is assumed.

Parameters
[in]banaforRecordingIdThe Banafo file identifier received by the 'ZDKBanafoEventsHandler::OnEventState' callback once the call recording is started. This is a required parameter and if empty string is provided the function will fail and return 'ZDKInvalidHandle'.
[in]filePathUtf8Full pathname of the file to upload. The file must reside on the local system and must be accessible by the library. This is a required parameter and if empty string is provided the function will fail and return 'ZDKInvalidHandle'.
Returns
The Banafo Service request ID corresponding to this upload request
See also
ZDKBanafoEventsHandler, cancelRequest()

The documentation for this protocol was generated from the following file: