SmartAPI usa Bearer Token para autenticar todas las peticiones.
Incluye el token en el header Authorization de cada petición.
curl -H "Authorization: Bearer sk_live_abc123..." \
https://emision.smartapp.com.co/api/v1/service/invoice
import requests
headers = {"Authorization": "Bearer sk_live_abc123..."}
resp = requests.get("https://emision.smartapp.com.co/api/v1/service/invoice", headers=headers)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://emision.smartapp.com.co/api/v1/service/invoice");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer sk_live_abc123..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
const resp = await fetch("https://emision.smartapp.com.co/api/v1/service/invoice", {
headers: { Authorization: "Bearer sk_live_abc123..." }
});
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "sk_live_abc123...");
var response = await client.GetAsync("https://emision.smartapp.com.co/api/v1/service/invoice");
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://emision.smartapp.com.co/api/v1/service/invoice"))
.header("Authorization", "Bearer sk_live_abc123...")
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
| Código | Error | Solución |
|---|---|---|
401 | Token inválido o expirado | Verifica tu API Key en Settings |
401 | Tenant no habilitado | Completa el onboarding |
403 | Scope insuficiente | Revisa los permisos de tu API Key |
X-RateLimit-Remaining en cada respuesta