zdk.net
Public Member Functions | Public Attributes | List of all members
ZDK_NET::BanafoManager Class Reference

Banafo Service Manager. More...

#include <BanafoManager.h>

Inheritance diagram for ZDK_NET::BanafoManager:
ZDK_NET::ZHandle

Public Member Functions

 BanafoManager (ZDK::Shared::BanafoManager src)
 
ZDK_NET::ResultStart (System::String^ schemeAndAuthority, System::String^ basePath, System::String^ clientID)
 Set up and Start the Banafo Service. More...
 
ZDK_NET::ResultStop ()
 Stops the Banafo Service. More...
 
ZDK_NET::ResultStartAuthorization ()
 Starts Banafo Service authorization process. More...
 
ZDK_NET::ResultCancelAuthorization ()
 Cancels Banafo Service authorization process. More...
 
ZDK_NET::ResultSetTokens (System::String^ accessToken, System::String^ refreshToken)
 Set Banafo Service authorization tokens. More...
 
ZDK_NET::ResultCancelRequest (long long requestId)
 Cancels a Banafo Service request. More...
 
ZDK_NET::ResultSetCallContact (System::String^ banafoCallId, ZDK_NET::BanafoContact^ contact)
 Updates contact information to a call. More...
 
long long ListContacts (ZDK_NET::BanafoContactSearchCriteria^ criteria)
 List contacts based on serch criterias. More...
 
long long ListIntegrations ()
 List CRM integrations. More...
 
long long UploadRecording (System::String^ banaforRecordingId, System::String^ filePathUtf8)
 Upload audio recording file to the Banafo server. More...
 
ZDK_NET::BanafoContactSearchCriteriaCreateContactSearchCriteria (System::String^ contactId, System::String^ provider, System::String^ search, List< ZDK_NET::ContactType >^ types, System::String^ phone, System::String^ nationalNumber, bool reverseLookup, System::String^ region, int start, int limit, System::String^ pageId)
 Creates a BanafoContactSearchCriteria object. More...
 
ZDK_NET::BanafoContactCreateContact (System::String^ banafoId, System::String^ remoteId, System::String^ remoteProvider, System::String^ displayName, System::String^ firstName, System::String^ middleName, System::String^ lastName, ZDK_NET::ContactType type, System::String^ url, System::String^ company, List< System::String^>^ emails, List< BanafoPhone^>^ phones)
 Creates a BanafoContact object. More...
 
ZDK_NET::BanafoCallCreateCall (System::String^ banafoId, System::String^ summary, System::String^ title, System::String^ source, ZDK_NET::OriginType origin, System::String^ startedAt, System::String^ acceptedAt, System::String^ finishedAt, System::String^ type, System::String^ localPhone, System::String^ remotePhone, ZDK_NET::BanafoContact^ contact)
 Creates a BanafoCall object. More...
 
ZDK_NET::RecordingStreamCreateRecordingStream (ZDK_NET::RecordingType origin, System::String^ type, System::String^ fileName, System::String^ languageCode)
 Creates a RecordingStream object. More...
 
ZDK_NET::BanafoRecordingCreateRecording (System::String^ banafoId, System::String^ startedAt, System::String^ finishedAt, System::String^ banafoCallId, List< RecordingStream^>^ streams)
 Creates a BanafoRecording object. More...
 
long long ForceCreateCallAtServer (ZDK_NET::BanafoCall^ call)
 Force creates Banafo Call at the Banafo Service. More...
 
long long ForceCreateRecordingAtServer (ZDK_NET::BanafoRecording^ recording)
 Force creates Banafo Recording at the Banafo Service. More...
 
long long GetProfile ()
 Get Banafo profile. More...
 
long long ListTranscriptLanguages ()
 List Banafo transcript languages. More...
 
void AddBanafoListener (ZDK_NET::BanafoEventsHandler^ value)
 Adds a new Banafo Service event listener. More...
 
void DropBanafoListener (ZDK_NET::BanafoEventsHandler^ value)
 Removes a specific already added Banafo Service event listener. More...
 
virtual long long Handle () override
 
virtual void Initialize () override
 
virtual void ReleaseReference () override
 

Public Attributes

ZDK::IBanafoManager * cppRef = nullptr
 

Detailed Description

Banafo Service Manager.

Member Function Documentation

◆ AddBanafoListener()

