IntercomApi. Android
Api to manipulate with intercoms.
Get intercoms list
Get list of intercoms. Specify page for request. For the first request set page = 1
.
If request was successful you'll get paginated response of groups.
@GET(INTERCOM_LIST)
suspend fun getIntercomsList(@Query(PAGE) page: String): VMSApiResponseIntercoms
Get intercom codes list
Get list of intercom codes. Specify page for request. For the first request set page = 1
.
If request was successful you'll get paginated response of groups.
@GET(INTERCOM_CODES)
suspend fun getIntercomCodesList(@Query(PAGE) page: String): VMSVisitors
Get calls list
Get list of calls. Specify page for request. For the first request set page = 1
.
If request was successful you'll get paginated response of groups.
@GET(INTERCOM_CALLS)
suspend fun getCallsList(@Query(PAGE) page: String): VMSApiResponseVisitHistory
Start adding intercom flow
This request is used to start adding intercom flow.
User should enter a code received from this request and then apply physical intercom key to the intercom.
After that you will receive socket push and user should enter a flat number.
If this intercom was already added, this request will return error with appropriate informational message.
If request was successful you'll get VMSActivationCode
object.
@POST(INTERCOM_LIST)
suspend fun getActivationCode(): VMSActivationCode
Set flat number
Connect intercom with specific flat number.
Create new group of cameras with specified name. Initially the group is empty.
If request was successful, you will receive updated intercom.
@POST(INTERCOM_FLAT)
suspend fun setIntercomFlat(@Path(ID) id: String, @Body data: VMSIntercomFlatData): VMSIntercom
Rename intercom
Rename specific intercom by it's id with new name.
If request was successful, you will receive updated intercom.
@PATCH(INTERCOM_PATCH)
suspend fun renameIntercom(
@Path(ID) id: String,
@Body data: VMSIntercomChangeTitleData
): VMSIntercom
Set intercom settings
Change settings parameters for specific intercom by it's id.
If request was successful, you will receive updated intercom.
@PATCH(INTERCOM_PATCH)
suspend fun changeIntercomSettings(
@Path(ID) id: String,
@Body data: VMSIntercomChangeSettingsData
): VMSIntercom
Data objects:
@Parcelize
data class VMSIntercomChangeSettingsData(
@SerializedName("is_enabled") val is_enabled: Boolean? = false,
@SerializedName("timetable") val timetable: VMSTimetable? = null
): Parcelable
@Path(ID) id
- id of intercom
is_enabled
- set to false
if you want to disable intercom. In this case calls from intercom won't be received to current device.
timetable
- intercom calls schedule. Calls will be received only according to chosen time.
VMSTimetable
Intercom calls schedule.
Timetable can be set in two ways:
by days
by intervals
You cannot set both parameters simultaneously. In this case intervals will be set.
@Parcelize
data class VMSTimetable(
@SerializedName("days") val days: ArrayList<VMSTimetableDay>? = null,
@SerializedName("intervals") val intervals: ArrayList<VMSTimetableInterval>? = null
): Parcelable
Open door
Open intercom's door.
If request was successful, the response would be Response<Unit>
.
@POST(INTERCOM_OPEN_DOOR)
suspend fun openDoor(@Path(ID) id: String): Response<Unit>
Create code
Create code to open the door physically.
If request was successful, you'll get VMSVisitor
object.
@POST(INTERCOM_ID_CODES)
suspend fun createCode(
@Path(ID) id: String,
@Body data: VMSIntercomCodeData
): VMSCodeVisitor
@Path(ID) id
- id of intercom
@Parcelize
data class VMSIntercomCodeData(
@SerializedName("title") val title: String?,
@SerializedName("expired_at") val expired_at: String?,
): Parcelable
title
- the name for new code
expired_at
- Date till which this code will be valid
Delete intercoms
Delete intercoms you don't need anymore.
If request was successful, the response would be Response<Unit>
.
@HTTP(method = DELETE, path = INTERCOM_LIST, hasBody = true)
suspend fun deleteIntercoms(@Body data: VMSIntercomsDeleteData): Response<Unit>
Delete intercom codes
Delete intercom codes you don't need anymore.
If request was successful, the response would be Response<Unit>
.
@HTTP(method = DELETE, path = INTERCOM_CODES, hasBody = true)
suspend fun deleteVisitors(@Body data: VMSIntercomsDeleteData): Response<Unit>
Delete calls
Delete calls you don't need anymore.
If request was successful, the response would be Response<Unit>
.
@HTTP(method = DELETE, path = INTERCOM_CALLS, hasBody = true)
suspend fun deleteCalls(@Body data: VMSIntercomsDeleteData): Response<Unit>