Digitalisér.dk REST API

Dette API udstiller dele af Digitaliser.dk's underliggende data. API'et udstiller både læsning- og skrivningsfunktionalitet. Dataene er repræsenteret som XML, der er beskrevet i XML skemaer (se links i tabellen). API'et følger den samme rettighedsmodel som digitaliser.dk. For at tilgå REST API'et som autentificeret bruger, kan du bruge HTTP Basic Auth over HTTPS - det vil sige https://api.digitaliser.dk/rest. For at udløse en login-prompt via en browser tilgås login ressourcen.
Fejlmeddelelser i API'et er beskrevet her.

REST grænsefladen er også specificeret i en WADL (W3C, Wikipedia) fil her: http://api.digitaliser.dk/rest/application.wadl

Der findes et eksempel der benytter jQuery mod REST API'et: klassifikationsbrowseren.

For at undgå at browseren cacher svar fra REST API'et kan der sendes en tilfældig værdi med hver forespørgsel. Eksempelvis: ?rand=0.677132429377985.

Vi har udarbejdet produktionsskemaer, som du kan bruge hvis du f.eks. ønsker at lave kodegenerering. Produktionsskemaerne konsumeres lettere af de fleste tools end de 'rå' skemaer der referes til fra denne dokumentation, men indeholder præcis de samme element- og typedefinitioner, samlet i én skemafil for hvert namespace. Du skal bruge to schemaer. De kan downloades her og her.

Digitalisér.dk - din indgang til offentlig it-arkitektur og standardisering

RessourceHttp verberProducererKonsumerer
/GET text/html
artefactkinds/{title}GET text/xml application/xml application/json application/x-javascript
artefactkindsGET text/xml application/xml application/json application/x-javascript
artefacts?fileName={fileName}&
firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
classificationsystems/{uuid}DELETE
classificationsystems/{uuid}GET text/xml application/xml application/json application/x-javascript
classificationsystemsGET text/xml application/xml application/json application/x-javascript
classificationsystems/{uuid}PUT text/xml application/xml application/json
debates/latest/rss?linkto={linkto}GET application/rss+xml
emailinvites?firstname={firstname}&
surname={surname}
POST text/plain application/xml
events/{eventId}/promotions/frontpage/
image?width={width}&height={height}
GET image/png
events/{eventId}/promotions/network/
{networkId}/image?width={width}&
height={height}
GET image/png
groups/{id}DELETE
groups/{groupId}/imageDELETE
groups/{id}GET text/xml application/xml application/json application/x-javascript
groups/{id}/members?firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
groups?firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
groups/{groupId}/image?width={width}&
height={height}
GET image/png
groups/{groupid}/latest/rss?
linkto={linkto}
GET application/rss+xml
groups/{groupid}/debate/latest/rss?
linkto={linkto}
GET application/rss+xml
groups/latest/rss?linkto={linkto}GET application/rss+xml
groups/{groupid}/members/latest/rss?
linkto={linkto}
GET application/rss+xml
groups/{groupid}/newspostings/latest/rss?
linkto={linkto}
GET application/rss+xml
groups/{groupid}/resources/latest/rss?
linkto={linkto}
GET application/rss+xml
groups/{groupid}/resources?firstResult={firstResult}&
maxResults={maxResults}&
representation={representation}
GET text/xml application/xml application/json application/x-javascript
groups/{id}PUT text/plain text/xml application/xml application/json
groups/{groupId}/imagePUT
networks/{networkId}/image?width={width}&
height={height}
GET image/png
networks/{networkId}/latest/rss?
linkto={linkto}
GET application/rss+xml
networks/{networkId}/debate/latest/rss?
linkto={linkto}
GET application/rss+xml
networks/{networkId}/members/latest/rss?
linkto={linkto}
GET application/rss+xml
networks/{networkId}/newspostings/latest/
rss?linkto={linkto}
GET application/rss+xml
networks/{networkId}/resources/latest/rss?
linkto={linkto}
GET application/rss+xml
newspostings/{newsPostingId}/promotions/
frontpage/image?width={width}&
height={height}
GET image/png
newspostings/{newsPostingId}/promotions/
network/{networkId}/image?width={width}&
height={height}
GET image/png
newspostings/latest/rss?linkto={linkto}GET application/rss+xml
objectidPOST text/plain
promotions/{promotionId}/image?width={width}&
height={height}
GET image/png
resourcecategories/{id}GET text/xml application/xml application/json application/x-javascript
resourcecategoriesGET text/xml application/xml application/json application/x-javascript
resourcemetadata/{id}GET text/xml application/xml application/json application/x-javascript
resourcemetadataGET text/xml application/xml application/json application/x-javascript
resourcesPOST text/xml application/xml application/json
resources/latest/rss?linkto={linkto}GET application/rss+xml
resources?title={title}&firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
resources/search?query={query}&
firstResult={firstResult}&maxResults={maxResults}&
tags={tags}&
representation={representation}
GET text/xml application/xml application/json application/x-javascript
resources/{id:\d+}/ownergroupPOST text/xml application/xml application/json
resources/{id:\d+}/publishedstatePOST text/xml application/xml application/json
resources/{id:\d+}/versiongroupPOST text/xml application/xml application/json
resources/{id:\d+}DELETE
resources/{id:\d+}GET text/xml application/xml application/json application/x-javascript
resources/{id:\d+}/promotions/frontpage/
image?width={width}&height={height}
GET image/png
resources/{id:\d+}/promotions/network/
{networkId}/image?width={width}&
height={height}
GET image/png
resources/{id:\d+}/tagsGET text/xml application/xml application/json application/x-javascript
resources/{id:\d+}/tagsPUT text/xml application/xml application/json
resources/{id:\d+}POST text/xml application/xml application/json
resources/{resourceId}/artefacts/
{fileName}
DELETE
resources/{resourceId}/artefacts/
{fileName}
GET text/xml application/xml application/json application/x-javascript
resources/{resourceId}/artefactsGET text/xml application/xml application/json application/x-javascript
resources/{resourceId}/artefacts/{fileName}/
content
GET */*
resources/{resourceId}/artefacts/
{fileName}
PUT text/plain text/xml application/xml application/json
resources/{resourceId}/artefacts/{fileName}/
content
PUT text/plain */*
resources/{resourceId}/references/
{referenceId}
DELETE
resources/{resourceId}/references/
{referenceId}
GET text/xml application/xml application/json application/x-javascript
resources/{resourceId}/referencesGET text/xml application/xml application/json application/x-javascript
resources/{resourceId}/references/
{referenceId}
PUT text/plain text/xml application/xml application/json
search?query={query}&firstResult={firstResult}&
maxResults={maxResults}&
representation={representation}&
visibility={visibility}
GET text/xml application/xml application/json application/x-javascript
tags/{id}GET text/xml application/xml application/json application/x-javascript
tags/{id}PUT text/plain text/xml application/xml application/json
taxonomies/{taxonomyTitle}DELETE
taxonomies/{taxonomyTitle}/taxonomynodes/
{identifier}
DELETE
taxonomies/{taxonomyTitle}/taxonomynodecategories/
{categoryId}
DELETE
taxonomies/{taxonomyTitle}GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/taxonomynodes/
{identifier}
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/taxonomynodecategories/
{categoryId}
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/taxonomynodecategories/
{categoryId}/nodes
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/taxonomynodes/
{identifier}/resources
GET text/xml application/xml application/json application/x-javascript
taxonomies?firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/
taxonomynodecategories
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/taxonomynodes/
{identifier}/children
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}/taxonomynodes?
root={root}
GET text/xml application/xml application/json application/x-javascript
taxonomies/{taxonomyTitle}PUT text/xml application/xml application/json
taxonomies/{taxonomyTitle}/taxonomynodes/
{identifier}
PUT text/plain text/xml application/xml application/json
taxonomies/{taxonomyTitle}/taxonomynodecategories/
{categoryId}
PUT text/xml application/xml application/json
taxonomies/{taxonomyTitle}/search?
query={query}&firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
users/{userId}/image?width={width}&
height={height}
GET image/png
users/{id}GET text/xml application/xml application/json application/x-javascript
users?firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
users/{id}/membershipsGET text/xml application/xml application/json application/x-javascript
users/{userId}/resources?firstResult={firstResult}&
maxResults={maxResults}
GET text/xml application/xml application/json application/x-javascript
versiongroups/{id}DELETE
versiongroups/{id}GET text/xml application/xml application/json application/x-javascript
versiongroups/{id}PUT text/plain text/xml application/xml application/json

