Requisição curl --request GET \
--url 'https://api.hoteldaslojas.com.br/v1/chave' \
--header 'Authorization: Bearer <chave>'
const resposta = await fetch('https://api.hoteldaslojas.com.br/v1/chave', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.HDL_CHAVE}`
}
});
if (!resposta.ok) throw new Error((await resposta.json()).erro?.mensagem);
const { dados } = await resposta.json();
console.log(dados);
import os, requests
resposta = requests.get(
"https://api.hoteldaslojas.com.br/v1/chave",
headers={"Authorization": f"Bearer {os.environ['HDL_CHAVE']}"},
timeout=30,
)
resposta.raise_for_status()
print(resposta.json()["dados"])
<?php
$ch = curl_init('https://api.hoteldaslojas.com.br/v1/chave');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('HDL_CHAVE')],
]);
$resposta = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
print_r($resposta);
{
"dados": {
"nome": "ERP da loja",
"prefixo": "hdl_live_1f12ffe",
"loja_id": 220,
"loja": "Página Dobrada",
"escopos": [
"pedidos.ler",
"pedidos.escrever",
"estoque.escrever"
],
"criada_em": "2026-10-28T03:23:00-03:00",
"limite_por_minuto": 120
}
}
{
"erro": {
"codigo": "chave_invalida",
"mensagem": "Chave da API inválida ou revogada.",
"request_id": "req_1b9c7d2e3f4a5b6c"
}
}