---
schema_version: "1"
id: fa5bdcca211293ceee42996c17fadd5dd3cbf32627b8e01e6f0a675cf7637c6f
title: ArchiverAccessorResponse Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_SF_Archive_ArchiverAccessorResponse.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_SF_Archive_ArchiverAccessorResponse.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0028bcbdbfc663de5cb1bd90226157a51b1d6f82887e08063525419c6c238788
description: Represents the response returned by Archive Apex methods. In tests, use the setter methods to build a simulated response for your mock to return.Sets the body of the mock response as a JSON string.Sets the HTTP status code of the mock response.Sets the error message of the mock response, so you can test how your Apex handles a failed Archive Apex callout.
---
# ArchiverAccessorResponse Class

Represents the response returned by Archive Apex methods. In tests, use the setter methods to build a simulated response for your mock to return.

## Namespace

[SF\_Archive](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_SF_Archive.htm "The SF_Archive namespace provides classes for testing Apex code that calls Archive Apex.")

## Usage

In an Apex test, use setBody(), setStatusCode(), and setErrorMessage() to build a simulated response that your mock returns.

- **[ArchiverAccessorResponse Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_SF_Archive_ArchiverAccessorResponse.htm#apex_SF_Archive_ArchiverAccessorResponse_methods)**

## ArchiverAccessorResponse Methods

The following are methods for ArchiverAccessorResponse.

- **[setBody(jsonBody)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_SF_Archive_ArchiverAccessorResponse.htm#apex_SF_Archive_ArchiverAccessorResponse_setBody)**  
    Sets the body of the mock response as a JSON string.
- **[setStatusCode(statusCode)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_SF_Archive_ArchiverAccessorResponse.htm#apex_SF_Archive_ArchiverAccessorResponse_setStatusCode)**  
    Sets the HTTP status code of the mock response.
- **[setErrorMessage(errorMessage)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_SF_Archive_ArchiverAccessorResponse.htm#apex_SF_Archive_ArchiverAccessorResponse_setErrorMessage)**  
    Sets the error message of the mock response, so you can test how your Apex handles a failed Archive Apex callout.

### setBody(jsonBody)

Sets the body of the mock response as a JSON string.

#### Signature

public void setBody(String jsonBody)

#### Parameters

jsonBody

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

The response body as JSON.

#### Return Value

Type: Void

### setStatusCode(statusCode)

Sets the HTTP status code of the mock response.

#### Signature

public void setStatusCode(Integer statusCode)

#### Parameters

statusCode

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

The HTTP status code to simulate.

#### Return Value

Type: Void

### setErrorMessage(errorMessage)

Sets the error message of the mock response, so you can test how your Apex handles a failed Archive Apex callout.

#### Signature

public void setErrorMessage(String errorMessage)

#### Parameters

errorMessage

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

The error message to simulate.

#### Return Value

Type: Void