HTTP-routes
HTTP-eindpunten verwerken GraphQL-aanvragen, bestandsoverdrachten en apparaatverbindingen. Zie elk eindpunt hieronder voor de aanvraagindeling en authenticatievereisten.
Typedefinities
# HTTP
https://<device-host>:<https-port>
POST /graphql
POST /guest_graphql
POST /peer_graphql
GET /fs?id=<resource-id>&action=PREVIEW&size=SM
GET /zip/dir?id=<directory-resource-id>
GET /zip/files?id=<selection-archive-id>
POST /upload
POST /upload_chunk
POST /init
GET /health
POST /nearby
ANY /proxy/:peer/*path
# DLNA
GET/HEAD /dlna/description.xml
GET/HEAD /dlna/av-transport/scpd.xml
GET/HEAD /dlna/rendering-control/scpd.xml
POST /dlna/av-transport/control
POST /dlna/rendering-control/control
SUBSCRIBE/UNSUBSCRIBE /dlna/av-transport/event
SUBSCRIBE/UNSUBSCRIBE /dlna/rendering-control/event
GET/HEAD /dlna/media/:id
NOTIFY /dlna/callback
# WebSocket
wss://<device-host>:<https-port>/graphql?cid=<client-id>
wss://<device-host>:<https-port>/auth?cid=<client-id>
wss://<device-host>:<https-port>/screen?cid=<client-id>
wss://<device-host>:<https-port>/status?cid=<client-id>
wss://<device-host>:<https-port>/image_editor?cid=<client-id>Bewerkingen
POST /graphql
Hoofdeindpunt voor GraphQL. API-tokenmodus gebruikt de headers c-id en Authorization: Bearer met JSON; inlogsessiemodus gebruikt versleutelde bodies.
curl 'https://<device-host>:<https-port>/graphql' \
-H 'c-id: <client-id>' -H ': Bearer <api-token>' \
-H 'Content-Type: application/json' \
--data '{"query":"{ app { deviceName capabilities access } }"}'GET /fs
Versleutelde bron-ID: c.CLIENT_ID.PAYLOAD voor een sessie of s.SHARE_ID.PAYLOAD voor een actieve share. Sessielinks gebruiken app.urlToken en niet het GraphQL-authenticatietoken. Houd de links privé: intrekking van de sessie maakt ze ongeldig. DESCRIBE geeft toegestane metadata en mapitems terug. Andere acties: PREVIEW, DOWNLOAD, PROBE en TRANSCODE. Voorbeeldgrootte: SM of LG. Vraag bytebereiken op met HTTP Range.
curl 'https://<device-host>:<https-port>/fs?id=<resource-id>&action=PREVIEW&size=SM' -o thumbnail
curl 'https://<device-host>:<https-port>/fs?id=<resource-id>&action=DOWNLOAD' -OJ
curl 'https://<device-host>:<https-port>/fs?id=<resource-id>&action=DESCRIBE'
# describe JSON: {"entry":{"url":"/fs?id=<resource-id>&action=DOWNLOAD","name":"example.txt","isDir":false,"sizeBytes":10},"children":[]}
# action: DESCRIBE | PREVIEW | DOWNLOAD | PROBE | TRANSCODE
# size: SM | LG (PREVIEW only); v: optional cache version
# Byte ranges use the HTTP Range header.
# id: c.<client-id>.<payload> or s.<share-id>.<payload>
# Session links use app.urlToken, not the GraphQL authentication token.
# Keep resource URLs private; revoking the owning session invalidates its links.GET /zip/dir
Downloadt een toegestane map als ZIP. Accepteert een gewone /fs-bron-ID uit een sessie of de ID van een map in een actieve share. Gelijktijdige archieftaken kunnen HTTP 429 opleveren.
curl 'https://<device-host>:<https-port>/zip/dir?id=<directory-resource-id>' -o directory.zipGET /zip/files
Downloadt een selectie bestanden als ZIP. Vereist een aparte ZIP_FILES-ID die alleen voor de sessie geldt. Gewone /fs-ID’s en share-ID’s worden niet geaccepteerd.
curl 'https://<device-host>:<https-port>/zip/files?id=<selection-archive-id>' -o selection.zipGET /health
Bereikbaarheidscontrole zonder authenticatie. Geeft de plattetekstbody OK terug.
curl 'https://<device-host>:<https-port>/health'POST /init
Vereist c-id en ingeschakelde externe toegang. Een lege body haalt de configuratie op en geeft authenticated=false terug. Versleutel voor controle van een bestaande sessie de aanvragenvelop voor POST /init met het authenticatietoken ervan. Het antwoord bevat httpsPort (0 als geen HTTPS-listener beschikbaar is); opaquePublicKey en TLS-bewijsvelden zijn voorwaardelijk.
curl 'https://<device-host>:<https-port>/init' -X POST -H 'c-id: <client-id>'
# An empty body discovers configuration; it does not prove session authentication.
# To check a session, send an encrypted request envelope bound to POST /init.POST /guest_graphql
Versleutelde API binnen de deelcontext met een eigen gastcontract. c-id identificeert een actieve gedeelde bron; een API-token autoriseert geen gastaanvraag.
# Share-scoped encrypted GraphQL, not an API-token request.
# c-id: <share-id>; request bound to POST /guest_graphql.
# Contract: plain-core/schema/guest-api.graphqls
query { sharedInfo { name readOnly requiresPassword entries { name relativePath isDir size } } }POST /peer_graphql
c-id: client-ID van de afzender. c-cid: chatkanaal-ID. Kanaalberichten bevatten c-cid en gebruiken de kanaalsleutel; rechtstreekse peeraanvragen laten deze weg en gebruiken de gekoppelde sleutel.
curl 'https://<device-host>:<https-port>/peer_graphql' \
-H 'c-id: <sender-client-id>' \
-H 'c-cid: <channel-id>' \
-H 'Content-Type: application/octet-stream' \
--data-binary @peer-request.bin \
--output peer-response.bin