Skip to main content
Skip table of contents

GroupApi. iOS

Api to manipulate with camera groups.

Get group list

Get list of camera groups. 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.

CODE
getGroupsList(page: Int, completion: (PaginatedResponse<VMSCameraTree>?, VMSApiError?))

Create group

Create new group of cameras with specified name. Initially the group is empty.

If request was successful, the response would be nil. If any error would occur you would get an VMSApiError object.

CODE
createGroup(with name: String, completion: (VMSApiError?))

Rename group

Rename specific group by it's id with new name.

If request was successful, the response would be nil. If any error would occur you would get an VMSApiError object.

CODE
renameGroup(with id: Int, newName: String, completion: (VMSApiError?))

Delete group

Delete specific group by it's id.

If request was successful, the response would be nil. If any error would occur you would get an VMSApiError object.

CODE
deleteGroup(with id: Int, completion: (VMSApiError?))

Update group

Update group with specified information.

If request was successful, the response would be nil. If any error would occur you would get an VMSApiError object.

CODE
updateGroup(info: VMSUpdateGroupRequest, completion: (VMSApiError?))

VMSUpdateGroupRequest

Object with needed information to update a group

CODE
init(groupName: String, groupId: Int, cameraIds: [Int])

groupName - new name of the group. If you don't' want to change group name set old name in this parameter

groupId - id of the group to specify needed group

cameraIds - list of cameras ids you want to add to this group

Sync groups

This request will sync specified camera with all user's groups. The request require a list of groups where this camera will belong to. Camera will be deleted from other groups.

If request was successful, the response would be VMSGroupSyncType object. If any error would occur you would get an VMSApiError object.

CODE
syncGroups(for cameraId: Int, groupIds: [Int], completion: (VMSGroupSyncType?, VMSApiError?))

cameraId - specify camera by it's id

groupIds - specify the list of group ids where camera will be presented (camera will be added to a group if it wasn't there before)

VMSGroupSyncType

Information about the way of syncing on server side.

CODE
enum VMSGroupSyncType: String, Codable {
    case sync
    case async
}

sync - if the syncing was done

async - if user has more than 50 group the backend request will run asynchronous.

After process is done you'll receive socket message you can handle. See VMSPusherApi for more details

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.