AWSConnectParticipant

@interface AWSConnectParticipant

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage a customer contact center and provide reliable customer engagement at any scale.

Amazon Connect enables customer contacts through voice or chat.

The APIs described here are used by chat participants, such as agents and customers.

  • The service configuration used to instantiate this service client.

    Warning

    Once the client is instantiated, do not modify the configuration object. It may cause unspecified behaviors.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration

    Swift

    var configuration: UnsafeMutablePointer<Int32> { get }
  • Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
       let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
       AWSServiceManager.default().defaultServiceConfiguration = configuration
    
       return true
    

    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
         AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                         identityPoolId:@"YourIdentityPoolId"];
         AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1
                                                                              credentialsProvider:credentialsProvider];
         [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
    
         return YES;
     }
    

    Then call the following to get the default service client:

    Swift

    let ConnectParticipant = AWSConnectParticipant.default()
    

    Objective-C

    AWSConnectParticipant *ConnectParticipant = [AWSConnectParticipant defaultConnectParticipant];
    

    Declaration

    Objective-C

    + (nonnull instancetype)defaultConnectParticipant;

    Swift

    class func `default`() -> Self

    Return Value

    The default service client.

  • Creates a service client with the given service configuration and registers it for the key.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
       let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
       AWSConnectParticipant.register(with: configuration!, forKey: "USWest2ConnectParticipant")
    
       return true
    

    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                        identityPoolId:@"YourIdentityPoolId"];
        AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                             credentialsProvider:credentialsProvider];
    
        [AWSConnectParticipant registerConnectParticipantWithConfiguration:configuration forKey:@"USWest2ConnectParticipant"];
    
        return YES;
    }
    

    Then call the following to get the service client:

    Swift

    let ConnectParticipant = AWSConnectParticipant(forKey: "USWest2ConnectParticipant")
    

    Objective-C

    AWSConnectParticipant *ConnectParticipant = [AWSConnectParticipant ConnectParticipantForKey:@"USWest2ConnectParticipant"];
    

    Warning

    After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

    Declaration

    Objective-C

    + (void)registerConnectParticipantWithConfiguration:(id)configuration
                                                 forKey:(nonnull NSString *)key;

    Swift

    class func register(withConfiguration configuration: Any!, forKey key: String)

    Parameters

    configuration

    A service configuration object.

    key

    A string to identify the service client.

  • Retrieves the service client associated with the key. You need to call + registerConnectParticipantWithConfiguration:forKey: before invoking this method.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
       let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
       AWSConnectParticipant.register(with: configuration!, forKey: "USWest2ConnectParticipant")
    
       return true
    

    }

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                        identityPoolId:@"YourIdentityPoolId"];
        AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                             credentialsProvider:credentialsProvider];
    
        [AWSConnectParticipant registerConnectParticipantWithConfiguration:configuration forKey:@"USWest2ConnectParticipant"];
    
        return YES;
    }
    

    Then call the following to get the service client:

    Swift

    let ConnectParticipant = AWSConnectParticipant(forKey: "USWest2ConnectParticipant")
    

    Objective-C

    AWSConnectParticipant *ConnectParticipant = [AWSConnectParticipant ConnectParticipantForKey:@"USWest2ConnectParticipant"];
    

    Declaration

    Objective-C

    + (nonnull instancetype)ConnectParticipantForKey:(nonnull NSString *)key;

    Swift

    convenience init(forKey key: String)

    Parameters

    key

    A string to identify the service client.

    Return Value

    An instance of the service client.

  • Removes the service client associated with the key and release it.

    Warning

    Before calling this method, make sure no method is running on this client.

    Declaration

    Objective-C

    + (void)removeConnectParticipantForKey:(nonnull NSString *)key;

    Swift

    class func remove(forKey key: String)

    Parameters

    key

    A string to identify the service client.

  • Creates the participant’s connection. Note that ParticipantToken is used for invoking this API instead of ConnectionToken.

    The participant token is valid for the lifetime of the participant – until the they are part of a contact.

    The response URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.

    For chat, you need to publish the following on the established websocket connection:

    {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}

    Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.

    See

    AWSConnectParticipantCreateParticipantConnectionRequest

    See

    AWSConnectParticipantCreateParticipantConnectionResponse

    Declaration

    Objective-C

    - (id)createParticipantConnection:
        (nonnull AWSConnectParticipantCreateParticipantConnectionRequest *)request;

    Swift

    func createParticipantConnection(_ request: AWSConnectParticipantCreateParticipantConnectionRequest) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the CreateParticipantConnection service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will contain an instance of AWSConnectParticipantCreateParticipantConnectionResponse. On failed execution, task.error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Creates the participant’s connection. Note that ParticipantToken is used for invoking this API instead of ConnectionToken.

    The participant token is valid for the lifetime of the participant – until the they are part of a contact.

    The response URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.

    For chat, you need to publish the following on the established websocket connection:

    {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}

    Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.

    See

    AWSConnectParticipantCreateParticipantConnectionRequest

    See

    AWSConnectParticipantCreateParticipantConnectionResponse

    Declaration

    Objective-C

    - (void)
        createParticipantConnection:
            (nonnull AWSConnectParticipantCreateParticipantConnectionRequest *)
                request
                  completionHandler:
                      (void (^_Nullable)(
                          AWSConnectParticipantCreateParticipantConnectionResponse
                              *_Nullable,
                          NSError *_Nullable))completionHandler;

    Swift

    func createParticipantConnection(_ request: AWSConnectParticipantCreateParticipantConnectionRequest, completionHandler: ((AWSConnectParticipantCreateParticipantConnectionResponse?, Error?) -> Void)? = nil)

    Parameters

    request

    A container for the necessary parameters to execute the CreateParticipantConnection service method.

    completionHandler

    The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Disconnects a participant. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantDisconnectParticipantRequest

    See

    AWSConnectParticipantDisconnectParticipantResponse

    Declaration

    Objective-C

    - (id)disconnectParticipant:
        (nonnull AWSConnectParticipantDisconnectParticipantRequest *)request;

    Swift

    func disconnectParticipant(_ request: AWSConnectParticipantDisconnectParticipantRequest) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the DisconnectParticipant service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will contain an instance of AWSConnectParticipantDisconnectParticipantResponse. On failed execution, task.error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Disconnects a participant. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantDisconnectParticipantRequest

    See

    AWSConnectParticipantDisconnectParticipantResponse

    Declaration

    Objective-C

    - (void)
        disconnectParticipant:
            (nonnull AWSConnectParticipantDisconnectParticipantRequest *)request
            completionHandler:
                (void (^_Nullable)(
                    AWSConnectParticipantDisconnectParticipantResponse *_Nullable,
                    NSError *_Nullable))completionHandler;

    Swift

    func disconnectParticipant(_ request: AWSConnectParticipantDisconnectParticipantRequest, completionHandler: ((AWSConnectParticipantDisconnectParticipantResponse?, Error?) -> Void)? = nil)

    Parameters

    request

    A container for the necessary parameters to execute the DisconnectParticipant service method.

    completionHandler

    The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Retrieves a transcript of the session. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantGetTranscriptRequest

    See

    AWSConnectParticipantGetTranscriptResponse

    Declaration

    Objective-C

    - (id)getTranscript:
        (nonnull AWSConnectParticipantGetTranscriptRequest *)request;

    Swift

    func getTranscript(_ request: AWSConnectParticipantGetTranscriptRequest) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the GetTranscript service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will contain an instance of AWSConnectParticipantGetTranscriptResponse. On failed execution, task.error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Retrieves a transcript of the session. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantGetTranscriptRequest

    See

    AWSConnectParticipantGetTranscriptResponse

    Declaration

    Objective-C

    - (void)getTranscript:
                (nonnull AWSConnectParticipantGetTranscriptRequest *)request
        completionHandler:(void (^_Nullable)(
                              AWSConnectParticipantGetTranscriptResponse *_Nullable,
                              NSError *_Nullable))completionHandler;

    Swift

    func getTranscript(_ request: AWSConnectParticipantGetTranscriptRequest, completionHandler: ((AWSConnectParticipantGetTranscriptResponse?, Error?) -> Void)? = nil)

    Parameters

    request

    A container for the necessary parameters to execute the GetTranscript service method.

    completionHandler

    The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Sends an event. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantSendEventRequest

    See

    AWSConnectParticipantSendEventResponse

    Declaration

    Objective-C

    - (id)sendEvent:(nonnull AWSConnectParticipantSendEventRequest *)request;

    Swift

    func sendEvent(_ request: AWSConnectParticipantSendEventRequest) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the SendEvent service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will contain an instance of AWSConnectParticipantSendEventResponse. On failed execution, task.error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Sends an event. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantSendEventRequest

    See

    AWSConnectParticipantSendEventResponse

    Declaration

    Objective-C

    - (void)sendEvent:(nonnull AWSConnectParticipantSendEventRequest *)request
        completionHandler:
            (void (^_Nullable)(AWSConnectParticipantSendEventResponse *_Nullable,
                               NSError *_Nullable))completionHandler;

    Swift

    func sendEvent(_ request: AWSConnectParticipantSendEventRequest, completionHandler: ((AWSConnectParticipantSendEventResponse?, Error?) -> Void)? = nil)

    Parameters

    request

    A container for the necessary parameters to execute the SendEvent service method.

    completionHandler

    The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Sends a message. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantSendMessageRequest

    See

    AWSConnectParticipantSendMessageResponse

    Declaration

    Objective-C

    - (id)sendMessage:(nonnull AWSConnectParticipantSendMessageRequest *)request;

    Swift

    func sendMessage(_ request: AWSConnectParticipantSendMessageRequest) -> Any!

    Parameters

    request

    A container for the necessary parameters to execute the SendMessage service method.

    Return Value

    An instance of AWSTask. On successful execution, task.result will contain an instance of AWSConnectParticipantSendMessageResponse. On failed execution, task.error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.

  • Sends a message. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

    See

    AWSConnectParticipantSendMessageRequest

    See

    AWSConnectParticipantSendMessageResponse

    Declaration

    Objective-C

    - (void)sendMessage:(nonnull AWSConnectParticipantSendMessageRequest *)request
        completionHandler:
            (void (^_Nullable)(AWSConnectParticipantSendMessageResponse *_Nullable,
                               NSError *_Nullable))completionHandler;

    Swift

    func sendMessage(_ request: AWSConnectParticipantSendMessageRequest, completionHandler: ((AWSConnectParticipantSendMessageResponse?, Error?) -> Void)? = nil)

    Parameters

    request

    A container for the necessary parameters to execute the SendMessage service method.

    completionHandler

    The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSConnectParticipantErrorDomain domain and the following error code: AWSConnectParticipantErrorAccessDenied, AWSConnectParticipantErrorInternalServer, AWSConnectParticipantErrorThrottling, AWSConnectParticipantErrorValidation.