Docs de desenvolvedor

Integre a BIOS pelo código.

Exemplos prontos para copiar — curl, Python, Node.js e PHP — para os quatro pontos de integração, com a verificação de assinatura HMAC em destaque.

Segredos nunca aparecem nestes exemplos

Os placeholders de segredo abaixo nunca são preenchidos — em nenhuma superfície. O valor real é revelado uma única vez no painel, em um fluxo auditado (Keys → Reveal). Guarde-o no seu cofre ou nas variáveis de ambiente e nunca o coloque em commit ou log.

{{VERIFICATION_KEY}}{{API_KEY}}

Os campos entre chaves duplas são placeholders: no painel você encontra estes mesmos exemplos já preenchidos com os IDs e URLs do seu deployment.

Abrir o painel

Auth-bridge

Verifique cada chamada assinada

A BIOS chama o seu endpoint (o webhookUrl do deployment) com uma assinatura HMAC v1 em cada requisição. Verifique a assinatura, resolva o usuário do canal e responda ok, unknown_user ou blocked. Escopo por deployment: a Verification Key ativa chega identificada no header X-BIOS-Key-Id.

Signed request (curl - illustrative / local test)

#!/usr/bin/env bash
# NordixBIOS auth-bridge — what a signed call looks like on the wire (illustrative), and
# how to CRAFT one to test your endpoint locally before going live.
# Requires: bash, curl, openssl, uuidgen.
#
# Deployment: {{DEPLOYMENT_ID}} · signed endpoint (webhookUrl): {{WEBHOOK_URL}}
# Active Verification Key id: {{VERIFICATION_KEY_ID}} (arrives as X-BIOS-Key-Id)
#
# The Verification Key is a SECRET: reveal it once in the panel
# (Keys -> Verification -> Reveal) and keep it in your vault/environment.
# Never hardcode, commit or log it. {{VERIFICATION_KEY}} is a placeholder
# on purpose - NordixBIOS never fills it in, on any surface.
#   export BIOS_VERIFICATION_KEY='<the revealed value>'

WEBHOOK_URL='{{WEBHOOK_URL}}'                    # the endpoint NordixBIOS calls
PATH_WITH_QUERY="/${WEBHOOK_URL#*://*/}"         # path + query, no scheme/host
TIMESTAMP="$(date +%s)"                          # Unix seconds (window: +/- 300 s)
NONCE="$(uuidgen | tr '[:upper:]' '[:lower:]')"  # unique per call (anti-replay)
BODY='{"version":"1","deploymentId":"{{DEPLOYMENT_ID}}","channel":"web","channelUserId":"user@example.com","identifierType":"email","requestedAt":"2026-01-01T12:00:00Z","context":{"messageId":"msg_local_test","locale":"en"}}'

# v1 signing string: timestamp \n nonce \n POST \n path+query \n sha256(body)
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 | awk '{print $NF}')"
SIGNING_STRING="$(printf '%s\n%s\nPOST\n%s\n%s' "$TIMESTAMP" "$NONCE" "$PATH_WITH_QUERY" "$BODY_HASH")"
SIGNATURE="$(printf '%s' "$SIGNING_STRING" | openssl dgst -sha256 -hmac "$BIOS_VERIFICATION_KEY" | awk '{print $NF}')"

curl -i -X POST "$WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -H 'User-Agent: NordixBIOS-Runtime/1' \
  -H "X-BIOS-Signature: v1=$SIGNATURE" \
  -H "X-BIOS-Timestamp: $TIMESTAMP" \
  -H "X-BIOS-Nonce: $NONCE" \
  -H 'X-BIOS-Key-Id: {{VERIFICATION_KEY_ID}}' \
  -H 'X-BIOS-Delivery: dlv_local_test' \
  --data-raw "$BODY"

# A correct endpoint answers 200 with {"status":"ok",...} / {"status":"unknown_user"}
# / {"status":"blocked"} — and 401 when the signature check fails (contract sec. 7).

Webhooks

Receba eventos assinados

Os webhooks de saída notificam o seu sistema (por exemplo, sync_completed) com o mesmo esquema de assinatura v1. Escopo por parceiro. Responda 2xx rápido e deduplique reentregas pelo header X-BIOS-Delivery.

Signed request (curl - illustrative / local test)

