Skip to content

API_Base.ServiceCallResult

Class

apex
global inherited sharing class API_Base.ServiceCallResult

Tracks the request, response, and status of a web service call.

Since: 1.0

Example:

apex
API_Base.ServiceCallResult result = handler.result;
Boolean success = result.isSuccess;

Properties

PropertyDescription
global Boolean hasFailedIndicates if the service call failed.
global Boolean isAbortedIndicates if the service call was aborted.
global Boolean isSuccessIndicates if the service call completed successfully.
global String statusTextText representation of the service status.

Fields

FieldDescription
global List errorsList of errors encountered during the service call.
global Boolean isMockedIndicates if the service call response was mocked.
global Boolean parseErrorIndicates the response was successfully received from the remote endpoint but parseResponse() failed (typically a JSON deserialization error or unexpected payload shape).
global String requestBodyThe request body sent.
global DTO_NameValues requestHeadersRequest headers as name-value pairs.
global String responseBodyThe response body received.
global DTO_NameValues responseHeadersResponse headers as name-value pairs.
global API_Base.WebserviceStatus statusThe status of the web service call.
global String statusCodeThe HTTP status code for the request.
global String urlThe URL of the endpoint accessed.

Property Details

hasFailed

apex
global Boolean hasFailed

Type: Boolean

Indicates if the service call failed.

Since:

isAborted

apex
global Boolean isAborted

Type: Boolean

Indicates if the service call was aborted.

Since:

isSuccess

apex
global Boolean isSuccess

Type: Boolean

Indicates if the service call completed successfully.

Since:

statusText

apex
global String statusText

Type: String

Text representation of the service status.

Since:


Field Details

errors

apex
global List<String> errors

Type: List

List of errors encountered during the service call.

Since: 1.0

isMocked

apex
global Boolean isMocked

Type: Boolean

Indicates if the service call response was mocked.

Since: 1.0

parseError

apex
global Boolean parseError

Type: Boolean

Indicates the response was successfully received from the remote endpoint but parseResponse() failed (typically a JSON deserialization error or unexpected payload shape). When true the transport itself succeeded — the status code and body are populated — but responsePayload is unreliable. Subscribers branch on this to distinguish parse failure from transport failure without inspecting errors[] strings.

Since: 1.0

requestBody

apex
global String requestBody

Type: String

The request body sent.

Since: 1.0

requestHeaders

apex
global DTO_NameValues requestHeaders

Type: DTO_NameValues

Request headers as name-value pairs.

Since: 1.0

responseBody

apex
global String responseBody

Type: String

The response body received.

Since: 1.0

responseHeaders

apex
global DTO_NameValues responseHeaders

Type: DTO_NameValues

Response headers as name-value pairs.

Since: 1.0

status

apex
global API_Base.WebserviceStatus status

Type: API_Base.WebserviceStatus

The status of the web service call.

Since: 1.0

statusCode

apex
global String statusCode

Type: String

The HTTP status code for the request.

Since: 1.0

url

apex
global String url

Type: String

The URL of the endpoint accessed.

Since: 1.0