void ZDK_NET::BanafoManager::AddBanafoListener ( ZDK_NET::BanafoEventsHandler 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
BanafoEventsHandler, DropBanafoListener()

◆ CancelAuthorization()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::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
Result, BanafoServiceStateType, CancelAuthorization()

◆ CancelRequest()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::CancelRequest ( long long  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
Result

◆ CreateCall()

ZDK_NET::BanafoCall ^ ZDK_NET::BanafoManager::CreateCall ( System::String^  banafoId,
System::String^  summary,
System::String^  title,
System::String^  source,
ZDK_NET::OriginType  origin,
System::String^  startedAt,
System::String^  acceptedAt,
System::String^  finishedAt,
System::String^  type,
System::String^  localPhone,
System::String^  remotePhone,
ZDK_NET::BanafoContact contact 
)

Creates a BanafoCall object.

Creates a BanafoCall object

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

◆ CreateContact()

ZDK_NET::BanafoContact ^ ZDK_NET::BanafoManager::CreateContact ( System::String^  banafoId,
System::String^  remoteId,
System::String^  remoteProvider,
System::String^  displayName,
System::String^  firstName,
System::String^  middleName,
System::String^  lastName,
ZDK_NET::ContactType  type,
System::String^  url,
System::String^  company,
List< System::String^>^  emails,
List< BanafoPhone^>^  phones 
)

Creates a BanafoContact object.

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

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

◆ CreateContactSearchCriteria()

ZDK_NET::BanafoContactSearchCriteria ^ ZDK_NET::BanafoManager::CreateContactSearchCriteria ( System::String^  contactId,
System::String^  provider,
System::String^  search,
List< ZDK_NET::ContactType >^  types,
System::String^  phone,
System::String^  nationalNumber,
bool  reverseLookup,
System::String^  region,
int  start,
int  limit,
System::String^  pageId 
)

Creates a BanafoContactSearchCriteria object.

Creates a BanafoContactSearchCriteria object to be used for ListContacts()

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

◆ CreateRecording()

ZDK_NET::BanafoRecording ^ ZDK_NET::BanafoManager::CreateRecording ( System::String^  banafoId,
System::String^  startedAt,
System::String^  finishedAt,
System::String^  banafoCallId,
List< RecordingStream^>^  streams 
)

Creates a BanafoRecording object.

Creates a BanafoRecording object

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

◆ CreateRecordingStream()

ZDK_NET::RecordingStream ^ ZDK_NET::BanafoManager::CreateRecordingStream ( ZDK_NET::RecordingType  origin,
System::String^  type,
System::String^  fileName,
System::String^  languageCode 
)

Creates a RecordingStream object.

Creates a RecordingStream object

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

◆ DropBanafoListener()

void ZDK_NET::BanafoManager::DropBanafoListener ( ZDK_NET::BanafoEventsHandler 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
BanafoEventsHandler, AddBanafoListener()

◆ ForceCreateCallAtServer()

long long ZDK_NET::BanafoManager::ForceCreateCallAtServer ( ZDK_NET::BanafoCall call)

Force creates Banafo Call at the Banafo Service.

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

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

The BanafoCall::Origin(), BanafoCall::Type(), BanafoCall::Source() and BanafoCall::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
BanafoCall, BanafoEventsHandler, CancelRequest()

◆ ForceCreateRecordingAtServer()

long long ZDK_NET::BanafoManager::ForceCreateRecordingAtServer ( ZDK_NET::BanafoRecording recording)

Force creates Banafo Recording at the Banafo Service.

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

Upon completion the 'BanafoEventsHandler::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 BanafoRecording::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
BanafoRecording, BanafoEventsHandler, CancelRequest(), UploadRecording()

◆ GetProfile()

long long ZDK_NET::BanafoManager::GetProfile ( )

Get Banafo profile.

Gets Banafo user profile information.

Upon completion the 'BanafoEventsHandler::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
BanafoEventsHandler, CancelRequest()

◆ ListContacts()

long long ZDK_NET::BanafoManager::ListContacts ( ZDK_NET::BanafoContactSearchCriteria 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 BanafoContactSearchCriteria'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 BanafoEventsHandler::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
BanafoContactSearchCriteria, BanafoEventsHandler, CancelRequest()

◆ ListIntegrations()

long long ZDK_NET::BanafoManager::ListIntegrations ( )

List CRM integrations.

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

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

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

◆ ListTranscriptLanguages()

long long ZDK_NET::BanafoManager::ListTranscriptLanguages ( )

List Banafo transcript languages.

Lists Banafo transcript languages.

Upon completion the 'BanafoEventsHandler::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
BanafoEventsHandler, CancelRequest()

◆ SetCallContact()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::SetCallContact ( System::String^  banafoCallId,
ZDK_NET::BanafoContact 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
Result, BanafoContact

◆ SetTokens()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::SetTokens ( System::String^  accessToken,
System::String^  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
Result, BanafoServiceStateType, StartAuthorization()

◆ Start()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::Start ( System::String^  schemeAndAuthority,
System::String^  basePath,
System::String^  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
Result, BanafoServiceStateType, Stop()

◆ StartAuthorization()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::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
Result, BanafoServiceStateType, CancelAuthorization()

◆ Stop()

ZDK_NET::Result ^ ZDK_NET::BanafoManager::Stop ( )

Stops the Banafo Service.

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

Returns
Result of the invocation
See also
Result, Start()

◆ UploadRecording()

long long ZDK_NET::BanafoManager::UploadRecording ( System::String^  banaforRecordingId,
System::String^  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 'BanafoEventsHandler::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
BanafoEventsHandler, CancelRequest()

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