Følgende fejlmeddelelser returneres af REST API'et. Alle fejlmeddelelser benytter skemaet ErrorMessage.xsd (ErrorMessage.xsd.meta.xml).
Fejl-idFejl-beskrivelse
400-00Forespørgslen er ikke gyldig. Der forventes en anden type argument end det forespurgte.
400-01Argumentet er en streng, men skulle være et tal.
400-02ID-nummeret er ikke reserveret af den aktuelle bruger.
400-03Objektet kan ikke slettes pga. eksisterende afhængigheder.
400-04Argumentet er ikke gyldigt.
400-05Der forsøges at oprette en versionsgruppe-label der allerede eksisterer.
400-06De påkrævede argumenter for operationen er ikke udfyldte.
400-07URL'en passer ikke til det forventede mønster.
400-08Artefakt-typen kan ikke accepteres.
400-09Det ønskede antal søgeresultater er for stort.
400-10Gruppen kunne ikke slettes da den har publicerede ressourcer.
400-11Kunne ikke oprette gruppen: Der eksisterer allerede en gruppe med den angivne titel.
400-12Den tilsendte objekt-type er ikke understøttet.
400-13Den tilsendte struktur kunne ikke schemavalideres.
400-14Resourcen kan ikke repræsenteres i den valgte repræsentation.
401-00Der er ikke den nødvendige adgang til at udføre handlingen.
404-00Der kan ikke findes et objekt som passer til argumenterne i forespørgslen.
404-01REST operationen, der forsøges tilgået, findes ikke.
500-00Der opstod en ukendt fejl.
500-01Argumentet er ikke tilladt.
500-02Objektet kan ikke samles (marshall'es).
500-03Der kan ikke skrives eller læses fra disken.
500-04RSS-feedet kan ikke læses eller genereres.
500-05Versionsgruppens label er ikke unik