> ## Documentation Index
> Fetch the complete documentation index at: https://docs.databox360.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Autenticação

<div class="relative flex-1 flex gap-2 min-w-0 rounded-xl items-center cursor-pointer p-1.5 border-standard">
  <div class="method-pill rounded-lg font-bold px-1.5 py-0.5 text-sm leading-5 bg-green-400/20 dark:bg-green-400/20 text-green-700 dark:text-green-400">
    GET
  </div>

  /sessions/token
</div>

<Note>
  Antes de começar, você precisa obter sua chave de API, contate o suporte.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://sandbox-api.databox360.com.br/api/sessions/token \
    -H "Content-Type: application/json" \
    -H "Authorization: YOUR_API_KEY" \
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://sandbox-api.databox360.com.br/api/sessions/token",
    {
      method: "GET",
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
    }
  );

  const scrData = await response.json();
  console.log(scrData);
  ```

  ```python Python theme={null}
  import requests

  url = "https://sandbox-api.databox360.com.br/api/sessions/token"
  headers = {
      "Content-Type": "application/json"
      "Authorization": "YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  scr_data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $url = 'https://sandbox-api.databox360.com.br/api/sessions/token';

  $options = [
      'http' => [
          'header' => [
              "Content-type: application/json",
              "Authorization: YOUR_API_KEY"
          ],
          'method' => 'GET'
      ]
  ];

  $context = stream_context_create($options);
  $result = file_get_contents($url, false, $context);
  $scr_data = json_decode($result, true);
  ?>
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response (200) theme={null}
  {
    "data": "30/07/2025 12:02:18",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOiJhYzA3ZWI5Yi01ZDczLTRhOWMtOTYwYy1jZjc3NTBiNjU3ZGEiLCJhY2NvdW50Ijp7Im5hbWUiOiJEYXRhYm94MzYwIn0sImlhdCI6MTc1MzgzNDEwMywiZXhwIjoxNzUzODM3NzAzLCJzdWIiOiJhYzA3ZWI5Yi01ZDczLTRhOWMtOTYwYy1jZjc3NTBiNjU3ZGEifQ.-J00Tv3ACUUViTeHcdSRtdEDJ-ilPhJTFzqs0XDxPcY",
    "validade": "1753837338",
    "status": "sucesso",
    "versao": "1.0"
  }
  ```

  ```json Unauthorized (401) theme={null}
  {
    "data": "30/07/2025 12:02:18",
    "messagem": "API Key Inválida",
    "status": "erro",
    "versao": "1.0"
  }
  ```
</ResponseExample>

## Requisição

<ParamField header="api_key" type="uuid" required>
  Insira sua chave de API no parametro Authorization no header da requisição.
</ParamField>

## Resposta

<ResponseField name="data" type="string" required>
  Data e hora da requisição
</ResponseField>

<ResponseField name="token" type="string">
  Token JWT
</ResponseField>

<ResponseField name="validade" type="number">
  Validade do token
</ResponseField>

<ResponseField name="status" type="string" required>
  Status da requisição. `sucesso` ou `erro`
</ResponseField>

<ResponseField name="versao" type="string" required>
  Versão da API
</ResponseField>

<ResponseField name="messagem" type="string">
  Mensagem de erro. Este campo será recebido apenas quando o status for erro
</ResponseField>

<Note>
  Este endpoint permite que você obtenha um token JWT para autenticar
  solicitações de API. O token deve ser incluído no cabeçalho de autorização de
  todas as solicitações subsequentes.
</Note>
