Invites Management

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


Create Invite

To create an invite, you need to provide the following details:

  • spaceId (required): The id of the space.
  • request (required): The invite information.
val request = SpaceInviteRequest(
  inviteeEmail = "test@example.com", // The email address of the invitee
  role = Role.VIEWER.value, // The role can be VIEWER or OWNER
  deviceIds = listOf("deviceId1", "deviceId2") // The list of device ids to grant access to
)
InstaVision.spaceServices.createInvite(
  spaceId = "spaceId",
  request = request,
  onSuccess = {
    // The invite has been created successfully
  },
  onError = {
    // The error object contains the error code and message
  }
)

Get Invites

To get the list of invites, the following method can be called.

InstaVision.spaceServices.getInvites(
  onSuccess = { invites ->
    // The list of invites is returned
  },
  onError = { error ->
    // The error object contains the error code and message
  }
)

Update Invite

To update the invite information, the following method can be called.

  • spaceId (required): The id of the space.
  • invitationId (required): The id of the invite.
  • request (required): The updated invite information.
val request = SpaceInviteRequest(
  inviteeEmail = "test@example.com", // The email address of the invitee
  role = Role.VIEWER.value, // The role can be VIEWER or OWNER
  deviceIds = listOf("deviceId1", "deviceId2") // The list of device ids to grant access to
)
InstaVision.spaceServices.updateInvite(
  spaceId = "spaceId",
  invitationId = "invitationId",
  request = request,
  onSuccess = {
    // The invite has been updated successfully
  },
  onError = {
    // The error object contains the error code and message
  }
)

Delete Invite

To delete an invite, the following method can be called.

  • spaceId (required): The id of the space.
  • invitationId (required): The id of the invite.
InstaVision.spaceServices.deleteInvite(
  spaceId = "spaceId",
  invitationId = "invitationId",
  onSuccess = {
    // The invite has been deleted successfully
  },
  onError = {
    // The error object contains the error code and message
  }
)

Acknowledge Invite

To acknowledge an invite, the following method can be called.

  • invitationId (required): The id of the invite.
  • request (required): The acknowledge information.
val request = AcknowledgeInviteRequest(
  action = InvitationStatus.REJECTED.value // The action can be ACCEPTED, PENDING or REJECTED
)
InstaVision.spaceServices.acknowledgeInvite(
  invitationId = "invitationId",
  request = request,
  onSuccess = {
    // The invite has been acknowledged successfully
  },
  onError = {
    // The error object contains the error code and message
  }
)