GET /teams/{teamId}/files/{fileId}/versions
Histórico de versões do arquivo
- Access: Signed in
- Service:
https://files-api.axuz.net
Accepted authentication
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.bearerSession— JWT de acesso da sessão em `Authorization: Bearer`.
Lista files_file_versions do arquivo (mais nova primeiro). Acesso confirmado por GetFileByID, que aplica o escopo de team_id.
Arquivo anterior à Fase file-replace não tem row nenhuma na tabela; nesse caso a resposta traz UMA versão SINTÉTICA montada em memória a partir de files_files (id prefixado com legacy-, version: 1, is_current: true) — a lista nunca vem vazia para um arquivo existente.
Fonte: internal/drive/handler_versions.go:33.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
teamId | path | string | yes | |
fileId | path | string | yes |
Responses
200
OK
| Name | Type | Required | Description |
|---|---|---|---|
items | array<FilesFileVersion> | no | |
items[].id | string | no | |
items[].file_id | string<uuid> | no | |
items[].version | integer | no | |
items[].storage_key | string | no | |
items[].name | string | no | |
items[].content_type | string | no | |
items[].size_bytes | integer | no | |
items[].sha256 | string | null | no | |
items[].status | string | no | enum: |
items[].uploaded_by | string<uuid> | no | |
items[].uploaded_at | string<date-time> | no | |
items[].completed_at | string<date-time> | null | no | |
items[].is_current | boolean | no |
400
Payload/params inválidos
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | Chave/slug do erro |
message | string | no |
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
Recurso ausente
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | Chave/slug do erro |
message | string | no |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
curl
curl -sS -X GET 'https://files-api.axuz.net/teams/TEAM_ID/files/FILE_ID/versions' \
-H "Authorization: Bearer $AXUZ_TOKEN"Node.js
const res = await fetch("https://files-api.axuz.net/teams/TEAM_ID/files/FILE_ID/versions", {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"GET",
"https://files-api.axuz.net/teams/TEAM_ID/files/FILE_ID/versions",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
timeout=30,
)
res.raise_for_status()
print(res.json())