Responses and Exceptions
APIResponse<ResponseHandler> and APIResponse<ActionHandler> are the wrapper objects for Zoho CRM APIs’ responses. All API calling methods would return one of these two objects.
Use the Object property in the returned APIResponse object to obtain the response handler interface depending on the type of request (GET, POST, PUT, DELETE).
APIResponse<ResponseHandler> and APIResponse<ActionHandler> are the common wrapper objects for Zoho CRM APIs’ responses.
Whenever the API returns an error response, the response will be an instance of APIException class.
All other exceptions such as SDK anomalies and other unexpected behaviours are thrown under the SDKException class.
The following are the wrappers with their handlers for the respective APIs:
For operations involving records in Tags
-APIResponse<RecordActionHandler>For getting Record Count for a specific Tag operation
-APIResponse<CountHandler>For operations involving BaseCurrency
-APIResponse<BaseCurrencyActionHandler>For Lead convert operation
-APIResponse<ConvertActionHandler>For retrieving Deleted records operation
-APIResponse<DeletedRecordsHandler>For Record image download operation
-APIResponse<DownloadHandler>For MassUpdate record operations
-APIResponse<MassUpdateActionHandler>
-APIResponse<MassUpdateResponseHandler>
For GET Requests
The Object property of the returned APIResponse instance returns the response handler interface.
This ResponseHandler interface encompasses the ResponseWrapper class (for application/json responses), file body wrapper class (for file download responses), and the APIException class.
This CountHandler interface encompasses the CountWrapper class (for application/json responses) and the APIException class.
This DeletedRecordsHandler interface encompasses the DeletedRecordsWrapper class (for application/json responses) and the APIException class.
This DownloadHandler interface encompasses the FileBodyWrapper class (for file download responses responses) and the APIException class.
This MassUpdateResponseHandler interface encompasses the MassUpdateResponseWrapper class (for application/json responses) and the APIException class.
For POST, PUT, DELETE Requests
The Object property of the returned APIResponse instance returns the response handler interface.
The ActionHandler interface encompasses the ActionWrapper class (for application/json responses) and the APIException class.
The ActionResponse interface encompasses the SuccessResponse class (for application/json responses) and the <APIException class>.
The RecordActionHandler interface encompasses the RecordActionWrapper class (for application/json responses), and the APIException class.
The BaseCurrencyActionHandler interface encompasses the BaseCurrencyActionWrapper class (for application/json responses), and the APIException class.
The MassUpdateActionHandler interface encompasses the MassUpdateActionWrapper class (for application/json responses), and the APIException class.
The ConvertActionHandler interface encompasses the ConvertActionWrapper class (for application/json responses), and the APIException class.
If the root key of the response is not "data" (errors such as Internal Server Error), then the ActionResponse interface with either the SuccessResponse class or APIException class is returned.
All other exceptions such as SDK anomalies and other unexpected behaviors are thrown under the SDKException class.