zdk.net
|
Banafo Service Manager. More...
#include <BanafoManager.h>
Public Member Functions | |
BanafoManager (ZDK::Shared::BanafoManager src) | |
ZDK_NET::Result ^ | Start (System::String^ schemeAndAuthority, System::String^ basePath, System::String^ clientID) |
Set up and Start the Banafo Service. More... | |
ZDK_NET::Result ^ | Stop () |
Stops the Banafo Service. More... | |
ZDK_NET::Result ^ | StartAuthorization () |
Starts Banafo Service authorization process. More... | |
ZDK_NET::Result ^ | CancelAuthorization () |
Cancels Banafo Service authorization process. More... | |
ZDK_NET::Result ^ | SetTokens (System::String^ accessToken, System::String^ refreshToken) |
Set Banafo Service authorization tokens. More... | |
ZDK_NET::Result ^ | CancelRequest (long long requestId) |
Cancels a Banafo Service request. More... | |
ZDK_NET::Result ^ | SetCallContact (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::BanafoContactSearchCriteria ^ | 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. More... | |
ZDK_NET::BanafoContact ^ | 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. More... | |
ZDK_NET::BanafoCall ^ | 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. More... | |
ZDK_NET::RecordingStream ^ | CreateRecordingStream (ZDK_NET::RecordingType origin, System::String^ type, System::String^ fileName, System::String^ languageCode) |
Creates a RecordingStream object. More... | |
ZDK_NET::BanafoRecording ^ | CreateRecording (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 |
Banafo Service Manager.
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.
[in] | value | The Banafo Service event listener to be added |
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.
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.
[in] | requestId | The Banafo Service request handler that is going to be canceled. If invalid handler is provided the function will fail with 'ResultCode::NotFound'. |
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
[in] | banafoId | See BanafoCall |
[in] | summary | See BanafoCall |
[in] | title | See BanafoCall |
[in] | source | See BanafoCall |
[in] | origin | See BanafoCall |
[in] | startedAt | See BanafoCall |
[in] | acceptedAt | See BanafoCall |
[in] | finishedAt | See BanafoCall |
[in] | type | See BanafoCall |
[in] | localPhone | See BanafoCall |
[in] | remotePhone | See BanafoCall |
[in] | contact | See BanafoCall |
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()
[in] | banafoId | See BanafoContact |
[in] | remoteId | See BanafoContact |
[in] | remoteProvider | See BanafoContact |
[in] | displayName | See BanafoContact |
[in] | firstName | See BanafoContact |
[in] | middleName | See BanafoContact |
[in] | lastName | See BanafoContact |
[in] | type | See BanafoContact |
[in] | url | See BanafoContact |
[in] | company | See BanafoContact |
[in] | emails | See BanafoContact |
[in] | phones | See BanafoContact |
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()
[in] | contactId | See BanafoContactSearchCriteria |
[in] | provider | See BanafoContactSearchCriteria |
[in] | search | See BanafoContactSearchCriteria |
[in] | types | See BanafoContactSearchCriteria |
[in] | phone | See BanafoContactSearchCriteria |
[in] | nationalNumber | See BanafoContactSearchCriteria |
[in] | reverseLookup | See BanafoContactSearchCriteria |
[in] | region | See BanafoContactSearchCriteria |
[in] | start | See BanafoContactSearchCriteria |
[in] | limit | See BanafoContactSearchCriteria |
[in] | pageId | See BanafoContactSearchCriteria |
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
[in] | banafoId | See BanafoRecording |
[in] | startedAt | See BanafoRecording |
[in] | finishedAt | See BanafoRecording |
[in] | banafoCallId | See BanafoRecording |
[in] | streams | See BanafoRecording |
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
[in] | origin | See RecordingStream |
[in] | type | See RecordingStream |
[in] | fileName | See RecordingStream |
[in] | languageCode | See RecordingStream |
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.
[in] | value | The Banafo Service event listener to be removed |
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 !!!
[in] | call | The call to be created at the Banafo Service |
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 !!!
[in] | recording | The recording to be created at the Banafo Service |
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.
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.
[in] | criteria | The 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'. |
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.
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.
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.
[in] | banafoCallId | The Banafo call identifier. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'. |
[in] | contact | The new contact data. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'. |
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.
[in] | accessToken | The access token for the service. It can be left empty and a new access token will be obtained from the refresh token. |
[in] | refreshToken | The refresh token for the service. This is a required parameter and if empty string is provided the function will fail with 'ResultCode::InvalidArgument'. |
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'.
[in] | schemeAndAuthority | The 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] | basePath | The 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] | clientID | The 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'. |
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.
ZDK_NET::Result ^ ZDK_NET::BanafoManager::Stop | ( | ) |
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.
[in] | banaforRecordingId | The 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] | filePathUtf8 | Full 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'. |