Skip to content

Latest API Documentation

rohitphogat19 edited this page May 28, 2019 · 22 revisions

APIs Related to Users

Get Users List

let getUserSearchQuery = QueryBuilder.instance.createUserListFilter()
getUserSearchQuery.searchQuery = query
getUserSearchQuery.limit = defaultLimit
getUserSearchQuery.skip = 0
CHService.main.getUsersList(queryFilter: getUserSearchQuery, completion: {(users,error) in
    // Do your Stuff here
})

Get a User with User Id

CHService.main.getUser(userId:"20456",completion:{(user,error) in
    // Do your Stuff here
})

Block a user

CHService.main.blockUser(userId:"20456",completion:{(status,error) in
    // Do your Stuff here
})

Get Blocked Users List

let blockedUsersQuery = QueryBuilder.instance.createBlockedUsersListFilter()
blockedUsersQuery.limit = 30
blockedUsersQuery.skip = 0
CHService.main.getBlockedUsers(queryFilter:blockedUsersQuery,completion:{(users,error) in
    // Do your stuff here
})

Get Friends list

let friendsFilter = QueryBuilder.createUserFriendsListFilter()
friendsFilter.online = true
friendsFilter.limit = 30
friendsFilter.skip = 0
friendsFilter.includeBlocked = true
friendsFilter.skipUserIds = "20456,20576,20789"
friendsFilter.searchQuery = "Leo"
friendsFilter.sort = .DESC
CHService.main.getFriendsList(queryFilter:friendsFilter,completion:{(users,error) in
    // Do your Stuff Here
})

Get Total Friends Count

let friendsCountFilter = QueryBuilder.instance.createUserFriendsCountFilter()
friendsCountFilter.online = false
friendsCountFilter.includeBlocked = true
friendsCountFilter.searchQuery = "James"
CHService.main.getFriendsCount(queryFilter:friendsCountQueryFilter,completion:{(count,error) in
    // Do your stuff here
})

UnBlock a User

CHService.main.unblockUser(userId:"20456",completion:{(status,error) in
    // Do your stuff here
})