# deleteDoc

### Overview

Parameters:

* String - doc token

Return:

* [DocResponse ](https://docs.zapsign.com.br/english/facilitators/sdks/java-sdk/used-classes/response/docresponse)- success
* Exception - failure

To delete this document we need:

* set your api token.
* set your doc token.
* call the method.

### Usage:

Import the relevant components:

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

import services.JsonConverter;
```

Set your [Api Token](https://docs.zapsign.com.br/english/master):

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

Set your doc token.

```java
String docToken = "DOC TOKEN"
```

Call the method deleteDoc and receive the [DocResponse](https://docs.zapsign.com.br/english/facilitators/sdks/java-sdk/used-classes/response/docresponse) class or an error message as a response:

```java
try {
    DocResponse docResponse = new DocRequests(apiToken).deleteDoc(docToken);

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

### Example:

```java
import docs.DocRequests;
import response.DocResponse;
import services.JsonConverter;

public class DeleteDoc {
    public static void main(String[] args) throws Exception {
        String apiToken = "YOUR TOKEN";
        String docToken = "DOC TOKEN"

        try {
            DocResponse docResponse = new DocRequests(apiToken).deleteDoc(docToken);

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