IntercomApi. iOS
Api to manipulate with intercoms.
Get intercoms list
Get list of intercoms. Specify page for request. For the first request set page = 0
.
If request was successful you'll get paginated response of groups. If any error would occur you would get an VMSApiError
object.
getIntercomsList(page: Int, completion: (PaginatedResponse<VMSIntercom>?, VMSApiError?))
Get intercom codes list
Get list of intercom codes. Specify page for request. For the first request set page = 0
.
If request was successful you'll get paginated response of groups. If any error would occur you would get an VMSApiError
object.
getIntercomCodesList(page: Int, completion: (PaginatedResponse<VMSIntercomCode>?, VMSApiError?))
Get calls list
Get list of calls. Specify page for request. For the first request set page = 0
.
If request was successful you'll get paginated response of groups. If any error would occur you would get an VMSApiError
object.
getCallsList(page: Int, completion: (PaginatedResponse<VMSIntercomCall>?, VMSApiError?))
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. If any error would occur you would get an ApiError
object.
getActivateCode(completion: (VMSActivationCode?, VMSApiError?))
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. If any error would occur you would get an VMSApiError
object.
setIntercomFlat(intercomId: Int, flat: Int, completion: (VMSIntercom?, VMSApiError?))
Rename intercom
Rename specific intercom by it's id with new name.
If request was successful, you will receive updated intercom. If any error would occur you would get an VMSApiError
object.
renameIntercom(with id: Int, newName: String, completion: (VMSIntercom?, VMSApiError?))
Set intercom settings
Change settings parameters for specific intercom by it's id.
If request was successful, you will receive updated intercom. If any error would occur you would get an VMSApiError
object.
changeIntercomSettings(with id: Int, isEnabled: Bool, timetable: VMSTimetable?, completion: (VMSIntercom?, VMSApiError?))
public final class VMSTimetable: Codable {
public var days: [VMSDays]?
public var intervals: [VMSIntervals]?
}
id
- id of intercom
isEnabled
- 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.
init(days: [VMSDays]?, intervals: [VMSIntervals]?)
Open door
Open intercom's door.
If request was successful, the response would be nil
. If any error would occur you would get an VMSApiError
object.
openDoor(intercomId: Int, completion: (VMSApiError?))
Create code
Create code to open the door physically.
If request was successful, you'll get VMSIntercomCode
object. If any error would occur you would get an VMSApiError
object.
createCode(intercomId: Int, name: String, expiredAt: Date, completion: (VMSIntercomCode?, VMSApiError?))
intercomId
- id of intercom
name
- the name for new code
expiredAt
- 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 nil
. If any error would occur you would get an VMSApiError
object.
deleteIntercoms(with ids: [Int], completion: (VMSApiError?))
Delete intercom codes
Delete intercom codes you don't need anymore.
If request was successful, the response would be nil
. If any error would occur you would get an VMSApiError
object.
deleteIntercomCodes(with ids: [Int], completion: (VMSApiError?))
Delete calls
Delete calls you don't need anymore.
If request was successful, the response would be nil
. If any error would occur you would get an VMSApiError
object.
deleteCalls(with ids: [Int], completion: (VMSApiError?))