# Buscar um arquivo

A busca de arquivos é um recurso fundamental no gerenciamento de documentos, projetos e fluxos de trabalho dentro da plataforma Cange, permitindo um acesso rápido e organizado a todas as informações necessárias ao seu time.

Utilizar a API de Busca de Arquivos do Cange oferece uma maneira eficiente e automatizada de localizar e recuperar arquivos diretamente de suas aplicações ou sistemas existentes, aumentando a produtividade e a integridade dos processos de organização de documentos.

Para buscar um arquivo através da API, você precisará ter um token de acesso. Se ainda não possui o seu token, consulte nosso guia abaixo sobre como obter o token de autenticação.

{% content-ref url="/pages/9WZ3PW4K1WSS8OpsOrjm" %}
[Autenticação](/api/autenticacao.md)
{% endcontent-ref %}

## Realizando a chamada para a busca do arquivo

```http
https://api.cange.me/attachment/url-download
```

<mark style="color:green;">`GET`</mark> `/attachment/url-download`

Endpoint com o objetivo de buscar um arquivo e retornar a url para download ou o arquivo em base64

**Headers**

| Name          | Value                      |
| ------------- | -------------------------- |
| Content-Type  | `application/json`         |
| Origin        | `https://app.cange.me`     |
| Authorization | `Bearer <token de acesso>` |

**Query String Parame**

```
id_attachment=74243&withBase64=true
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    base64:"iVBORw0KGgoAAAANSUhEUgAABcEAAAGdCAYAAADaLrvmAAAAA...",
    mime_type:"image/png",
    url:"https://url...."
}
```

{% endtab %}
{% endtabs %}


---

# 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.cange.me/api/arquivos/buscar-um-arquivo.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.
