Skip to main content

Responses and Exceptions

All SDK methods return an instance of the APIResponse class.

Use the getObject() method 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 getObject() returns an instance of APIException class.

All other exceptions such as SDK anomalies and other unexpected behaviours are thrown under the SDKException class.

However, some specific operations have different expected objects, such as the following:

  • 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 getObject() of the returned APIResponse instance returns the response handler interface.

  • The ResponseHandler interface interface encompasses the following

    • ResponseWrapper class (for application/json responses)
    • FileBodyWrapper class (for File download responses)
    • APIException class
  • The CountHandler interface interface encompasses the following

    • CountWrapper class (for application/json responses)
    • APIException class
  • The DeletedRecordsHandler interface interface encompasses the following

    • DeletedRecordsWrapper class (for application/json responses)
    • APIException class
  • The DownloadHandler interface interface encompasses the following

    • FileBodyWrapper class (for File download responses)
    • APIException class
  • The MassUpdateResponseHandler interface interface encompasses the following

    • MassUpdateResponseWrapper class (for File download responses)
    • APIException class

For POST, PUT, DELETE Requests

The getObject() of the returned APIResponse instance returns the response handler interface.

  • The ActionHandler interface encompasses the following

    • ActionWrapper class (for File download responses)
    • APIException class
  • The ActionResponse interface encompasses the following

    • SuccessResponse class (for application/json responses)
    • APIException class
  • The ActionWrapper class contains Property/Properties that may contain one/list of ActionResponse interfaces.
  • The ActionHandler interface encompasses the following

    • ActionWrapper class (for application/json responses)
    • APIException class
  • The RecordActionHandler interface encompasses the following

    • RecordActionWrapper class (for application/json responses)
    • APIException class
  • The BaseCurrencyActionHandler interface encompasses the following

    • BaseCurrencyActionWrapper class (for application/json responses)
    • APIException class
  • The MassUpdateActionHandler interface encompasses the following

    • MassUpdateActionWrapper class (for application/json responses)
    • APIException class
  • The ConvertActionHandler interface encompasses the following

    • ConvertActionWrapper class (for application/json responses)
    • APIException class