Gå til indholdet

Kodeeksempler

Alle eksempler bruger stage-miljøet. Erstat DIT_ACCESS_TOKEN og UUID'er med dine egne værdier.

Base URL (stage): https://videoapi.vconf-stage.dk/devicereg


Device CRUD

Opret enhed

curl -s -X POST "https://videoapi.vconf-stage.dk/devicereg/v1/device" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Patientværelse 101",
    "description": "SIP-endpoint i afdeling A",
    "location": "Bygning 1, etage 2",
    "organisation_code": "device_org",
    "enabled": true,
    "role": "MEETING_USER"
  }'

List enheder

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/devices?include_suborganisations=true" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Hent enhed

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/device/46b46a1e-a4d3-4387-87ee-a67dcaa222cb" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Opdater enhed

curl -s -X PUT "https://videoapi.vconf-stage.dk/devicereg/v1/device/46b46a1e-a4d3-4387-87ee-a67dcaa222cb" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Patientværelse 101 (opdateret)",
    "organisation_code": "device_org",
    "enabled": true,
    "role": "MEETING_USER"
  }'

Generer nyt password

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/device/46b46a1e-a4d3-4387-87ee-a67dcaa222cb/password" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Slet enhed

curl -s -X DELETE "https://videoapi.vconf-stage.dk/devicereg/v1/device/46b46a1e-a4d3-4387-87ee-a67dcaa222cb" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Meeting-kø

Push meeting til enhed (admin)

curl -s -X POST "https://videoapi.vconf-stage.dk/devicereg/v1/meetings" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "46b46a1e-a4d3-4387-87ee-a67dcaa222cb",
    "uri": "574893",
    "pin": 12345,
    "meeting_type": "oneway-nosound",
    "meeting_host": "Læge Hansen",
    "meeting_description": "Konsultation"
  }'

Poll meeting (enhed)

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/meeting" \
  -H "Authorization: Bearer DEVICE_ACCESS_TOKEN"

Eksempel-respons:

{
  "status": "MEETING_FOUND",
  "meeting": {
    "uri": "574893",
    "pin": 12345,
    "meeting_type": "oneway-nosound",
    "meeting_host": "Læge Hansen",
    "meeting_description": "Konsultation"
  }
}

Ryd meeting-kø

curl -s -X DELETE "https://videoapi.vconf-stage.dk/devicereg/v1/meetings/46b46a1e-a4d3-4387-87ee-a67dcaa222cb" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Message-kø

Push besked til enhed (admin)

curl -s -X POST "https://videoapi.vconf-stage.dk/devicereg/v1/messages" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "46b46a1e-a4d3-4387-87ee-a67dcaa222cb",
    "key": "notification",
    "value": { "text": "Du har et ventende møde" }
  }'

Poll besked (enhed)

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/message" \
  -H "Authorization: Bearer DEVICE_ACCESS_TOKEN"

Ryd message-kø

curl -s -X DELETE "https://videoapi.vconf-stage.dk/devicereg/v1/messages/46b46a1e-a4d3-4387-87ee-a67dcaa222cb" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Device Comm

Heartbeat (enhed)

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/heartbeat" \
  -H "Authorization: Bearer DEVICE_ACCESS_TOKEN"

Device Login

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/one-click/46b46a1e-a4d3-4387-87ee-a67dcaa222cb?client-id=token-client" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN"

Hent access token via login-id (public)

curl -s -X GET "https://videoapi.vconf-stage.dk/devicereg/v1/login/2ObDwXazCYU-TEe3wPv2uw"

Opret creation token (admin)

curl -s -X POST "https://videoapi.vconf-stage.dk/devicereg/v1/device-creation-token" \
  -H "Authorization: Bearer DIT_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organisation_code": "device_org",
    "client_id": "token-client"
  }'

Auto-opret enhed og hent token (public)

curl -s -X POST "https://videoapi.vconf-stage.dk/devicereg/v1/device-login" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceCreationToken": "46b46a1e-a4d3-4387-87ee-a67dcaa222cb",
    "name": "Auto-oprettet enhed"
  }'

Komplet flow: Push meeting til enhed

  1. Admin opretter enhed → gem id og keycloak_password
  2. Enhed konfigureres med short_id + password → login i Keycloak → DEVICE_ACCESS_TOKEN
  3. Admin pusher meeting med POST /v1/meetings
  4. Enhed poller med GET /v1/meeting indtil MEETING_FOUND
  5. Enhed deltager i møde med uri, pin og meeting_type
  6. Admin rydder kø med DELETE /v1/meetings/{device_id}

Se også Integrationsguide — meeting-kø-flow.

Se også

Ændringshistorik

Dato Ændring
2026-06-27 Første kodeeksempler for VDX Device Registration Service