#!/usr/bin/env bash
# NordixBIOS outbound webhook — what a signed call looks like on the wire (illustrative), and
# how to CRAFT one to test your endpoint locally before going live.
# Requires: bash, curl, openssl, uuidgen.
#
# Subscriber endpoint (this webhook): {{WEBHOOK_URL}} (partner scope)
#
# The signing secret is shown ONCE when the webhook is created (and via the
# audited reveal flow). Keep it in your vault/environment - never hardcode,
# commit or log it.
#   export BIOS_WEBHOOK_SECRET='<the revealed value>'

WEBHOOK_URL='{{WEBHOOK_URL}}'                    # the endpoint NordixBIOS calls
PATH_WITH_QUERY="/${WEBHOOK_URL#*://*/}"         # path + query, no scheme/host
TIMESTAMP="$(date +%s)"                          # Unix seconds (window: +/- 300 s)
NONCE="$(uuidgen | tr '[:upper:]' '[:lower:]')"  # unique per call (anti-replay)
BODY='{"test":true,"event":"sync_completed","at":"2026-01-01T12:00:00Z"}'

# v1 signing string: timestamp \n nonce \n POST \n path+query \n sha256(body)
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 | awk '{print $NF}')"
SIGNING_STRING="$(printf '%s\n%s\nPOST\n%s\n%s' "$TIMESTAMP" "$NONCE" "$PATH_WITH_QUERY" "$BODY_HASH")"
SIGNATURE="$(printf '%s' "$SIGNING_STRING" | openssl dgst -sha256 -hmac "$BIOS_WEBHOOK_SECRET" | awk '{print $NF}')"

curl -i -X POST "$WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -H 'User-Agent: NordixBIOS-Webhook/1.0' \
  -H "X-BIOS-Signature: v1=$SIGNATURE" \
  -H "X-BIOS-Timestamp: $TIMESTAMP" \
  -H "X-BIOS-Nonce: $NONCE" \
  -H 'X-BIOS-Key-Id: whsec_1' \
  -H 'X-BIOS-Delivery: dlv_local_test' \
  --data-raw "$BODY"

# Your endpoint must answer 2xx fast and deduplicate retries by X-BIOS-Delivery.

API REST

Automatize pela API pública

Autentique com o header X-API-Key (uma chave por parceiro), pagine com page e perPage e torne as criações seguras para retry com Idempotency-Key. Exemplos em curl, Python, Node.js e PHP.

REST API calls (curl)

#!/usr/bin/env bash
# NordixBIOS REST API — curl (API key: {{API_KEY_ID}} · base URL: {{API_BASE}})
#
# The API key VALUE is a SECRET: reveal it once in the panel (Keys -> API ->
# Reveal) and keep it in your vault/environment. Never hardcode, commit or log
# it. {{API_KEY}} is a placeholder on purpose - NordixBIOS never fills it in.
#   export BIOS_API_KEY='<the revealed value>'

# 1) List assistants — offset pagination (?page=&perPage=; the response carries
#    meta.page / meta.perPage / meta.total / meta.totalPages). Scope: read.
curl -s "{{API_BASE}}/assistants?page=1&perPage=20" \
  -H "X-API-Key: $BIOS_API_KEY"

# 2) Create an assistant — scope: write. The Idempotency-Key header makes
#    retries safe: resending the SAME key replays the SAME creation instead of
#    duplicating it.
curl -s -X POST "{{API_BASE}}/assistants" \
  -H "X-API-Key: $BIOS_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $(uuidgen)" \
  --data-raw '{"name":"Support Assistant","language":"en","currency":"EUR","monthlyCostLimit":100}'

Web widget

Incorpore o assistente no seu site

Um snippet HTML por assistente: cole antes do fechamento do body nos domínios liberados para o canal web. Gere ou renove o widgetId no painel (Canais → Web widget).

Embed snippet (HTML)

<!-- NordixBIOS web widget — paste right before </body>.
     The widget is per-assistant: {{WIDGET_ID}} identifies the assistant's web
     channel (generate or refresh it in the panel: Channels -> Web widget).
     Only the domains you allow-listed for the channel may embed it. -->
<script>
  (function(d,s,c){
    var j=d.createElement(s);j.async=true;
    j.src='{{BASE_URL}}/widget.js';
    j.setAttribute("data-config", JSON.stringify(c));
    d.body.appendChild(j);
  })(document,"script",{"widgetId":"{{WIDGET_ID}}","theme":"auto","position":"bottom-right","apiBase":"{{API_BASE}}"});
</script>

Pronto para integrar?

Comece os seus 14 dias de teste grátis e gere as suas chaves no painel.

Falar com a BIOS · WhatsApp