Request a New Connection

Requesting a New Connection

Overview

The requestConnection method in the b.well SDK facilitates the user's ability to request a new connection be made available by submitting a request with specific details.

Method Signature

suspend fun requestConnection(request: RequestConnectionRequest): OperationOutcome
  • request: A RequestConnectionRequest object containing details of the connection to be established.
  • OperationOutcome: Indicates the result of the connection request.

Example Usage

val newConnection = RequestConnectionRequest.Builder()
    .city() // Specify the city (optional)
    .institution() // Specify the institution (optional)
    .provider() // Specify the provider (optional)
    .state() // Specify the state (optional)
    .build()

val result = BWellSdk.connection.requestConnection(newConnection)
// Handle the OperationOutcome of the request

This code demonstrates how to build a RequestConnectionRequest with optional parameters like city, institution, provider, and state, and use it to request a new connection.

Best Practices

  • Ensure that necessary details are provided in the RequestConnectionRequest for accurate connection request information.
  • While the SDK treats the request parameters as optional, it is best for the client application to enforce at least the institution parameter.
  • Analyze the OperationOutcome to understand the success or failure of the request.