# getDocs

### Overview

Return:

* [DocsResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docsresponse.md) - success
* Exception - failure

To get your documents we need:

* set your api token.
* call the method.

### Usage:

Import the relevant components:

```java
import docs.DocRequests;
import response.DocsResponse;

import services.JsonConverter;
```

Set your [Api Token](/english/master.md):

```java
String apiToken = "YOUR TOKEN";
```

Call the method getDocs and receive the [DocsResponse](/english/facilitators/sdks/java-sdk/used-classes/response/docsresponse.md) class or an error message as a response:

```java
try {
    DocsResponse docsResponse = new DocRequests(apiToken).getDocs();

    String jsonDocResponse = new JsonConverter().docsResponseToJson(docsResponse);
    System.out.println(jsonDocResponse);
}
catch(Exception exceptionError) {
    System.out.println(exceptionError.getMessage());
}
```

### Example:

<pre class="language-java"><code class="lang-java">import docs.DocRequests;
import response.DocsResponse;
import services.JsonConverter;

public class GetDocs {
    public static void main(String[] args) throws Exception {
<strong>    String apiToken = "YOUR TOKEN";
</strong>
        try {
            DocsResponse docsResponse = new DocRequests(apiToken).getDocs();

            String jsonDocResponse = new JsonConverter().docsResponseToJson(docsResponse);
            System.out.println(jsonDocResponse);
        }
        catch(Exception exceptionError) {
            System.out.println(exceptionError.getMessage());
        }
    }
}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zapsign.com.br/english/facilitators/sdks/java-sdk/documents-requests/getdocs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
