New SDKs Released!
We have released new versions of our SDKs, now supporting the latest version of our APIs. Explore them here.
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 getObject() method to obtain the response handler interface depending on the type of request (GET, POST,PUT,DELETE).
The following are the wrappers with their handlers for the respective APIs:
- Tag API's record and count tag operation:
-APIResponse<RecordActionHandler>
-APIResponse<CountHandler> - BaseCurrency operation:
-APIResponse<BaseCurrencyActionHandler> - Lead convert operation:
-APIResponse<ConvertActionHandler> - Deleted record operation:
-APIResponse<DeletedRecordsHandler> - Download record's photo operation:
-APIResponse<DownloadHandler> - MassUpdate record operation:
-APIResponse<MassUpdateActionHandler>
-APIResponse<MassUpdateResponseHandler>
For GET Requests
- APIResponse.getObject() 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
- APIResponse.getObject() returns the ActionHandler 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.