# deleteDoc

### Visão geral

Parâmetros:&#x20;

* String - token do documento

Retorno:

* [DocsResponse ](/facilitadores/sdks/sdk-em-java/classes-usadas/response/docresponse.md)- caso sucesso
* Exception - caso falha

Para deletar um documento precisamos:

* definir seu token api.
* token do documento.
* chamar o método.

### Uso:

Importe os componentes relevantes:

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

import services.JsonConverter;
```

Salve seu [Api Token](/master.md):

```
String apiToken = "SEU TOKEN";
```

Salve o token do documento:

```
String docToken = "TOKEN DOCUMENTO";
```

Chame o método deleteDoc e receba como resposta a classe [DocResponse ](/facilitadores/sdks/sdk-em-java/classes-usadas/response/docresponse.md)ou uma mensagem de erro:

```
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());
}
```

### Exemplo completo:

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

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

        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());
        }
    }
}
```


---

# 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/facilitadores/sdks/sdk-em-java/requisicoes-para-documentos/deletedoc.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.
