Responses and Exceptions
All SDK method calls return an instance of the APIResponse class.
Use the data_object to get 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.
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 record operation:
-APIResponse<DeletedRecordsHandler>For Record image download operation:
-APIResponse<DownloadHandler>MassUpdate record operation:
-APIResponse<MassUpdateActionHandler>
-APIResponse<MassUpdateResponseHandler>
For GET Requests
The data_object variable of the returned APIResponse instance returns the response handler interface.
The ResponseHandler encompasses the ResponseWrapper class (for application/json responses), FileBodyWrapper class (for file download responses), and the APIException class.
The CountHandler encompasses the CountWrapper class (for application/json responses) and the APIException class.
The DeletedRecordsHandler encompasses the DeletedRecordsWrapper class (for application/json responses) and the APIException class.
The DownloadHandler encompasses the FileBodyWrapper class (for file download responses responses) and the APIException class.
The MassUpdateResponseHandler encompasses the MassUpdateResponseWrapper class (for application/json responses) and the APIException class.
For POST, PUT, DELETE Requests
The data_object variable of the returned APIResponse instance returns the response handler interface.
The ActionHandler encompasses the ActionWrapper class (for application/json responses) and the APIException class. The ActionWrapper class contains Property/Properties that may contain one/list of ActionResponse interfaces.
The ActionResponse encompasses the SuccessResponse class (for application/json responses) and the APIException class.
The ActionHandler interface encompasses the ActionWrapper 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 BaseCurrency/ActionWrapper 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.