Pairing Session Keys

Pre-requisite: The user has to be signed in to perform the following operations.


Create a pairing session key

To create a pairing session key, The following method can be used:

  • spaceId (required): The space ID of the device.
  • request (required): PairingSessionRequesttimezoneSettings is required; sessionType defaults to SessionType.OTHER.value and deviceId to null.
val request = PairingSessionRequest(
  timezoneSettings = TimezoneSettings(timezoneId, tzFormat), // The timezone settings
  sessionType = SessionType.FOUR_G.value, // Optional; defaults to SessionType.OTHER.value ("")
  deviceId = "deviceId" // Optional; the backend expects it for a 4G camera
)
InstaVision.deviceServices.createPairingSession(
  spaceId = "spaceId",
  request = request,
  onSuccess = { pairingSession ->
    // The object contains the pairing session key
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)

Get the pairing session status

To poll the status of a pairing session created earlier, The following method can be used. onSuccess receives a PairingStatusResponse (deviceId, expired, status, login, pairing):

  • spaceId (required): The space ID of the device.
  • sessionKey (required): The pairing session key.
InstaVision.deviceServices.getPairingSessionStatus(
  spaceId = "spaceId",
  sessionKey = "sessionKey",
  onSuccess = { status ->
    // The object contains the pairing session status
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)

This site uses Just the Docs, a documentation theme for Jekyll.