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.

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.

hasFailed ​

apex
global Boolean hasFailed

Type: Boolean

Indicates if the service call failed.

isAborted ​

apex
global Boolean isAborted

Type: Boolean

Indicates if the service call was aborted.

isSuccess ​

apex
global Boolean isSuccess

Type: Boolean

Indicates if the service call completed successfully.

statusText ​

apex
global String statusText

Type: String

Text representation of the service status.

Fields ​

FieldDescription
global List<String> 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.

errors ​

apex
global List<String> errors

Type: List

List of errors encountered during the service call.

isMocked ​

apex
global Boolean isMocked

Type: Boolean

Indicates if the service call response was mocked.

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.

requestBody ​

apex
global String requestBody

Type: String

The request body sent.

requestHeaders ​

apex
global DTO_NameValues requestHeaders

Type: DTO_NameValues

Request headers as name-value pairs.

responseBody ​

apex
global String responseBody

Type: String

The response body received.

responseHeaders ​

apex
global DTO_NameValues responseHeaders

Type: DTO_NameValues

Response headers as name-value pairs.

status ​

apex
global API_Base.WebserviceStatus status

Type: API_Base.WebserviceStatus

The status of the web service call.

statusCode ​

apex
global String statusCode

Type: String

The HTTP status code for the request.

url ​

apex
global String url

Type: String

The URL of the endpoint accessed.