- GetAgents getAgents = new GetAgents();
- getAgents.setAgentId("agentId");
- getAgents.setSearchKey("searchKey");
- getAgents.setFromIndex(2);
- getAgents.setToIndex(10);
- ZohoVoiceAPI zohoVoiceAPI = new ZohoVoiceAPI(zohoVoiceSDK,);
- GetAgentsResponse response = zohoVoiceAPI.getAgents(getAgents);
- // Response Object
- String status = response.getStatus();
- String statusCode = response.getStatusCode();
- String errorMessage = response.getErrorMessage();
- JSONObject responseInJSON = response.getJSONObject();
- ArrayList<Agents> agents = response.getAgents();
- Agents agent = agents.get(0);
- agent.getAgentId();
- agent.getAgentNumber();
- agent.getDepartmentName();
- agent.getEmailId();
- agent.getExtension();
- agent.getName();
- agent.getOnlineStatus();
Associated Number
To get details about associated numbers and respective agents.
- GetAssociatedNumbers getAssociatedNumbers = new GetAssociatedNumbers();
- getAssociatedNumbers.setAgentId("agentId");
- ZohoVoiceAPI zohoVoiceAPI = new ZohoVoiceAPI(zohoVoiceSDK);
- GetAssociatedNumbersResponse response = zohoVoiceAPI.getAssociatedNumbers(getAssociatedNumbers);
- // Response Object
- String status = response.getStatus();
- String statusCode = response.getStatusCode();
- String errorMessage = response.getErrorMessage();
- JSONObject responseInJSON = response.getJSONObject();
- ArrayList<NumberInfo> outgoingNumbers = response.getOutgoingNumbers();
- ArrayList<NumberInfo> incomingNumbers = response.getIncomingNumbers();
- NumberInfo incomingNumber = incomingNumbers.get(0);
- Long numberId = incomingNumber.getNumberId();
- String displayName = incomingNumber.getDisplayName();
- String telNumber = incomingNumber.getTelNumber();
- String countryCode = incomingNumber.getCountryCode();
- String didNumber = incomingNumber.getDidNumber();
Regenerate Key
To regenerate the agent-specific key. This key and password are used to log in to the Dialer.
- RegenerateKey regenerateKey = new RegenerateKey();
- regenerateKey.setAgentId("AgentId");
- regenerateKey.setOldAgentKey("oldAgentPassword");
- ZohoVoiceAPI zohoVoiceAPI = new ZohoVoiceAPI(zohoVoiceSDK);
- RegenerateKeyResponse response = zohoVoiceAPI.regenerateKey(regenerateKey);
- // Response Object
- String status = response.getStatus();
- String statusCode = response.getStatusCode();
- String errorMessage = response.getErrorMessage();
- JSONObject responseInJSON = response.getJSONObject();
Regenerate Password
To regenerate the agent-specific password.
- RegeneratePassword regeneratePassword = new RegeneratePassword();
- regeneratePassword.setAgentId("AgentId");
- regeneratePassword.setEmailId("abc@sample.com");
- regeneratePassword.setOldPassword("oldPassword");
- ZohoVoiceAPI zohoVoiceAPI = new ZohoVoiceAPI(zohoVoiceSDK);
- RegeneratePasswordResponse response = zohoVoiceAPI.regeneratePassword(regeneratePassword);
- // Response Object
- String status = response.getStatus();
- String statusCode = response.getStatusCode();
- String errorMessage = response.getErrorMessage();
- JSONObject responseInJSON = response.getJSONObject();
Resend Mail
To resend the email that contains the regenerated password.
- ResendMail resendMail = new ResendMail();
- resendMail.setAgentId("AgentId");
- resendMail.setEmailId("abc@sample.com");
- ZohoVoiceAPI zohoVoiceAPI = new ZohoVoiceAPI(zohoVoiceSDK);
- ResendMailResponse response = zohoVoiceAPI.resendMail(resendMail);
- // Response Object
- String status = response.getStatus();
- String statusCode = response.getStatusCode();
- String errorMessage = response.getErrorMessage();
- JSONObject responseInJSON = response.getJSONObject();