getDepartments()
Note: This API is supported from version 8.1.0-beta01.
The getDepartments() API fetches the list of departments associated with chat and call flows within the brand's settings.
Navigation:
- Calls: Settings > Brands > Select your brand > Flow Controls > Calls > Associated departments for calls.
- Chats: Settings > Brands > Select your brand > Flow Controls > Chat > Associated departments for chats.
Parameter:
- callback: A `ZohoSalesIQResultCallback<List<SIQDepartment>>` instance that asynchronously returns the list of mapped departments.
Syntax
CopiedZohoSalesIQ.Conversation.getDepartments(ZohoSalesIQResultCallback<List<SIQDepartment>> result)
Example
CopiedZohoSalesIQ.Conversation.getDepartments(new ZohoSalesIQResultCallback<List<SIQDepartment>>() {
@Override
public void onComplete(@NonNull SalesIQResult<List<SIQDepartment>> result) {
if (result.isSuccess()) {
List<SIQDepartment> chatAndCallDepartments = result.getData();
List<SIQDepartment> chatDepartments = SIQDepartmentExtensionsKt.chatDepartments(result.getData());
List<SIQDepartment> callDepartments = SIQDepartmentExtensionsKt.callDepartments(result.getData());
} else if (result.getError() != null) {
Log.d("Mobilisten", "getDepartments, Error: code: " + result.getError().getCode() + ", message: " + result.getError().getMessage());
}
}
});
CopiedZohoSalesIQ.Conversation.getDepartments { result ->
if (result.isSuccess) {
val chatAndCallDepartments = result.data.orEmpty()
val chatDepartments = result.data.chatDepartments()
val callDepartments = result.data.callDepartments()
} else {
Log.d("Mobilisten", "getDepartments, Error: code: ${result.error?.code} , message: ${result.error?.message}")
}
}